mps-tespit

This commit is contained in:
milisbir 2018-11-04 05:21:15 +02:00
parent 3314f3ce3a
commit 9115f80666
1 changed files with 17 additions and 2 deletions

19
bin/mps
View File

@ -1301,8 +1301,12 @@ guncelleme_tespit(){
local dosya_ks=`mktemp`
# güncellenecek paket listesi sırasız
local dosya_g=`mktemp`
# güncellenecek paket liste
local dosya_son=`mktemp`
local dosya_sonuc=`mktemp`
# talimatsız paket listesi
local dosya_talimatsiz=`mktemp`
t_indeks $dosya_t &
k_indeks $dosya_k $dosya_ks &
wait $(jobs -p)
@ -1313,14 +1317,25 @@ guncelleme_tespit(){
sed -i 's/$/@/' $dosya_ks
for _satir in $(cat $dosya_g);do
_gpaket=$(echo ${_satir} | cut -d'@' -f1)
grep -nr "^${_gpaket}@" $dosya_ks >> $dosya_son
# kurulu olup talimatı olmayan paketlerin tespit edilmesi
grep -nr "^${_gpaket}@" $dosya_t > /dev/null
if [ $? -eq 0 ];then
grep -nr "^${_gpaket}@" $dosya_ks >> $dosya_son
else
echo "${_gpaket}" >> $dosya_talimatsiz
fi
done
# güncellenecek paketlerin-kurulum sırasına göre sıralanıp, sadeleştirilmesi
sort $dosya_son | cut -d':' -f2 | cut -d'@' -f1 > $dosya_sonuc
# geçici dosyaların silinmesi
#echo "$dosya_t $dosya_k $dosya_ks $dosya_g $dosya_son"
rm -f $dosya_t $dosya_k $dosya_ks $dosya_g $dosya_son
# güncellenecek paket listesi yazdırılması
cat $dosya_sonuc
echo "--------------güncelleme----------------"
cat $dosya_sonuc
echo "--------------talimatsız----------------"
# talimatsız paket listesi yazdırılması
cat $dosya_talimatsiz
}
sistem_guncelle_uygula(){