2016-02-24 01:27:23 +01:00
|
|
|
|
#!/bin/bash
|
2016-04-12 00:14:39 +02:00
|
|
|
|
#. ./mpsd.conf
|
|
|
|
|
. ./bin/fonks.sh
|
2016-04-17 01:08:11 +02:00
|
|
|
|
versiyon="0.4"
|
2016-03-19 01:55:02 +01:00
|
|
|
|
iletisim="milisarge@gmail.com"
|
2016-04-12 00:14:39 +02:00
|
|
|
|
paketdepo="/tmp/paketler/"
|
2016-04-21 07:46:06 +02:00
|
|
|
|
sunucu="192.168.1.23:8000/"
|
2016-04-17 15:06:06 +02:00
|
|
|
|
#sunucu="http://milis.gungre.ch/packages/"
|
2016-03-07 00:39:49 +01:00
|
|
|
|
git_sunucu="https://github.com/milisarge/malfs-milis"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
ikaynak=""
|
|
|
|
|
betikad=${0##*/}
|
|
|
|
|
kurulum_onay="evet"
|
2016-04-12 00:14:39 +02:00
|
|
|
|
talimatname_dizin="/opt/malfs-milis/talimatname"
|
2016-02-24 22:31:11 +01:00
|
|
|
|
kokdizin="/"
|
2016-03-19 01:55:02 +01:00
|
|
|
|
VT="/var/lib/pkg/DB"
|
|
|
|
|
TARIHCE_DIZIN="/var/lib/pkg/tarihce"
|
2016-04-12 00:14:39 +02:00
|
|
|
|
LOGDIZIN="/var/log/mps"
|
|
|
|
|
tekrarkur="hayir"
|
|
|
|
|
lokal="tr"
|
|
|
|
|
docsil="evet"
|
|
|
|
|
yerelsil="evet"
|
2016-03-19 01:55:02 +01:00
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
|
|
|
|
|
icerik_ekle(){
|
|
|
|
|
paketad=`echo "$1" | cut -d'#' -f1`
|
|
|
|
|
paketad=`basename $paketad`
|
2016-04-12 00:14:39 +02:00
|
|
|
|
ryaz 34 $paketad" paketi kuruluyor-> $kokdizin"
|
2016-02-26 03:41:17 +01:00
|
|
|
|
tar -C /tmp --extract --file=$1 .PRE 1 2> /tmp/$paketad_pre.log
|
2016-02-26 02:41:51 +01:00
|
|
|
|
#kos-kur kontrolu
|
|
|
|
|
if [ -f /tmp/.PRE ];then
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ "$kokdizin" == "/" ];then
|
|
|
|
|
bash /tmp/.PRE
|
|
|
|
|
else
|
|
|
|
|
cp /tmp/.PRE $kokdizin/tmp/$paketad.PRE
|
|
|
|
|
fi
|
2016-02-26 02:41:51 +01:00
|
|
|
|
rm /tmp/.PRE
|
|
|
|
|
fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
mkdir -p kur.$paketad &&
|
|
|
|
|
tar xf $1 -C kur.$paketad &&
|
|
|
|
|
#istenmeyen yerellerin silinmesi
|
|
|
|
|
if [ -d kur.$paketad/usr/share/locale ] && [ "$yerelsil" == "evet" ];then
|
|
|
|
|
for lkl in `ls kur.$paketad/usr/share/locale/`;do
|
|
|
|
|
if [ "$lkl" != "$lokal" ];then rm -r kur.$paketad/usr/share/locale/$lkl; fi
|
|
|
|
|
done
|
2016-02-26 02:41:51 +01:00
|
|
|
|
fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
#doc dizini silinmesi
|
|
|
|
|
if [ -d kur.$paketad/usr/share/doc ] && [ "$docsil" == "evet" ];then
|
|
|
|
|
rm -r kur.$paketad/usr/share/doc
|
2016-02-24 01:27:23 +01:00
|
|
|
|
fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
mkdir -p $kokdizin/var/lib/pkg/DB/"$paketad" &&
|
|
|
|
|
cp -v -afr kur.$paketad/* $kokdizin > kur.$paketad/kurulan &&
|
|
|
|
|
cp kur.$paketad/kurulan /tmp/ &&cat kur.$paketad/kurulan | cut -d '>' -f2 > $kokdizin/var/lib/pkg/DB/"$paketad"/kurulan &&
|
|
|
|
|
#mv kur.$paketad/.MTREE /var/lib/pkg/DB/"$paketad"/files &&
|
|
|
|
|
mv kur.$paketad/.META $kokdizin/var/lib/pkg/DB/"$paketad"/META &&
|
2016-03-19 01:55:02 +01:00
|
|
|
|
|
|
|
|
|
#kur-kos calistirilmasi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ -f kur.$paketad/.POST ];then
|
|
|
|
|
if [ "$kokdizin" == "/" ];then
|
|
|
|
|
bash kur.$paketad/.POST
|
2016-02-24 01:27:23 +01:00
|
|
|
|
else
|
2016-04-12 00:14:39 +02:00
|
|
|
|
cp kur.$paketad/.POST $kokdizin/tmp/$paketad.POST
|
2016-02-24 01:27:23 +01:00
|
|
|
|
fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
rm kur.$paketad/.POST
|
2016-02-24 01:27:23 +01:00
|
|
|
|
fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
|
|
|
|
|
rm -r kur.$paketad
|
|
|
|
|
if [ -f $kokdizin/etc/ld.so.conf ];then
|
|
|
|
|
ldconfig -r $kokdizin
|
|
|
|
|
fi
|
|
|
|
|
ryaz 34 $paketad" paketi kuruldu."
|
|
|
|
|
loglama "$paketad paketi kuruldu."
|
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-19 01:55:02 +01:00
|
|
|
|
paket_sil(){
|
|
|
|
|
local paket kkont sil_onay oto_silme
|
2016-03-07 01:43:25 +01:00
|
|
|
|
paket="$1"
|
2016-03-19 01:55:02 +01:00
|
|
|
|
if [ "$2" ]; then
|
|
|
|
|
oto_silme="$2"
|
|
|
|
|
fi
|
|
|
|
|
kkont=`kurulu_kontrol "$1"`
|
|
|
|
|
if [ "$kkont" = "kurulu" ];then
|
|
|
|
|
if [ -f "/var/lib/pkg/DB/$paket/kurulan" ];then
|
2016-03-07 18:52:54 +01:00
|
|
|
|
cat /var/lib/pkg/DB/$paket/kurulan | cut -d '>' -f2 > /tmp/$paket.sil
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 31 "ters bagimliliklar"
|
|
|
|
|
ryaz 31 "------------------"
|
|
|
|
|
ters_bagimli_kontrol "$paket"
|
|
|
|
|
ryaz 31 "------------------"
|
2016-04-17 01:08:11 +02:00
|
|
|
|
ryaz 31 "kurban dosyalar"
|
|
|
|
|
ryaz 31 "------------------"
|
|
|
|
|
silme_kurban_kontrol /tmp/$paket.sil
|
|
|
|
|
ryaz 31 "------------------"
|
2016-03-19 01:55:02 +01:00
|
|
|
|
if [ "$oto_silme" = "evet" ];then
|
|
|
|
|
sil_onay="e"
|
|
|
|
|
else
|
|
|
|
|
while true; do
|
|
|
|
|
ryaz 34 $paket" paketi kaldırılsın mı?";read -p "e veya h-> " eh
|
|
|
|
|
case $eh in
|
|
|
|
|
[Ee]* ) sil_onay="e"; break;;
|
|
|
|
|
[Hh]* ) break;;
|
|
|
|
|
* ) echo "e veya h";;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
fi
|
2016-03-07 01:43:25 +01:00
|
|
|
|
if [ "$sil_onay" = "e" ];then
|
|
|
|
|
xargs rm -r -f < /tmp/$paket.sil &&
|
|
|
|
|
rm -r -f /var/lib/pkg/DB/"$paket" &&
|
|
|
|
|
ryaz 34 $paket" paketi silindi."
|
2016-04-12 00:14:39 +02:00
|
|
|
|
loglama "$paket paketi silindi."
|
2016-03-07 01:43:25 +01:00
|
|
|
|
fi
|
|
|
|
|
rm -f /tmp/$paket.sil
|
|
|
|
|
else
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 31 "kritik mesaj:kurulanlar dosyası yok."
|
2016-03-07 01:43:25 +01:00
|
|
|
|
fi
|
|
|
|
|
else
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 32 "paket zaten kurulu değil!"
|
2016-03-07 01:43:25 +01:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
paket_bilgi(){
|
|
|
|
|
local paket kkont
|
|
|
|
|
kkont=`kurulu_kontrol "$1"`
|
|
|
|
|
if [ "$kkont" = "kurulu" ];then
|
|
|
|
|
paket="$1"
|
|
|
|
|
cat /var/lib/pkg/DB/"$paket"/META
|
|
|
|
|
else
|
|
|
|
|
echo "paket kurulu değil!"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-19 01:55:02 +01:00
|
|
|
|
yeniden_paketle(){
|
2016-04-12 00:14:39 +02:00
|
|
|
|
cd $1
|
|
|
|
|
bsdtar -r -f ../"$1".mps .META
|
|
|
|
|
bsdtar -r -f ../"$1".mps *
|
|
|
|
|
cd ..
|
|
|
|
|
lzip -9 "$1".mps
|
2016-03-19 01:55:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
derleme_listyap(){
|
2016-03-02 01:26:35 +01:00
|
|
|
|
bagimlist=`bagimlilar "$1"`
|
2016-02-24 01:27:23 +01:00
|
|
|
|
for bagim in $bagimlist;do
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ "`cat tumbag.liste | grep $bagim`" != "$bagim" ];then
|
2016-02-24 01:27:23 +01:00
|
|
|
|
derleme_listyap "$bagim"
|
|
|
|
|
fi
|
|
|
|
|
done
|
2016-04-12 00:14:39 +02:00
|
|
|
|
#if [ "`cat tumbag.liste | grep $1`" != "$1" ];then
|
|
|
|
|
# echo "tumbag.liste yazılıyor:" "$1"
|
|
|
|
|
# echo "$1" >> tumbag.liste
|
2016-02-24 01:27:23 +01:00
|
|
|
|
#fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if ! grep -Fxq "$1" tumbag.liste
|
2016-02-24 01:27:23 +01:00
|
|
|
|
then
|
|
|
|
|
# echo "pas"
|
|
|
|
|
#else
|
2016-02-28 00:55:08 +01:00
|
|
|
|
ana="`find $talimatname_dizin -name $1`"
|
|
|
|
|
echo ${ana#"$talimatname_dizin"}
|
|
|
|
|
#sadece genel bagimliliklar derlenecek
|
2016-04-12 00:14:39 +02:00
|
|
|
|
echo "$1" >> tumbag.liste
|
2016-02-28 00:55:08 +01:00
|
|
|
|
if [ -d "$talimatname_dizin/genel/$1" ];then
|
2016-04-12 00:14:39 +02:00
|
|
|
|
echo "$1" >> bag.liste
|
2016-02-28 00:55:08 +01:00
|
|
|
|
fi
|
2016-02-24 01:27:23 +01:00
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-02 01:26:35 +01:00
|
|
|
|
derleme_listbilgi(){
|
2016-03-07 00:39:49 +01:00
|
|
|
|
ryaz 34 "yapim asamasında"
|
2016-03-02 01:26:35 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
paket_derle_oto(){
|
2016-02-28 00:55:08 +01:00
|
|
|
|
for dpkt in `cat $1`;do
|
2016-02-24 01:27:23 +01:00
|
|
|
|
echo $dpkt "derleniyor...."
|
2016-03-19 01:55:02 +01:00
|
|
|
|
zorla_derle="yok"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
paket_derle $dpkt
|
|
|
|
|
done
|
|
|
|
|
}
|
2016-03-03 15:10:44 +01:00
|
|
|
|
#otomatik derle kontrollu kur
|
|
|
|
|
paket_derle_oto2(){
|
2016-04-12 00:14:39 +02:00
|
|
|
|
tekrarkur="hayir"
|
|
|
|
|
mps -dly "$1" > /dev/null && mps -odk bag.liste
|
2016-03-03 15:10:44 +01:00
|
|
|
|
}
|
2016-03-02 01:26:35 +01:00
|
|
|
|
|
|
|
|
|
paket_kur_oto(){
|
2016-03-19 01:55:02 +01:00
|
|
|
|
local kpkt pkt pak
|
|
|
|
|
for kpkt in `cat $1`;do
|
|
|
|
|
for pkt in `ls $kpkt* | cut -d'#' -f1`;do
|
|
|
|
|
pak=`ls "$pkt#"*`
|
|
|
|
|
mps -k "$pak"
|
|
|
|
|
done
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
paket_kur_liste(){
|
|
|
|
|
local kpkt pkt pak
|
2016-03-02 01:26:35 +01:00
|
|
|
|
for kpkt in `cat $1`;do
|
|
|
|
|
for pkt in `ls $kpkt* | cut -d'#' -f1`;do
|
2016-03-19 01:55:02 +01:00
|
|
|
|
pak=`ls "$pkt#"*`
|
|
|
|
|
mps -k2 "$pak"
|
2016-03-02 01:26:35 +01:00
|
|
|
|
done
|
|
|
|
|
done
|
|
|
|
|
}
|
2016-03-19 01:55:02 +01:00
|
|
|
|
|
|
|
|
|
#otomatik kontrollu kur
|
|
|
|
|
paket_kur_oto2(){
|
2016-04-12 00:14:39 +02:00
|
|
|
|
mps -dly "$1" > /dev/null && mps -ok bag.liste
|
2016-03-19 01:55:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-04-12 00:14:39 +02:00
|
|
|
|
paket_inkur_liste(){
|
2016-03-19 01:55:02 +01:00
|
|
|
|
local kpkt pkt pak
|
|
|
|
|
for kpkt in `cat $1`;do
|
|
|
|
|
mps -ik "$kpkt"
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#otomatik kontrollu kur
|
2016-04-12 00:14:39 +02:00
|
|
|
|
paket_inkur_oto(){
|
|
|
|
|
mps -dly "$1" > /dev/null && paket_inkur_liste bag.liste
|
|
|
|
|
rm bag.liste tumbag.liste
|
2016-03-19 01:55:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
paket_sil_oto(){
|
|
|
|
|
local spkt
|
|
|
|
|
for spkt in `cat $1`;do
|
|
|
|
|
oto_silme="evet"
|
|
|
|
|
paket_sil "$spkt" "$oto_silme"
|
|
|
|
|
done
|
|
|
|
|
}
|
2016-02-24 01:27:23 +01:00
|
|
|
|
|
|
|
|
|
paket_derle(){
|
2016-03-19 01:55:02 +01:00
|
|
|
|
#eski derleme kalıntılarını temizle
|
|
|
|
|
if [ -d tmp.* ];then
|
|
|
|
|
rm -r tmp.*
|
|
|
|
|
fi
|
2016-03-07 00:39:49 +01:00
|
|
|
|
kaynakdizin_kontrol
|
2016-02-24 01:27:23 +01:00
|
|
|
|
local konum derleme_onay eh bagimd
|
|
|
|
|
derleme_onay="h"
|
|
|
|
|
konum="`find "$talimatname_dizin" -name $1`"
|
|
|
|
|
if [ -d "$konum" ];then
|
|
|
|
|
mkdir -p tmp."$1"
|
|
|
|
|
cp -a $konum/* tmp."$1"/
|
|
|
|
|
cd tmp."$1"
|
2016-03-19 01:55:02 +01:00
|
|
|
|
if [ "`kurulu_kontrol "$1"`" = "kurulu" ] && [ "$zorla_derle" = "yok" ];then
|
2016-03-02 16:48:57 +01:00
|
|
|
|
derleme_onay="h"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
else
|
2016-03-19 01:55:02 +01:00
|
|
|
|
echo "-----"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
derleme_onay="e"
|
|
|
|
|
fi
|
|
|
|
|
if [ "$derleme_onay" = "e" ];then
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 33 "$1" "derleniyor...."
|
2016-02-24 01:27:23 +01:00
|
|
|
|
#mpsd -d > /dev/null
|
2016-02-28 00:55:08 +01:00
|
|
|
|
#mpsd -d
|
|
|
|
|
echo "------------------------"
|
|
|
|
|
mpsd -d 2>&1|tee /tmp/"$1".log
|
|
|
|
|
if ( grep "^=======>" /tmp/"$1".log| tail -1 |grep "ERROR" > /dev/null);then
|
|
|
|
|
echo "derleme sisteminde hata oluştu -----> " /tmp/"$1".log
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2016-02-24 01:27:23 +01:00
|
|
|
|
if [ "$kurulum_onay" = "evet" ];then
|
|
|
|
|
for kpkt in `ls $1* | cut -d'#' -f1`;do
|
|
|
|
|
mps -k "$kpkt#"*
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
mv *.mps.lz ../
|
2016-03-19 01:55:02 +01:00
|
|
|
|
else
|
|
|
|
|
ryaz 32 "paket zaten kurulu,yine de derlemek için:
|
|
|
|
|
mps -zd $1"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
fi
|
|
|
|
|
cd ..
|
|
|
|
|
rm -r tmp."$1"
|
|
|
|
|
else
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 31 "talimat dosyası bulunamadı."
|
2016-02-24 01:27:23 +01:00
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-03 15:10:44 +01:00
|
|
|
|
|
2016-03-02 01:26:35 +01:00
|
|
|
|
bagimlilar(){
|
2016-02-24 01:27:23 +01:00
|
|
|
|
local bagimd konum
|
|
|
|
|
konum="`find "$talimatname_dizin" -name $1`"
|
2016-03-02 16:12:51 +01:00
|
|
|
|
bagimd=`cat $konum/talimat | grep "Depends on" | cut -d':' -f2`
|
2016-03-02 01:26:35 +01:00
|
|
|
|
if [ -n "$bagimd" ]; then
|
|
|
|
|
bagimd=`echo "$bagimd" | sed 's/,/ /g'`
|
|
|
|
|
#sıralı gösterme
|
|
|
|
|
echo `echo "$bagimd" | sed 's/,/ /g'`
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bagimli_bilgi(){
|
|
|
|
|
local bagimd konum bag
|
|
|
|
|
konum="`find "$talimatname_dizin" -name $1`"
|
|
|
|
|
bagimd=`cat $konum/talimat | grep "Depends" | cut -d':' -f2`
|
|
|
|
|
if [ -n "$bagimd" ]; then
|
|
|
|
|
bagimd=`echo "$bagimd" | sed 's/,/ /g'`
|
|
|
|
|
#sıralı gösterme
|
|
|
|
|
#echo `echo "$bagimd" | sed 's/,/ /g'`
|
|
|
|
|
#kurulu kontrollu gosterim
|
|
|
|
|
for bag in $bagimd;do
|
|
|
|
|
echo $bag "`kurulu_kontrol $bag`"
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
echo "$1" "`kurulu_kontrol $1`"
|
2016-03-19 01:55:02 +01:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ters_bagimli(){
|
|
|
|
|
local ara
|
|
|
|
|
ara=" $1 "
|
|
|
|
|
sy=`grep -o "/" <<<"$talimatname_dizin" | wc -l`
|
|
|
|
|
grep -rli "$ara" "$talimatname_dizin" | cut -d'/' -f`expr $sy + 3`
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-17 01:08:11 +02:00
|
|
|
|
silme_kurban_kontrol(){
|
|
|
|
|
local dizin
|
|
|
|
|
for f in $(cat $1) ; do
|
|
|
|
|
dizin="${f%\'}"
|
|
|
|
|
dizin="${dizin#\'}"
|
|
|
|
|
if [ -d "$dizin" ];then
|
|
|
|
|
for g in `ls "$dizin"` ; do
|
|
|
|
|
if ! grep -Fxq " '$dizin/$g'" "$1"
|
|
|
|
|
then
|
|
|
|
|
echo "$dizin/$g"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ters_bagimli_kontrol(){
|
|
|
|
|
ters_bagimli "$1" | sort > tersb.liste
|
|
|
|
|
ls /var/lib/pkg/DB/ | sed "/$1/d" | sort > simdiki.liste
|
|
|
|
|
comm -12 tersb.liste simdiki.liste
|
|
|
|
|
rm tersb.liste simdiki.liste
|
2016-02-24 01:27:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
kurulu_kontrol(){
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ -d "$kokdizin/var/lib/pkg/DB/$1" ];then
|
2016-02-24 01:27:23 +01:00
|
|
|
|
echo "kurulu"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
echo "degil"
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-12 00:14:39 +02:00
|
|
|
|
sistem_kur(){
|
|
|
|
|
local spaket
|
|
|
|
|
for spaket in `cat $1`;do
|
|
|
|
|
./$betikad -ik "$spaket" -kok $2;
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-07 00:39:49 +01:00
|
|
|
|
kaynakdizin_kontrol(){
|
|
|
|
|
if [ ! -d $DERLEME_KAYNAKDIZIN ];then
|
|
|
|
|
mkdir $DERLEME_KAYNAKDIZIN
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-12 00:14:39 +02:00
|
|
|
|
logdizin_kontrol(){
|
|
|
|
|
if [ ! -d $kokdizin$LOGDIZIN ];then
|
|
|
|
|
mkdir $kokdizin$LOGDIZIN
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -d $kokdizin$LOGDIZIN/derleme ];then
|
|
|
|
|
mkdir $kokdizin$LOGDIZIN/derleme
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -f $kokdizin$LOGDIZIN/mps.log ];then
|
|
|
|
|
touch $kokdizin$LOGDIZIN/mps.log
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2016-03-19 01:55:02 +01:00
|
|
|
|
tarihce_dkontrol(){
|
|
|
|
|
if [ ! -d $TARIHCE_DIZIN ];then
|
|
|
|
|
mkdir $TARIHCE_DIZIN
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tarihce_liste(){
|
|
|
|
|
tarihce_dkontrol
|
|
|
|
|
ls $TARIHCE_DIZIN/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tarihce_yap(){
|
|
|
|
|
tarihce_dkontrol
|
|
|
|
|
local t_isim
|
|
|
|
|
if [ "$temel_tarihce" = "evet" ];then
|
|
|
|
|
t_isim="temel"
|
|
|
|
|
else
|
|
|
|
|
t_isim=`date +%m-%d-%y.%H%M%S`
|
|
|
|
|
fi
|
|
|
|
|
bsdtar -P -r -f $TARIHCE_DIZIN/"$t_isim"-pkvt.tar $VT
|
|
|
|
|
lzip -9 $TARIHCE_DIZIN/"$t_isim"-pkvt.tar
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tarihce_yukle(){
|
|
|
|
|
tarihce_dkontrol
|
|
|
|
|
local islem_onay cikis
|
|
|
|
|
sil_onay="h"
|
|
|
|
|
if [ -f $TARIHCE_DIZIN/"$1-pkvt.tar.lz" ];then
|
|
|
|
|
bsdtar -p -o -C /tmp -xf $TARIHCE_DIZIN/"$1-pkvt.tar.lz" 2>/dev/null
|
|
|
|
|
ls /tmp/var/lib/pkg/DB/ > hedef.pkvt
|
|
|
|
|
ls /var/lib/pkg/DB/ > simdiki.pkvt
|
|
|
|
|
grep -vf hedef.pkvt simdiki.pkvt > sil.liste
|
|
|
|
|
grep -vf simdiki.pkvt hedef.pkvt > kur.liste
|
|
|
|
|
rm hedef.pkvt simdiki.pkvt
|
|
|
|
|
rm -r /tmp/var
|
|
|
|
|
cikis=""
|
|
|
|
|
if [ -s sil.liste ];then
|
|
|
|
|
ryaz 32 "silinecekler"
|
|
|
|
|
ryaz 32 "------------"
|
|
|
|
|
cat sil.liste
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -s kur.liste ];then
|
|
|
|
|
ryaz 32 "kurulacaklar"
|
|
|
|
|
ryaz 32 "------------"
|
|
|
|
|
cat kur.liste
|
|
|
|
|
fi
|
|
|
|
|
if [ ! -s sil.liste ] && [ ! -s kur.liste ];then
|
|
|
|
|
ryaz 32 "sistem zaten hedef durumda!"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
while true; do
|
|
|
|
|
ryaz 34 "otomatik geri dönüşüm başlasın mı?";read -p "e veya h-> " eh
|
|
|
|
|
case $eh in
|
|
|
|
|
[Ee]* ) islem_onay="e"; break;;
|
|
|
|
|
[Hh]* ) break;;
|
|
|
|
|
* ) echo "e veya h";;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
if [ "$islem_onay" = "e" ];then
|
|
|
|
|
mps -os sil.liste
|
|
|
|
|
mps -ok kur.liste
|
|
|
|
|
mv sil.liste silinenler.liste
|
|
|
|
|
mv kur.liste kurulanlar.liste
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
mv sil.liste sil_iptal.liste
|
|
|
|
|
mv kur.liste kur_iptal.liste
|
|
|
|
|
else
|
|
|
|
|
ryaz 31 "ilgili tarihce dosyası bulunamadı!"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tarihce_sil(){
|
|
|
|
|
tarihce_dkontrol
|
|
|
|
|
if [ -f $TARIHCE_DIZIN/"$1-pkvt.tar.lz" ];then
|
|
|
|
|
rm -f $TARIHCE_DIZIN/"$1-pkvt.tar.lz"
|
|
|
|
|
else
|
|
|
|
|
ryaz 31 "ilgili tarihce dosyası bulunamadı!"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-12 00:14:39 +02:00
|
|
|
|
loglama(){
|
|
|
|
|
logdizin_kontrol
|
|
|
|
|
echo "$(date +'%F %T') $1" >> "$kokdizin/$LOGDIZIN/mps.log"
|
2016-03-19 01:55:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-07 00:39:49 +01:00
|
|
|
|
git_guncelle() {
|
|
|
|
|
kaynakdizin_kontrol
|
2016-04-12 00:14:39 +02:00
|
|
|
|
gitayar_kontrol
|
2016-03-07 00:39:49 +01:00
|
|
|
|
cd $DERLEME_KAYNAKDIZIN
|
|
|
|
|
#git sunucudan guncelleme
|
|
|
|
|
ryaz 33 "git sunucudan güncelleme çekiliyor."
|
|
|
|
|
if [ ! -d milis.git ];then
|
|
|
|
|
git clone $git_sunucu milis.git
|
|
|
|
|
else
|
|
|
|
|
cd milis.git
|
|
|
|
|
git pull
|
|
|
|
|
fi
|
|
|
|
|
ryaz 33 "yerele eşitleniyor."
|
2016-03-19 01:55:02 +01:00
|
|
|
|
rm -r $talimatname_dizin/*
|
2016-03-07 00:39:49 +01:00
|
|
|
|
rsync -a $DERLEME_KAYNAKDIZIN/milis.git/talimatname/ $talimatname_dizin
|
2016-03-19 01:55:02 +01:00
|
|
|
|
rm -r `dirname $talimatname_dizin`/bin/*
|
|
|
|
|
rsync -a $DERLEME_KAYNAKDIZIN/milis.git/bin/ `dirname $talimatname_dizin`/bin
|
2016-03-07 00:39:49 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
paketvt_guncelle(){
|
|
|
|
|
wget -q --spider "$sunucu""paket.vt"
|
|
|
|
|
#if wget -P /tmp -q "$sunucu""paket.vt" > /dev/null; then
|
|
|
|
|
if [ $? -eq 0 ]; then
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 32 "paket veritabanı guncellenıyor." "$paketdepo""paket.vt"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
if [ -f "$paketdepo""paket.vt" ];then
|
|
|
|
|
mv "$paketdepo""paket.vt" "$paketdepo""paket.vt.eski"
|
|
|
|
|
fi
|
|
|
|
|
wget -P "$paketdepo" "$sunucu""paket.vt"
|
|
|
|
|
#rm /tmp/paket.vt*
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 31 "paket veritabanı guncelleme olumsuz."
|
2016-02-24 01:27:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
2016-03-07 00:39:49 +01:00
|
|
|
|
talimat_bilgi(){
|
|
|
|
|
local konum HEAD
|
|
|
|
|
konum="`find "$talimatname_dizin" -name $1`"
|
|
|
|
|
HEAD=`grep -B 12 "build()" $konum/talimat`
|
|
|
|
|
echo $HEAD
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
sistem_kontrol(){
|
|
|
|
|
paketvt_kontrol
|
|
|
|
|
sunucu_kontrol
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sunucu_kontrol(){
|
|
|
|
|
wget -q --spider $sunucu
|
|
|
|
|
if [ $? -eq 0 ]; then
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 32 "paket sunucu aktif"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
else
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 31 "sunucu erişim dışı"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-12 00:14:39 +02:00
|
|
|
|
gitayar_kontrol(){
|
|
|
|
|
if [ ! -f /root/.gitconfig ];then
|
|
|
|
|
git_ssl_iptal
|
|
|
|
|
git_otokimlik
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
paketvt_kontrol(){
|
|
|
|
|
mkdir -p /depo/paketler
|
|
|
|
|
if [ ! -f /depo/paketler/paket.vt ];then
|
|
|
|
|
touch /depo/paketler/paket.vt
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
2016-04-12 00:14:39 +02:00
|
|
|
|
pvt_olustur(){
|
|
|
|
|
if [ ! -f paket.vt ];then
|
|
|
|
|
touch paket.vt
|
|
|
|
|
fi
|
|
|
|
|
if [ -f "paket.vt" ];then
|
|
|
|
|
mv "paket.vt" "paket.vt.eski"
|
|
|
|
|
fi
|
|
|
|
|
ryaz 32 "paket.vt oluşturuluyor...."
|
|
|
|
|
for paket in `ls *.mps.lz`
|
|
|
|
|
do
|
|
|
|
|
paketad="`echo $paket|cut -d "#" -f1`"
|
|
|
|
|
shaek=`sha1sum $paket`
|
|
|
|
|
|
|
|
|
|
echo $paketad $shaek >> paket.vt
|
|
|
|
|
done
|
|
|
|
|
ryaz 32 "paket.vt oluşturuldu."
|
|
|
|
|
}
|
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
yardim(){
|
|
|
|
|
echo "yardim"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ayarlar() {
|
|
|
|
|
|
|
|
|
|
while [ "$1" ]; do
|
|
|
|
|
case $1 in
|
|
|
|
|
-i|--indir)
|
|
|
|
|
ikaynak="ag"
|
|
|
|
|
kurulum_onay="olumsuz";;
|
|
|
|
|
-ik|--inku)
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ "$3" == "-kok" ] && [ -d "$4" ]; then
|
|
|
|
|
kokdizin="$4"
|
|
|
|
|
fi
|
2016-02-24 01:27:23 +01:00
|
|
|
|
ikaynak="ag" ;;
|
2016-04-12 00:14:39 +02:00
|
|
|
|
-ikz|--inkuzo)
|
|
|
|
|
ikaynak="ag"
|
|
|
|
|
tekrarkur="evet" ;;
|
2016-02-24 01:27:23 +01:00
|
|
|
|
-k|--yrku)
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ "$3" == "-kok" ] && [ -d "$4" ]; then
|
|
|
|
|
kokdizin="$4"
|
|
|
|
|
tekrarkur="evet"
|
|
|
|
|
fi
|
2016-02-24 01:27:23 +01:00
|
|
|
|
ikaynak="yerel" ;;
|
2016-03-19 01:55:02 +01:00
|
|
|
|
-s|--pksil)
|
2016-02-24 01:27:23 +01:00
|
|
|
|
paket_sil "$2" ;;
|
|
|
|
|
-d|--pkde)
|
2016-03-19 01:55:02 +01:00
|
|
|
|
zorla_derle="yok"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
kurulum_onay="olumsuz"
|
|
|
|
|
paket_derle "$2" ;;
|
2016-03-07 18:52:54 +01:00
|
|
|
|
-zd|--pkzde)
|
|
|
|
|
zorla_derle="evet"
|
|
|
|
|
kurulum_onay="olumsuz"
|
|
|
|
|
paket_derle "$2" ;;
|
2016-02-24 01:27:23 +01:00
|
|
|
|
-dk|--pkdk)
|
|
|
|
|
paket_derle "$2" ;;
|
|
|
|
|
-odk|--pkodk)
|
|
|
|
|
paket_derle_oto "$2" ;;
|
2016-03-03 15:10:44 +01:00
|
|
|
|
-odkk|--pkodk2)
|
|
|
|
|
paket_derle_oto2 "$2" ;;
|
2016-03-02 01:26:35 +01:00
|
|
|
|
-ok|--pkok)
|
2016-03-19 01:55:02 +01:00
|
|
|
|
paket_kur_oto "$2" ;;
|
|
|
|
|
-okl|--pkokl)
|
|
|
|
|
paket_kur_liste "$2" ;;
|
|
|
|
|
-ko|--pkko)
|
|
|
|
|
paket_kur_oto2 "$2" ;;
|
2016-04-12 00:14:39 +02:00
|
|
|
|
-kurul)
|
|
|
|
|
paket_inkur_liste "$2" ;;
|
|
|
|
|
-kur)
|
|
|
|
|
paket_inkur_oto "$2" ;;
|
2016-03-19 01:55:02 +01:00
|
|
|
|
-pak|--paketle)
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ ! "$2" ]; then
|
|
|
|
|
ryaz 31 "paketlenecek dizin ismi eksik"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2016-03-19 01:55:02 +01:00
|
|
|
|
yeniden_paketle "$2" ;;
|
2016-04-12 00:14:39 +02:00
|
|
|
|
-psk|--paksiskur)
|
|
|
|
|
if [ ! "$2" ]; then
|
|
|
|
|
ryaz 31 "paket liste yok"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
if [ ! "$3" ]; then
|
|
|
|
|
ryaz 31 "hedef dizin yok"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
sistem_kur "$2" "$3" ;;
|
|
|
|
|
-po)
|
|
|
|
|
pvt_olustur ;;
|
2016-03-19 01:55:02 +01:00
|
|
|
|
-os|--pkos)
|
|
|
|
|
if [ ! "$2" ]; then
|
|
|
|
|
ryaz 31 "silme listesi yok"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
paket_sil_oto "$2" ;;
|
|
|
|
|
-kl|--kurulu-liste)
|
|
|
|
|
ls $VT ;;
|
2016-02-24 01:27:23 +01:00
|
|
|
|
-dly|--drly)
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ -f tumbag.liste ];then
|
|
|
|
|
mv tumbag.liste tumbag.liste.eski
|
2016-02-28 00:55:08 +01:00
|
|
|
|
fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ -f bag.liste ];then
|
|
|
|
|
mv bag.liste bag.liste.eski
|
2016-02-28 00:55:08 +01:00
|
|
|
|
fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
touch tumbag.liste
|
|
|
|
|
touch bag.liste
|
2016-02-24 01:27:23 +01:00
|
|
|
|
derleme_listyap "$2" ;;
|
2016-03-02 01:26:35 +01:00
|
|
|
|
-dlb|--drlb)
|
2016-03-07 00:39:49 +01:00
|
|
|
|
derleme_listbilgi "$2";;
|
2016-02-24 01:27:23 +01:00
|
|
|
|
-b|--pkbl)
|
|
|
|
|
paket_bilgi "$2" ;;
|
|
|
|
|
-bb|--pkbb)
|
2016-03-02 01:26:35 +01:00
|
|
|
|
bagimli_bilgi "$2" | column -t;;
|
2016-03-19 01:55:02 +01:00
|
|
|
|
-tb|--pktb)
|
|
|
|
|
ters_bagimli "$2" ;;
|
|
|
|
|
-tbk|--pktbk)
|
|
|
|
|
ters_bagimli_kontrol "$2" ;;
|
|
|
|
|
-talb|--talb)
|
2016-03-07 00:39:49 +01:00
|
|
|
|
talimat_bilgi "$2" | column -t;;
|
|
|
|
|
-Ggit|--gitgun)
|
|
|
|
|
git_guncelle ;;
|
2016-02-24 01:27:23 +01:00
|
|
|
|
-G|--pvtg)
|
|
|
|
|
paketvt_guncelle ;;
|
|
|
|
|
-g|--pkgu)
|
|
|
|
|
if [ ! "$2" ]; then
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 31 "paket ismi eksik"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
paket_guncelle "$2";;
|
2016-03-19 01:55:02 +01:00
|
|
|
|
-kk|--kurulu-kontrol)
|
2016-02-24 01:27:23 +01:00
|
|
|
|
if [ ! "$2" ]; then
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 31 "paket ismi eksik"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 31 `kurulu_kontrol "$2"`;;
|
2016-02-24 01:27:23 +01:00
|
|
|
|
-suko)
|
|
|
|
|
sunucu_kontrol ;;
|
|
|
|
|
-cf|--config-file)
|
|
|
|
|
if [ ! "$2" ]; then
|
|
|
|
|
echo "ayardosyası gerek $1"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
ayar_dosyasi="$2"
|
|
|
|
|
shift ;;
|
2016-03-19 01:55:02 +01:00
|
|
|
|
-tro)
|
|
|
|
|
tarihce_yap ;;
|
|
|
|
|
-trot)
|
|
|
|
|
temel_tarihce="evet"
|
|
|
|
|
tarihce_yap ;;
|
|
|
|
|
-try)
|
|
|
|
|
if [ ! "$2" ]; then
|
|
|
|
|
ryaz 31 "tarihce dosyasi eksik $1"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
tarihce_yukle "$2"
|
|
|
|
|
shift ;;
|
|
|
|
|
-trl)
|
|
|
|
|
tarihce_liste ;;
|
|
|
|
|
-trs)
|
|
|
|
|
if [ ! "$2" ]; then
|
|
|
|
|
ryaz 31 "parametre eksik $1"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
tarihce_sil "$2"
|
|
|
|
|
shift ;;
|
2016-02-24 01:27:23 +01:00
|
|
|
|
-v)
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 33 "$betikad $versiyon $iletisim"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
exit 0 ;;
|
|
|
|
|
-h|--help)
|
|
|
|
|
yardim
|
|
|
|
|
exit 0 ;;
|
|
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
shift
|
|
|
|
|
done
|
|
|
|
|
}
|
|
|
|
|
ana(){
|
|
|
|
|
ayarlar "$@"
|
|
|
|
|
|
|
|
|
|
if [ "$ikaynak" = "ag" ]; then
|
2016-04-17 01:08:11 +02:00
|
|
|
|
local kontroldeg
|
2016-04-12 00:14:39 +02:00
|
|
|
|
kkont=`kurulu_kontrol "$2"`
|
|
|
|
|
if [ "$kkont" = "degil" ] || [ "$tekrarkur" = "evet" ];then
|
|
|
|
|
echo "agdan cekiliyor:" "$2"
|
|
|
|
|
pkt=`cat "$paketdepo""paket.vt" | grep "^$2 " | cut -d' ' -f3`
|
2016-04-17 01:08:11 +02:00
|
|
|
|
echo $pkt
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ ! -z "$pkt" -a "$pkt" != "" ]; then
|
|
|
|
|
cpaket="${pkt/'#'/'%23'}"
|
|
|
|
|
#paket sunucuda varsa
|
|
|
|
|
wget -q --spider "$sunucu$cpaket"
|
|
|
|
|
#if wget -P /tmp -q "$sunucu$cpaket" > /dev/null; then
|
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
|
wget -nc -P "$paketdepo" "$sunucu$cpaket"
|
2016-04-21 07:46:06 +02:00
|
|
|
|
if [ -f "$paketde""popaket.vt" ];then
|
|
|
|
|
ekontdeg=`cat "$paketdepo""paket.vt" | grep "^$2 " | cut -d' ' -f2`
|
|
|
|
|
mkontdeg=`md5sum $pkt | cut -d' ' -f1`
|
|
|
|
|
fi
|
2016-04-17 01:08:11 +02:00
|
|
|
|
if [ "$ekontdeg" != "$mkontdeg" ];then
|
|
|
|
|
rm -f $pkt
|
|
|
|
|
wget -nc -P "$paketdepo" "$sunucu$cpaket"
|
|
|
|
|
fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ "$kurulum_onay" = "evet" ];then
|
|
|
|
|
if [ "$tekrarkur" = "evet" ];then
|
|
|
|
|
paket_sil "$2" "evet"
|
|
|
|
|
fi
|
2016-02-24 01:27:23 +01:00
|
|
|
|
icerik_ekle "$paketdepo$pkt"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
2016-04-17 01:08:11 +02:00
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
else
|
|
|
|
|
ryaz 31 "paket sunucuda yok!( mps -G komutuyla güncelleme yapınız. )"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
fi
|
2016-04-12 00:14:39 +02:00
|
|
|
|
else
|
|
|
|
|
ryaz 31 "$2 paketi zaten kurulu!"
|
2016-02-24 01:27:23 +01:00
|
|
|
|
fi
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ "$ikaynak" = "yerel" ]; then
|
2016-02-28 00:55:08 +01:00
|
|
|
|
local silme
|
2016-02-24 01:27:23 +01:00
|
|
|
|
pkontrol=`basename $2 | grep -w "mps.lz"`
|
|
|
|
|
if [ ! -z "$pkontrol" -a "$pkontrol" != "" ]; then
|
|
|
|
|
paketad=`echo "$2" | cut -d'#' -f1`
|
|
|
|
|
kkont=`kurulu_kontrol "$paketad"`
|
|
|
|
|
if [ "$kkont" = "degil" ];then
|
|
|
|
|
icerik_ekle "$2"
|
|
|
|
|
else
|
2016-04-12 00:14:39 +02:00
|
|
|
|
if [ "$tekrarkur" = "hayir" ];then
|
|
|
|
|
while true; do
|
|
|
|
|
ryaz 31 "$2 paketi zaten kurulu silinip kurulsun mu?"
|
|
|
|
|
read -p "e veya h -> " eh
|
|
|
|
|
case $eh in
|
|
|
|
|
[Ee]* ) silme="e"; break;;
|
|
|
|
|
[Hh]* ) break;;
|
|
|
|
|
* ) echo "e veya h";;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
fi
|
2016-02-28 00:55:08 +01:00
|
|
|
|
if [ "$silme" = "e" ];then
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 33 "silinecekelerin kontrolu için"
|
|
|
|
|
paket_sil "$paketad"
|
2016-02-28 00:55:08 +01:00
|
|
|
|
icerik_ekle "$2"
|
|
|
|
|
fi
|
2016-02-24 01:27:23 +01:00
|
|
|
|
fi
|
|
|
|
|
else
|
2016-03-19 01:55:02 +01:00
|
|
|
|
ryaz 31 "yerelde mps paketi bulunamadı."
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
2016-02-24 01:27:23 +01:00
|
|
|
|
}
|
|
|
|
|
ana "$@"
|
|
|
|
|
|
2016-03-19 01:55:02 +01:00
|
|
|
|
|
|
|
|
|
#31 kirmizi
|
|
|
|
|
#32 yesil
|
|
|
|
|
#33 sari
|
|
|
|
|
#34 mavi
|
|
|
|
|
#34 mor
|