mps-renklendirme-ayarları

This commit is contained in:
milisbir 2018-11-07 03:33:01 +02:00
parent 2305871d1e
commit 09587eeba3
1 changed files with 49 additions and 47 deletions

100
bin/mps
View File

@ -77,8 +77,6 @@ if [ -z ${git_yereldepo+:} ]; then
git_yereldepo="/sources/milis.git" git_yereldepo="/sources/milis.git"
fi fi
if [ -z ${anatalimatname+:} ]; then if [ -z ${anatalimatname+:} ]; then
anatalimatname="${git_yereldepo}/talimatname" anatalimatname="${git_yereldepo}/talimatname"
fi fi
@ -126,6 +124,10 @@ else
fi fi
fi fi
if [ -z ${renklendirme+:} ]; then
renkdurum="--renkli"
fi
if [ -z ${silme_esgec+:} ]; then if [ -z ${silme_esgec+:} ]; then
silme_esgec="" silme_esgec=""
fi fi
@ -180,12 +182,6 @@ _indiriliyor="indiriliyor"
export _paketguncel=0 export _paketguncel=0
# renkli yazma öntanımlı atamaları
_yaz="ryaz 32"
_yaz_tm="ryaz 34"
_yaz_uyari="ryaz 31"
_yaz_bilgi="ryaz 33"
hata_olustu(){ hata_olustu(){
local _hata _mesaj local _hata _mesaj
[ -z $1 ] && exit 1 [ -z $1 ] && exit 1
@ -215,8 +211,8 @@ cikti_renk_ayarla(){
local cikti local cikti
cikti="--renkli" cikti="--renkli"
if [ "$1" ]; then if [ "$1" ]; then
if [ "$1" = "--normal" ];then if [ "$1" = "--renksiz" ];then
cikti="--normal" cikti="--renksiz"
fi fi
fi fi
@ -224,6 +220,7 @@ cikti_renk_ayarla(){
_yaz="ryaz 32" _yaz="ryaz 32"
_yaz_tm="ryaz 34" _yaz_tm="ryaz 34"
_yaz_uyari="ryaz 31" _yaz_uyari="ryaz 31"
_yaz_bilgi="ryaz 33"
else else
_yaz="echo" _yaz="echo"
_yaz_tm="echo" _yaz_tm="echo"
@ -308,8 +305,8 @@ paket_sil(){
_sek=1 _sek=1
cikti="--renkli" cikti="--renkli"
if [ "$2" ]; then if [ "$2" ]; then
if [ "$2" == "--normal" ];then if [ "$2" == "--renksiz" ];then
cikti_renk_ayarla "--normal" cikti_renk_ayarla "--renksiz"
else else
oto_silme="$2" oto_silme="$2"
fi fi
@ -319,8 +316,8 @@ paket_sil(){
fi fi
if [ "$3" ]; then if [ "$3" ]; then
if [ "$3" == "--normal" ];then if [ "$3" == "--renksiz" ];then
cikti_renk_ayarla "--normal" cikti_renk_ayarla "--renksiz"
else else
tersbag_goster="evet" tersbag_goster="evet"
fi fi
@ -415,7 +412,7 @@ paket_liste(){
mps_paketler_listesi="/tmp/mps_paketler_listesi" mps_paketler_listesi="/tmp/mps_paketler_listesi"
local cikti _grup local cikti _grup
_grup="yok" _grup="yok"
cikti="--normal" cikti="--renksiz"
if [ "$1" ]; then if [ "$1" ]; then
if [ "$1" == "--json" ];then if [ "$1" == "--json" ];then
cikti="--json" cikti="--json"
@ -795,8 +792,6 @@ deps(){
local _depsf="/tmp/deps" local _depsf="/tmp/deps"
local _kurkon=0 local _kurkon=0
local _pkt local _pkt
#[ "$2" = "--normal" ] && cikti_renk_ayarla "$2"
#[ "$3" = "--normal" ] && cikti_renk_ayarla "$3"
[ $1 ] && _pkt=$1 || hata_olustu "_talimat_bulunamadi" [ $1 ] && _pkt=$1 || hata_olustu "_talimat_bulunamadi"
$_yaz "$1 $_gerekler_belirleniyor" $_yaz "$1 $_gerekler_belirleniyor"
[ $2 ] && [ $2 == "--kurulu_atla" ] && _kurkon=1 [ $2 ] && [ $2 == "--kurulu_atla" ] && _kurkon=1
@ -886,8 +881,8 @@ gerekleri_listele(){
} }
derleme_listyap(){ derleme_listyap(){
[ "$2" = "--normal" ] && cikti_renk_ayarla "$2" [ "$2" = "--renksiz" ] && cikti_renk_ayarla "$2"
[ "$3" = "--normal" ] && cikti_renk_ayarla "$3" [ "$3" = "--renksiz" ] && cikti_renk_ayarla "$3"
$_yaz "$1 $_gerekler_belirleniyor" $_yaz "$1 $_gerekler_belirleniyor"
gerekleri_listele $@ gerekleri_listele $@
} }
@ -1041,12 +1036,7 @@ paket_inkur_oto(){
kurdurum="kurulu değil" kurdurum="kurulu değil"
elif [ $(kurulu_kontrol ${_pkt}) = "kurulu" ];then elif [ $(kurulu_kontrol ${_pkt}) = "kurulu" ];then
kurdurum="kurulu" kurdurum="kurulu"
#_gnc_kntrl=$(surum_devir_kontrol "${_pkt}" "--normal")
#if [ ${_gnc_kntrl} = "var" ];then
# paket_guncelle ${_pkt}
#else
$_yaz "${_pkt} $kurdurum" $_yaz "${_pkt} $kurdurum"
#fi
else else
kurdurum="$_paket_tanimsiz" kurdurum="$_paket_tanimsiz"
fi fi
@ -2200,7 +2190,7 @@ kurulu_kontrol(){
local _konum _apaket local _konum _apaket
[ -z $1 ] && hata_olustu "_paket_adi_gerekli" [ -z $1 ] && hata_olustu "_paket_adi_gerekli"
_apaket=$1 _apaket=$1
cikti_renk_ayarla "--normal" cikti_renk_ayarla "--renksiz"
[ $2 ] && cikti_renk_ayarla "$2" [ $2 ] && cikti_renk_ayarla "$2"
if [ -d "$kokdizin$VT/$_apaket" ];then if [ -d "$kokdizin$VT/$_apaket" ];then
$_yaz "kurulu" $_yaz "kurulu"
@ -3037,7 +3027,6 @@ paket_indir(){
if [ -f "$paketdepo""paket.vt" ];then if [ -f "$paketdepo""paket.vt" ];then
local _ipaket pkt _indirildi local _ipaket pkt _indirildi
[ $1 ] && _ipaket="$1" || hata_olustu "_paket_adi_gerekli" [ $1 ] && _ipaket="$1" || hata_olustu "_paket_adi_gerekli"
[ "$2" ] && cikti_renk_ayarla "$2"
local _sunucular _sira local _sunucular _sira
_sunucular=$(echo ${sunucular} | tr " " "\n") _sunucular=$(echo ${sunucular} | tr " " "\n")
_sira=0 _sira=0
@ -3063,7 +3052,7 @@ paket_indir(){
wget -q --spider "$pktsunucu$cpaket" wget -q --spider "$pktsunucu$cpaket"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
$_yaz "${_ipaket} $_indiriliyor" $_yaz "${_ipaket} $_indiriliyor"
if [ "$cikti" == "--normal" ];then if [ "${_yaz}" == "echo" ];then
wget --progress=dot:force -nc --no-check-certificate -P "$paketdepo" "$pktsunucu$cpaket" 2>&1 | tee /tmp/${_ipaket}_indirme.log | sed -u -n 's/[0-9]*%/&/p' wget --progress=dot:force -nc --no-check-certificate -P "$paketdepo" "$pktsunucu$cpaket" 2>&1 | tee /tmp/${_ipaket}_indirme.log | sed -u -n 's/[0-9]*%/&/p'
else else
wget --no-check-certificate -nc -q ${wget_progress} -P "$paketdepo" "$pktsunucu$cpaket" #2>&1 | tee /tmp/${_ipaket}_indirme.log wget --no-check-certificate -nc -q ${wget_progress} -P "$paketdepo" "$pktsunucu$cpaket" #2>&1 | tee /tmp/${_ipaket}_indirme.log
@ -3151,11 +3140,6 @@ yerelden_kur(){
} }
agdan_kur(){ agdan_kur(){
local kontroldeg _cikti _yaz _yaz_tm _yaz_uyari
_cikti="--normal"
[ $2 ] && _cikti="$2"
cikti_renk_ayarla $_cikti
kkont=$(kurulu_kontrol "$1") kkont=$(kurulu_kontrol "$1")
if [ "$kkont" = "degil" ] || [ "$tekrarkur" = "evet" ];then if [ "$kkont" = "degil" ] || [ "$tekrarkur" = "evet" ];then
paket_indir "$1" "$2" paket_indir "$1" "$2"
@ -3188,15 +3172,36 @@ agdan_kur(){
fi fi
} }
_arg_sil(){
args=`echo "${args}" | sed -e "s/${_arg}//"`
}
ayarlar() { ayarlar() {
# renkli yazma öntanımlı atamaları
cikti_renk_ayarla ${renkdurum}
# global değişkenlerin işlenmesi
args="${@:2}" args="${@:2}"
if [[ "${args}" =~ "--htbl" ]] || [[ "${args}" =~ "--debug" ]];then
set -x
fi
while [ "$1" ]; do
case $1 in
### Milis_Paket_Sistemi_Yardim ### Milis_Paket_Sistemi_Yardim
### -------------------------- ### --------------------------
### mps ... --debug|--htbl = mps için hata ayıklama modunu aktifleştirir.
if [[ "${args}" =~ "--htbl" ]] || [[ "${args}" =~ "--debug" ]];then
# args ın global değişkenlerden temizlenmesi
_arg="--htbl";_arg_sil
_arg="--debug";_arg_sil
set -x
fi
### mps ... --renksiz|--no-color = mps çıktıklarının renksiz yazdırılması.
if [[ "${args}" =~ "--renksiz" ]] || [[ "${args}" =~ "--no-color" ]];then
_arg="--renksiz";_arg_sil
cikti_renk_ayarla "--renksiz"
fi
while [ "$1" ]; do
case $1 in
### mps -i paketismi = sadece paketi indirir,paket kurulmaz. ### mps -i paketismi = sadece paketi indirir,paket kurulmaz.
-i|--indir) -i|--indir)
kurulum_onay="olumsuz" kurulum_onay="olumsuz"
@ -3585,8 +3590,8 @@ ayarlar() {
bil) bil)
if [ $2 ];then if [ $2 ];then
if [ $3 ];then if [ $3 ];then
[ $2 == "surum" ] && paket_bilgi "$3" "--normal" | sed -n 6p | cut -d':' -f2 | sed 's/^ *//;s/ *$//' [ $2 == "surum" ] && paket_bilgi "$3" "--renksiz" | sed -n 6p | cut -d':' -f2 | sed 's/^ *//;s/ *$//'
[ $2 == "devir" ] && paket_bilgi "$3" "--normal" | sed -n 7p | cut -d':' -f2 | sed 's/^ *//;s/ *$//' [ $2 == "devir" ] && paket_bilgi "$3" "--renksiz" | sed -n 7p | cut -d':' -f2 | sed 's/^ *//;s/ *$//'
else else
$_yaz_uyari "paket ismi eksik" $_yaz_uyari "paket ismi eksik"
exit 1 exit 1
@ -3632,7 +3637,6 @@ ayarlar() {
log_analiz "$2" "$3" ;; log_analiz "$2" "$3" ;;
### mps guncelle . = paket veritabanı ve git güncellemesi-talimatname bilgilerini günceller. ### mps guncelle . = paket veritabanı ve git güncellemesi-talimatname bilgilerini günceller.
guncelle) guncelle)
[ "$2" ] && cikti_renk_ayarla "$2"
git_guncelle; git_guncelle;
paketvt_guncelle; paketvt_guncelle;
kurulum_dogrulama; kurulum_dogrulama;
@ -3640,27 +3644,22 @@ ayarlar() {
exit 0 ;; exit 0 ;;
### mps -GG . = git güncellemelerini ve talimatname bilgilerini günceller. ### mps -GG . = git güncellemelerini ve talimatname bilgilerini günceller.
-Ggit|-GG) -Ggit|-GG)
[ "$2" ] && cikti_renk_ayarla "$2"
git_guncelle git_guncelle
exit 0 ;; exit 0 ;;
### mps -G . = paket veritabanı bilgilerini günceller. ### mps -G . = paket veritabanı bilgilerini günceller.
-G|--pvtg) -G|--pvtg)
[ "$2" ] && cikti_renk_ayarla "$2"
paketvt_guncelle paketvt_guncelle
kurulum_dogrulama kurulum_dogrulama
exit 0 ;; exit 0 ;;
### mps -GGG . = ek git repo bilgilerini günceller. ### mps -GGG . = ek git repo bilgilerini günceller.
-GGG) -GGG)
[ "$2" ] && cikti_renk_ayarla "$2"
git_ek_guncelle git_ek_guncelle
exit 0 ;; exit 0 ;;
### mps tespit . = tüm sistemin güncellemesi için güncellenecek paket listesini gösterir. ### mps tespit . = tüm sistemin güncellemesi için güncellenecek paket listesini gösterir.
tespit) tespit)
[ "$2" ] && cikti_renk_ayarla "$2"
guncelleme_tespit guncelleme_tespit
exit 0 ;; exit 0 ;;
tespit2) tespit2)
[ "$2" ] && cikti_renk_ayarla "$2"
guncelleme_tespit_hizli guncelleme_tespit_hizli
exit 0 ;; exit 0 ;;
### mps gun . = güncellenmesi gereken ve depoya yeni eklenen paketleri gösterir. ### mps gun . = güncellenmesi gereken ve depoya yeni eklenen paketleri gösterir.
@ -3669,8 +3668,6 @@ ayarlar() {
exit 0 ;; exit 0 ;;
### mps yukselt . = tüm sistemin güncellemesini gerçekleştirir. ### mps yukselt . = tüm sistemin güncellemesini gerçekleştirir.
-GS|yukselt) -GS|yukselt)
#cikti_renk_ayarla "--normal"
#[ $2 ] && cikti_renk_ayarla "$2"
sistem_guncelle $args sistem_guncelle $args
exit 0 ;; exit 0 ;;
#tekil temel paket guncelleme-single base package updating #tekil temel paket guncelleme-single base package updating
@ -3841,8 +3838,8 @@ ayarlar() {
### mps -v . = mps sürüm bilgisini gösterir. ### mps -v . = mps sürüm bilgisini gösterir.
-v) -v)
$_yaz_bilgi "$betikad $versiyon $iletisim $shelltip" $_yaz_bilgi "$betikad $versiyon $iletisim $shelltip"
echo "$betikad $versiyon $iletisim $shelltip kullanıcı: $SUDO_USER" | bilgi_kutusu #echo "$betikad $versiyon $iletisim $shelltip kullanıcı: $SUDO_USER" | bilgi_kutusu
exit 0 ;; _exit ;;
-y|-h|yardim) -y|-h|yardim)
yardim_icerik yardim_icerik
@ -3867,6 +3864,11 @@ bilgi_kutusu() {
--button='KAPAT!gtk-quit:1' --button='KAPAT!gtk-quit:1'
} }
_exit(){
echo "exit"
exit 0
}
ana(){ ana(){
if [ `id -u` = 0 ] ; then if [ `id -u` = 0 ] ; then
ayarlar "$@" ayarlar "$@"