mps-hizli-tespit_calismasi

This commit is contained in:
milisbir 2018-11-05 00:41:01 +02:00
parent 8c9536dfaa
commit 5d188429e5
1 changed files with 38 additions and 8 deletions

46
bin/mps
View File

@ -234,6 +234,8 @@ cikti_renk_ayarla(){
icerik_ekle(){
if [ -f "$1" ];then
# kurulan paketin sha1sum değerinin alınması
local _hash1=$(sha1sum $1)
paketad=`echo "$1" | cut -d'#' -f1`
paketad=`basename $paketad`
$_yaz_tm "$paketad paketi kuruluyor-> $kokdizin"
@ -242,7 +244,7 @@ icerik_ekle(){
else
tar -C /tmp --extract --file=$1 .PRE 1 2> /tmp/$paketad_pre.log
fi
#kos-kur kontrolu
# kos-kur kontrolu
if [ -f /tmp/.PRE ];then
if [ "$kokdizin" == "/" ];then
bash /tmp/.PRE
@ -257,23 +259,25 @@ icerik_ekle(){
else
tar xf $1 -C kur.$paketad
fi
#istenmeyen yerellerin silinmesi
# yerelsil aktif ise istenmeyen paket dil desteklerinin 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
fi
#doc dizini silinmesi
# docsil aktif ise paketinin /usr/share/doc dizininin silinmesi
if [ -d kur.$paketad/usr/share/doc ] && [ "$docsil" == "evet" ];then
rm -r kur.$paketad/usr/share/doc
fi
mkdir -p $kokdizin$VT/"$paketad" &&
cp -v -afr kur.$paketad/* $kokdizin > kur.$paketad/kurulan
cp kur.$paketad/kurulan /tmp/ &&cat kur.$paketad/kurulan | cut -d '>' -f2 > $kokdizin$VT/"$paketad"/kurulan &&
cp kur.$paketad/kurulan /tmp/ && cat kur.$paketad/kurulan | cut -d '>' -f2 > ${kokdizin}${VT}/"$paketad"/kurulan &&
# kurulan paketin shasum değerinin kurulu paket dosya kaydı
echo ${_hash1} > ${kokdizin}${VT}/"$paketad"/sha1
#mv kur.$paketad/.MTREE $VT/"$paketad"/files &&
mv kur.$paketad/.META $kokdizin$VT/"$paketad"/META &&
mv kur.$paketad/.META ${kokdizin}${VT}/"$paketad"/META &&
#kur-kos calistirilmasi
# kur-kos calistirilmasi
if [ -f kur.$paketad/.POST ];then
if [ "$kokdizin" == "/" ];then
bash kur.$paketad/.POST
@ -1344,6 +1348,25 @@ guncelleme_tespit(){
cat $dosya_talimatsiz
}
# deneme aşamasında
guncelleme_tespit_hizli(){
for _hashd in $(find $VT -name sha1 -type f);do
_hash=$(cat $_hashd | awk -F" " '{print $1}')
for pktvt in $(ls ${paketdepo}paket*.vt) ; do
# hash değerinin paket.vt kontrolü
printf "$(basename ${_hashd%/*})\t"
grep -r ${_hash} ${pktvt} > /dev/null
if [ ! $? -eq 0 ];then
echo "-"
else
echo "+"
break
fi
done
done
#echo "----"
}
sistem_guncelle_uygula(){
local _gdosya _onay
if [ "$1" ]; then
@ -1535,7 +1558,7 @@ surum_kontrol(){
paket_sil "$_paket" "evet"
paket_indir $_paket
pkt=`cat "$paketdepo""paket.vt" | grep "^$_paket " | cut -d' ' -f3`
icerik_ekle "$paketdepo$pkt"
icerik_ekle "${paketdepo}${pkt}"
else
paket_sil "$_paket" "evet"
paket_inkur_oto $_paket
@ -3607,7 +3630,10 @@ ayarlar() {
### mps guncelle . = paket veritabanı ve git güncellemesi-talimatname bilgilerini günceller.
guncelle)
[ "$2" ] && cikti_renk_ayarla "$2"
git_guncelle;paketvt_guncelle;kurulum_dogrulama
git_guncelle;
paketvt_guncelle;
kurulum_dogrulama;
#guncelleme_tespit;
exit 0 ;;
### mps -GG . = git güncellemelerini ve talimatname bilgilerini günceller.
-Ggit|-GG)
@ -3630,6 +3656,10 @@ ayarlar() {
[ "$2" ] && cikti_renk_ayarla "$2"
guncelleme_tespit
exit 0 ;;
tespit2)
[ "$2" ] && cikti_renk_ayarla "$2"
guncelleme_tespit_hizli
exit 0 ;;
### mps gun . = güncellenmesi gereken ve depoya yeni eklenen paketleri gösterir.
gun)
guncellemeler