malfs mekanizma guncelleme

This commit is contained in:
shamil 2016-02-26 03:41:51 +02:00
parent 82d56e5773
commit 2645a69a6d
157 changed files with 153 additions and 62 deletions

View File

@ -1,6 +1,11 @@
bin/
boot/
sbin/
dev/
srv/
lib/
lib64/
lib32/
etc/
etc/shells
etc/profile
@ -49,6 +54,7 @@ mnt/
opt/
root/
run/
sys/
tmp/
usr/bin/
usr/lib/
@ -74,3 +80,12 @@ usr/share/man/man1/
usr/share/man/man5/
usr/share/man/tr/man1/
usr/share/man/tr/man5/
var/
var/lib/
var/lib/pkg/
var/lib/pkg/DB
var/log/
var/lib/
var/run/
var/spool/
var/cache/

56
bin/mps
View File

@ -13,10 +13,30 @@ icerik_ekle(){
paketad=`echo "$1" | cut -d'#' -f1`
paketad=`basename $paketad`
echo $paketad" paketi kuruluyor."
tar -C /tmp --extract --file=$1 .PRE > /tmp/$paketad_pre.log
#kos-kur kontrolu
if [ -f /tmp/.PRE ];then
bash /tmp/.PRE
rm /tmp/.PRE
fi
tar xf $1 -C $kokdizin &&
mkdir -p /var/lib/pkg/DB/"$paketad" &&
tar xf $1 -C $kokdizin &&
mv /.MTREE /var/lib/pkg/DB/"$paketad"/files &&
mv /.META /var/lib/pkg/DB/"$paketad"/META &&
mv $kokdizin/.MTREE /var/lib/pkg/DB/"$paketad"/files &&
mv $kokdizin/.META /var/lib/pkg/DB/"$paketad"/META &&
#kur-kos calistirilmasi
if [ -f $kokdizin.POST ];then
bash $kokdizin.POST
rm $kokdizin.POST
fi
if [ -f $kokdizin.PRE ];then
rm $kokdizin.PRE
fi
if [ -f $kokdizin/.okubeni ];then
rm $kokdizin/.okubeni
fi
if [ -f $kokdizin/.README ];then
rm $kokdizin/.README
fi
if [ -f /etc/ld.so.conf ];then
ldconfig
fi
@ -24,7 +44,7 @@ icerik_ekle(){
}
paket_sil(){
local paket kkont
local paket kkont sil_onay
if [ -f $dokunulmaz ];then
kkont=`kurulu_kontrol "$1"`
if [ "$kkont" = "kurulu" ];then
@ -33,13 +53,27 @@ paket_sil(){
#while IFS='' read -r line || [[ -n "$line" ]]; do
while read -r dosya
do
touch /tmp/$paket.sil
if [[ $(grep -c $dosya $dokunulmaz) -eq 0 ]]; then
#echo /$dosya
rm -r -f /$dosya
echo "/$dosya" >> /tmp/$paket.sil
#guvenlik amacli simdilik kapali
#rm -r -f /$dosya
fi
done < /var/lib/pkg/DB/"$paket"/files
rm -r -f /var/lib/pkg/DB/"$paket" &&
echo $paket" paketi silindi."
while true; do
read -p "$1 paketi kaldırılsın mı?" eh
case $eh in
[Ee]* ) sil_onay="e"; break;;
[Hh]* ) break;;
* ) echo "e veya h";;
esac
done
if [ "$sil_onay" = "e" ];then
xargs rm -r -f < /tmp/$paket.sil &&
rm -r -f /var/lib/pkg/DB/"$paket" &&
rm -f /tmp/$paket.sil
echo $paket" paketi silindi."
fi
else
echo "paket zaten kurulu değil!"
fi
@ -303,9 +337,3 @@ fi
}
ana "$@"
#kurulum oncesi işler yapılır.
#paket içeriği hedefe çıkarılır.
#kurulum sonrası işler yapılır.
#paket veritabanı guncellenir.
#ldconfig tetiklenir.
#ek olarak çakışma ve güncelleme-geriçekme kontrolleri yapılır.

View File

@ -588,14 +588,14 @@ add_meta_files() {
local NAME
NAME="`get_package_name $1`"
cd $PKG
if [ -f $PKGMK_ROOT/${NAME}.README ]; then
cp $PKGMK_ROOT/${NAME}.README .README
if [ -f $PKGMK_ROOT/${NAME}.okubeni ]; then
cp $PKGMK_ROOT/${NAME}.okubeni .README
fi
if [ -f $PKGMK_ROOT/${NAME}.pre-install ]; then
cp $PKGMK_ROOT/${NAME}.pre-install .PRE
if [ -f $PKGMK_ROOT/${NAME}.kos-kur ]; then
cp $PKGMK_ROOT/${NAME}.kos-kur .PRE
fi
if [ -f $PKGMK_ROOT/${NAME}.post-install ]; then
cp $PKGMK_ROOT/${NAME}.post-install .POST
if [ -f $PKGMK_ROOT/${NAME}.kur-kos ]; then
cp $PKGMK_ROOT/${NAME}.kur-kos .POST
fi
for file in .README .PRE .POST; do
if [ -f $file ]; then

View File

@ -1,3 +1,8 @@
#test sonuclarını gor uygunsa -n i kaldır komutu ver.
shopt -s globstar
rename -n 's/Pkgfile/talimat/' **
rename -n 's/post-install/kur-kos/' **
rename -n 's/pre-install/kos-kur/' **
rename -n 's/.README/.okubeni/' **
rename -n 's/-kos-kur/.kos-kur/' **
rename -n 's/-kur-kos/.kur-kos/' **

View File

@ -1,6 +1,11 @@
bin/
boot/
sbin/
dev/
srv/
lib/
lib64/
lib32/
etc/
etc/shells
etc/profile
@ -49,6 +54,7 @@ mnt/
opt/
root/
run/
sys/
tmp/
usr/bin/
usr/lib/
@ -74,3 +80,12 @@ usr/share/man/man1/
usr/share/man/man5/
usr/share/man/tr/man1/
usr/share/man/tr/man5/
var/
var/lib/
var/lib/pkg/
var/lib/pkg/DB
var/log/
var/lib/
var/run/
var/spool/
var/cache/

View File

@ -13,10 +13,30 @@ icerik_ekle(){
paketad=`echo "$1" | cut -d'#' -f1`
paketad=`basename $paketad`
echo $paketad" paketi kuruluyor."
tar -C /tmp --extract --file=$1 .PRE > /tmp/$paketad_pre.log
#kos-kur kontrolu
if [ -f /tmp/.PRE ];then
bash /tmp/.PRE
rm /tmp/.PRE
fi
tar xf $1 -C $kokdizin &&
mkdir -p /var/lib/pkg/DB/"$paketad" &&
tar xf $1 -C $kokdizin &&
mv /.MTREE /var/lib/pkg/DB/"$paketad"/files &&
mv /.META /var/lib/pkg/DB/"$paketad"/META &&
mv $kokdizin/.MTREE /var/lib/pkg/DB/"$paketad"/files &&
mv $kokdizin/.META /var/lib/pkg/DB/"$paketad"/META &&
#kur-kos calistirilmasi
if [ -f $kokdizin.POST ];then
bash $kokdizin.POST
rm $kokdizin.POST
fi
if [ -f $kokdizin.PRE ];then
rm $kokdizin.PRE
fi
if [ -f $kokdizin/.okubeni ];then
rm $kokdizin/.okubeni
fi
if [ -f $kokdizin/.README ];then
rm $kokdizin/.README
fi
if [ -f /etc/ld.so.conf ];then
ldconfig
fi
@ -24,7 +44,7 @@ icerik_ekle(){
}
paket_sil(){
local paket kkont
local paket kkont sil_onay
if [ -f $dokunulmaz ];then
kkont=`kurulu_kontrol "$1"`
if [ "$kkont" = "kurulu" ];then
@ -33,13 +53,27 @@ paket_sil(){
#while IFS='' read -r line || [[ -n "$line" ]]; do
while read -r dosya
do
touch /tmp/$paket.sil
if [[ $(grep -c $dosya $dokunulmaz) -eq 0 ]]; then
#echo /$dosya
rm -r -f /$dosya
echo "/$dosya" >> /tmp/$paket.sil
#guvenlik amacli simdilik kapali
#rm -r -f /$dosya
fi
done < /var/lib/pkg/DB/"$paket"/files
rm -r -f /var/lib/pkg/DB/"$paket" &&
echo $paket" paketi silindi."
while true; do
read -p "$1 paketi kaldırılsın mı?" eh
case $eh in
[Ee]* ) sil_onay="e"; break;;
[Hh]* ) break;;
* ) echo "e veya h";;
esac
done
if [ "$sil_onay" = "e" ];then
xargs rm -r -f < /tmp/$paket.sil &&
rm -r -f /var/lib/pkg/DB/"$paket" &&
rm -f /tmp/$paket.sil
echo $paket" paketi silindi."
fi
else
echo "paket zaten kurulu değil!"
fi
@ -303,9 +337,3 @@ fi
}
ana "$@"
#kurulum oncesi işler yapılır.
#paket içeriği hedefe çıkarılır.
#kurulum sonrası işler yapılır.
#paket veritabanı guncellenir.
#ldconfig tetiklenir.
#ek olarak çakışma ve güncelleme-geriçekme kontrolleri yapılır.

View File

@ -588,14 +588,14 @@ add_meta_files() {
local NAME
NAME="`get_package_name $1`"
cd $PKG
if [ -f $PKGMK_ROOT/${NAME}.README ]; then
cp $PKGMK_ROOT/${NAME}.README .README
if [ -f $PKGMK_ROOT/${NAME}.okubeni ]; then
cp $PKGMK_ROOT/${NAME}.okubeni .README
fi
if [ -f $PKGMK_ROOT/${NAME}.pre-install ]; then
cp $PKGMK_ROOT/${NAME}.pre-install .PRE
if [ -f $PKGMK_ROOT/${NAME}.kos-kur ]; then
cp $PKGMK_ROOT/${NAME}.kos-kur .PRE
fi
if [ -f $PKGMK_ROOT/${NAME}.post-install ]; then
cp $PKGMK_ROOT/${NAME}.post-install .POST
if [ -f $PKGMK_ROOT/${NAME}.kur-kos ]; then
cp $PKGMK_ROOT/${NAME}.kur-kos .POST
fi
for file in .README .PRE .POST; do
if [ -f $file ]; then

View File

@ -39,7 +39,7 @@ if [ "${COLUMNS}" = "0" ]; then
fi
## Measurements for positioning result messages
COL=$((${COLUMNS} - 8))
COL=$((${COLUMNS} - 12))
WCOL=$((${COL} - 2))
## Set Cursor Position Commands, used via echo
@ -70,9 +70,9 @@ SUCCESS_PREFIX="${SUCCESS} * ${NORMAL}"
FAILURE_PREFIX="${FAILURE}*****${NORMAL}"
WARNING_PREFIX="${WARNING} *** ${NORMAL}"
SUCCESS_SUFFIX="${BRACKET}[${SUCCESS} OK ${BRACKET}]${NORMAL}"
FAILURE_SUFFIX="${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
WARNING_SUFFIX="${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
SUCCESS_SUFFIX="${BRACKET}[${SUCCESS} TAMAM ${BRACKET}]${NORMAL}"
FAILURE_SUFFIX="${BRACKET}[${FAILURE} BAŞARISIZ ${BRACKET}]${NORMAL}"
WARNING_SUFFIX="${BRACKET}[${WARNING} UYARI ${BRACKET}]${NORMAL}"
BOOTLOG=/run/bootlog
KILLDELAY=0
@ -619,7 +619,7 @@ log_failure_msg()
timespec
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
/bin/echo -e "${STAMP} ${logmessage} FAIL" >> ${BOOTLOG}
/bin/echo -e "${STAMP} ${logmessage} BAŞARISIZ" >> ${BOOTLOG}
return 0
}
@ -629,7 +629,7 @@ log_failure_msg2()
/bin/echo -n -e "${BMPREFIX}${@}"
/bin/echo -e "${CURS_ZERO}${FAILURE_PREFIX}${SET_COL}${FAILURE_SUFFIX}"
echo "FAIL" >> ${BOOTLOG}
echo "BAŞARISIZ" >> ${BOOTLOG}
return 0
}
@ -651,7 +651,7 @@ log_warning_msg()
# Strip non-printable characters from log file
logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
timespec
/bin/echo -e "${STAMP} ${logmessage} WARN" >> ${BOOTLOG}
/bin/echo -e "${STAMP} ${logmessage} UYARI" >> ${BOOTLOG}
return 0
}

Some files were not shown because too many files have changed in this diff Show More