malfs mekanizma guncelleme

This commit is contained in:
milisbir 2016-03-19 00:55:02 +00:00
parent 07747a6b58
commit d9fb3f5270
12 changed files with 366 additions and 389 deletions

View File

@ -1,114 +0,0 @@
bin/
boot/
sbin/
dev/
srv/
lib/
lib64/
lib32/
etc/
etc/shells
etc/profile
etc/passwd
etc/onmpsd.conf
etc/inputrc
etc/group
etc/fstab
etc/blfs-bootscripts
etc/bashrc
etc/rpc
etc/nscd.conf
etc/nsswitch.conf
etc/ld.so.conf
etc/mke2fs.conf
etc/hosts
etc/environment
etc/login.defs.orig
etc/login.defs
etc/man_db.conf
etc/wgetrc
etc/rsyncd.conf
etc/gpm-root.conf
etc/mtab
etc/mpsd.conf
etc/dokunulmaz
etc/resolv.conf
etc/ld.so.cache
etc/X11/
etc/skel/
etc/profile.d/
etc/locale/
etc/ld.so.conf.d/
etc/iproute2/
etc/security/
etc/default/
etc/udev/
etc/lvm/
etc/sysconfig/
etc/rc.d/
etc/init.d/
etc/pam.d/
etc/rc.d/rcS.d/
etc/rc.d/rc1.d/
etc/rc.d/rc5.d/
etc/rc.d/rc3.d/
etc/rc.d/rc6.d/
etc/rc.d/rc2.d/
etc/rc.d/rc4.d/
etc/rc.d/rc0.d/
etc/rc.d/init.d/
home/
usr/
mnt/
opt/
root/
run/
sys/
tmp/
usr/bin/
usr/lib/
usr/lib/pkgconfig/
usr/lib64/
usr/sbin/
usr/man/
usr/include/
usr/libexec/
usr/local/
usr/local/bin/
usr/local/lib/
usr/local/lib64/
usr/local/etc/
usr/local/share/
usr/share/
usr/share/applications/
usr/share/gtk-doc/
usr/share/icons/
usr/share/icons/hicolor/
usr/share/icons/hicolor/48x48/
usr/share/icons/hicolor/48x48/apps/
usr/share/misc/
usr/share/doc/
usr/share/locale/
usr/share/locale/tr/
usr/share/locale/tr/LC_MESSAGES/
usr/share/man/
usr/share/aclocal/
usr/share/info/
usr/share/man/man1/
usr/share/man/man5/
usr/share/man/tr/man1/
usr/share/man/tr/man5/
usr/share/man/man8/
usr/share/man/man7/
var/
var/lib/
var/lib/pkg/
var/lib/pkg/DB
var/log/
var/lib/
var/run/
var/spool/
var/cache/
var/lib/pkg/drivers/
etc/ssl
etc/ssl/certs

View File

@ -26,6 +26,6 @@ PKGMK_KEEP_SOURCES="evet"
MD5SUM_YOKSAY="evet"
PKGMK_CLEAN="yok"
PAKET_GRUPLAR=()
PAKET_LOKAL=(tr)
PAKET_LOKAL="tr"
KOLEKSIYON_YOKSAY="yok"
SURUM_YOKSAY="yok"

View File

@ -26,7 +26,7 @@ PKGMK_KEEP_SOURCES="evet"
MD5SUM_YOKSAY="evet"
PKGMK_CLEAN="yok"
PAKET_GRUPLAR=(devel service)
PAKET_LOKAL=(tr)
PAKET_LOKAL="tr"
KOLEKSIYON_YOKSAY="yok"
SURUM_YOKSAY="evet"
PAKETSIZ_DERLEME="evet"

52
bin/mps
View File

@ -9,7 +9,6 @@ git_sunucu="https://github.com/milisarge/malfs-milis"
ikaynak=""
betikad=${0##*/}
kurulum_onay="evet"
dokunulmaz="/etc/dokunulmaz"
talimatname_dizin="/root/talimatname"
kokdizin="/"
VT="/var/lib/pkg/DB"
@ -95,49 +94,6 @@ icerik_ekle2(){
ryaz 34 $paketad" paketi kuruldu."
}
paket_siles(){
local paket kkont sil_onay
if [ -f $dokunulmaz ];then
kkont=`kurulu_kontrol "$1"`
if [ "$kkont" = "kurulu" ];then
paket="$1"
ryaz 34 $paket" paketi siliniyor."
#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" >> /tmp/$paket.sil
#guvenlik amacli simdilik kapali
#rm -r -f /$dosya
fi
done < /var/lib/pkg/DB/"$paket"/files
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" &&
ryaz 34 $paket" paketi silindi."
fi
rm -f /tmp/$paket.sil
else
ryaz 31 "paket zaten kurulu değil!"
fi
else
echo "kritik mesaj:$dokunulmaz dosyası yok."
#tamirat
cp /root/ayarlar/dokunulmaz /etc/
echo "dokunulmazlık tamiri yapıldı.,komutu yineleyiniz."
fi
}
paket_sil(){
local paket kkont sil_onay oto_silme
paket="$1"
@ -193,10 +149,10 @@ paket_bilgi(){
yeniden_paketle(){
cd $1
bsdtar -r -f ../"$1".mps.tar .META
bsdtar -r -f ../"$1".mps.tar *
bsdtar -r -f ../"$1".mps .META
bsdtar -r -f ../"$1".mps *
cd ..
lzip -9 "$1".mps.tar
lzip -9 "$1".mps
}
derleme_listyap(){
@ -556,8 +512,6 @@ ayarlar() {
ikaynak="yerel" ;;
-k2|--yrku2)
ikaynak="yerel2" ;;
-sil|--pksl)
paket_siles "$2" ;;
-s|--pksil)
paket_sil "$2" ;;
-d|--pkde)

View File

@ -830,33 +830,24 @@ build_package() {
fi
j=0
done
if [ ! -z PAKET_LOKAL ]; then
local DIR PKGMK_LOCALE LOC
for DIR in usr/share/locale opt/*/share/locale; do
if [ -d $DIR ]; then
for LOC in `cd $DIR && ls`; do
# Need to double check because glibc for exemple create a file in this directory
if [ -d $DIR/$LOC ];then
for PKGMK_LOCALE in ${PAKET_LOKAL[@]}; do
if [ "$PKGMK_LOCALE" == "$LOC" ]; then
if [ "$1" != "$TARGET" ]; then
bsdtar -r -f $PKGMK_PACKAGE_DIR/${name}.${LOC}#$version-any.${PKT_UZANTISI} \
$DIR/$LOC || abort_on_build "${name}.${LOC}#$version-any.${PKT_UZANTISI}"
fi
rm -rf $DIR/$LOC
break
fi
done
fi
done
#dil desteginin eklenmesi-geri kalanın temizlenmesi
if [ ! "$PAKET_LOKAL" == "hepsi" ];then
local lokaldizin
if [ -d usr/share/locale ];then
lokaldizin="usr/share/locale"
fi
if [ -d opt/*/usr/share/locale ];then
lokaldizin="opt/*/usr/share/locale"
fi
for DIR in `ls $lokaldizin` ; do
if [[ "$PAKET_LOKAL" == *"$DIR"* ]]; then
echo $DIR "dil paketi ekleniyor"
else
rm -rf $lokaldizin/$DIR
fi
done
fi
for DIR in usr/share/locale opt/*/share/locale; do
if [ -d $DIR ]; then
rm -rf $DIR
fi
done
if [ "`ls|wc -l`" != "0" ]; then
bsdtar -r -f $PKGMK_PACKAGE_DIR/${name}#$version-${PKGMK_ARCH}.${PKT_UZANTISI} *
else
@ -1510,7 +1501,7 @@ PKGMK_CLEAN="evet"
PAKET_KURMA="evet"
PAKET_GRUPLAR=()
PAKET_LOKAL=(tr)
PAKET_LOKAL="tr"
PKGMK_SOURCE_MIRRORS=()
DERLEME_KAYNAKDIZIN="$PWD"

View File

@ -1,111 +0,0 @@
bin/
boot/
sbin/
dev/
srv/
lib/
lib64/
lib32/
etc/
etc/shells
etc/profile
etc/passwd
etc/onmpsd.conf
etc/inputrc
etc/group
etc/fstab
etc/blfs-bootscripts
etc/bashrc
etc/rpc
etc/nscd.conf
etc/nsswitch.conf
etc/ld.so.conf
etc/mke2fs.conf
etc/hosts
etc/environment
etc/login.defs.orig
etc/login.defs
etc/man_db.conf
etc/wgetrc
etc/rsyncd.conf
etc/gpm-root.conf
etc/mtab
etc/mpsd.conf
etc/dokunulmaz
etc/resolv.conf
etc/ld.so.cache
etc/X11/
etc/skel/
etc/profile.d/
etc/locale/
etc/ld.so.conf.d/
etc/iproute2/
etc/security/
etc/default/
etc/udev/
etc/lvm/
etc/sysconfig/
etc/rc.d/
etc/init.d/
etc/pam.d/
etc/rc.d/rcS.d/
etc/rc.d/rc1.d/
etc/rc.d/rc5.d/
etc/rc.d/rc3.d/
etc/rc.d/rc6.d/
etc/rc.d/rc2.d/
etc/rc.d/rc4.d/
etc/rc.d/rc0.d/
etc/rc.d/init.d/
home/
usr/
mnt/
opt/
root/
run/
sys/
tmp/
usr/bin/
usr/lib/
usr/lib/pkgconfig/
usr/lib64/
usr/sbin/
usr/man/
usr/include/
usr/libexec/
usr/local/
usr/local/bin/
usr/local/lib/
usr/local/lib64/
usr/local/etc/
usr/local/share/
usr/share/
usr/share/applications/
usr/share/icons/
usr/share/icons/hicolor/
usr/share/icons/hicolor/48x48/
usr/share/icons/hicolor/48x48/apps/
usr/share/misc/
usr/share/doc/
usr/share/locale/
usr/share/locale/tr/
usr/share/locale/tr/LC_MESSAGES/
usr/share/man/
usr/share/aclocal/
usr/share/info/
usr/share/man/man1/
usr/share/man/man5/
usr/share/man/tr/man1/
usr/share/man/tr/man5/
usr/share/man/man8/
usr/share/man/man7/
var/
var/lib/
var/lib/pkg/
var/lib/pkg/DB
var/log/
var/lib/
var/run/
var/spool/
var/cache/
var/lib/pkg/drivers/

View File

@ -2,8 +2,9 @@
. /etc/mpsd.conf
. /root/bin/fonks.sh
versiyon="0.1"
iletisim="milisarge@gmail.com"
paketdepo="/depo/paketler/"
sunucu="192.168.3.193:8000/paketdepo/"
sunucu="192.168.3.193:8000/MPS/"
git_sunucu="https://github.com/milisarge/malfs-milis"
ikaynak=""
betikad=${0##*/}
@ -11,6 +12,9 @@ kurulum_onay="evet"
dokunulmaz="/etc/dokunulmaz"
talimatname_dizin="/root/talimatname"
kokdizin="/"
VT="/var/lib/pkg/DB"
TARIHCE_DIZIN="/var/lib/pkg/tarihce"
icerik_ekle(){
paketad=`echo "$1" | cut -d'#' -f1`
@ -51,7 +55,47 @@ icerik_ekle(){
ryaz 34 $paketad" paketi kuruldu."
}
paket_sil(){
icerik_ekle2(){
kokdizin=/mnt/lfs
paketad=`echo "$1" | cut -d'#' -f1`
paketad=`basename $paketad`
ryaz 34 $paketad" paketi kuruluyor."
tar -C /tmp --extract --file=$1 .PRE 1 2> /tmp/$paketad_pre.log
#kos-kur kontrolu
if [ -f /tmp/.PRE ];then
bash /tmp/.PRE
rm /tmp/.PRE
fi
mkdir -p tmpk.$paketad
tar xf $1 -C tmpk.$paketad &&
mkdir -p $kokdizin/var/lib/pkg/DB/"$paketad" &&
cp -avf tmpk.$paketad/* $kokdizin > tmpk.$paketad/kurulan &&
cat tmpk.$paketad/kurulan | cut -d '>' -f2 > $kokdizin/var/lib/pkg/DB/"$paketad"/kurulan
#mv tmpk.$paketad/.MTREE /var/lib/pkg/DB/"$paketad"/files &&
mv tmpk.$paketad/.META $kokdizin/var/lib/pkg/DB/"$paketad"/META &&
#kur-kos calistirilmasi
if [ -f tmpk.$paketad/.POST ];then
bash tmpk.$paketad/.POST
rm tmpk.$paketad/.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
rm -r tmpk.$paketad
if [ -f /etc/ld.so.conf ];then
ldconfig
fi
ryaz 34 $paketad" paketi kuruldu."
}
paket_siles(){
local paket kkont sil_onay
if [ -f $dokunulmaz ];then
kkont=`kurulu_kontrol "$1"`
@ -94,25 +138,32 @@ paket_sil(){
}
paket_silyeni(){
local paket kkont sil_onay
paket_sil(){
local paket kkont sil_onay oto_silme
paket="$1"
if [ -f "/var/lib/pkg/DB/$paket/kurulan" ];then
kkont=`kurulu_kontrol "$1"`
if [ "$kkont" = "kurulu" ];then
#
#while IFS='' read -r line || [[ -n "$line" ]]; do
if [ "$2" ]; then
oto_silme="$2"
fi
kkont=`kurulu_kontrol "$1"`
if [ "$kkont" = "kurulu" ];then
if [ -f "/var/lib/pkg/DB/$paket/kurulan" ];then
cat /var/lib/pkg/DB/$paket/kurulan | cut -d '>' -f2 > /tmp/$paket.sil
while true; do
ryaz 34 $paket" $1 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
ryaz 31 "ters bagimliliklar"
ryaz 31 "------------------"
ters_bagimli_kontrol "$paket"
ryaz 31 "------------------"
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
if [ "$sil_onay" = "e" ];then
xargs rm -r -f < /tmp/$paket.sil &&
rm -r -f /var/lib/pkg/DB/"$paket" &&
@ -120,10 +171,10 @@ paket_silyeni(){
fi
rm -f /tmp/$paket.sil
else
ryaz 31 "paket zaten kurulu değil!"
ryaz 31 "kritik mesaj:kurulanlar dosyası yok."
fi
else
echo "kritik mesaj:kurulanlar dosyası yok."
ryaz 32 "paket zaten kurulu değil!"
fi
}
@ -140,6 +191,14 @@ paket_bilgi(){
}
yeniden_paketle(){
cd $1
bsdtar -r -f ../"$1".mps .META
bsdtar -r -f ../"$1".mps *
cd ..
lzip -9 "$1".mps
}
derleme_listyap(){
bagimlist=`bagimlilar "$1"`
for bagim in $bagimlist;do
@ -172,6 +231,7 @@ derleme_listbilgi(){
paket_derle_oto(){
for dpkt in `cat $1`;do
echo $dpkt "derleniyor...."
zorla_derle="yok"
paket_derle $dpkt
done
}
@ -181,15 +241,55 @@ paket_derle_oto2(){
}
paket_kur_oto(){
local kpkt pkt
local kpkt pkt pak
for kpkt in `cat $1`;do
for pkt in `ls $kpkt* | cut -d'#' -f1`;do
mps -k "$pkt#"*
pak=`ls "$pkt#"*`
mps -k "$pak"
done
done
}
paket_kur_liste(){
local kpkt pkt pak
for kpkt in `cat $1`;do
for pkt in `ls $kpkt* | cut -d'#' -f1`;do
pak=`ls "$pkt#"*`
mps -k2 "$pak"
done
done
}
#otomatik kontrollu kur
paket_kur_oto2(){
mps -dly "$1" > /dev/null && mps -ok genel.derleme.liste
}
paket_diskur_oto(){
local kpkt pkt pak
for kpkt in `cat $1`;do
mps -ik "$kpkt"
done
}
#otomatik kontrollu kur
paket_diskur_oto2(){
mps -dly "$1" > /dev/null && mps -oik genel.derleme.liste
}
paket_sil_oto(){
local spkt
for spkt in `cat $1`;do
oto_silme="evet"
paket_sil "$spkt" "$oto_silme"
done
}
paket_derle(){
#eski derleme kalıntılarını temizle
if [ -d tmp.* ];then
rm -r tmp.*
fi
kaynakdizin_kontrol
local konum derleme_onay eh bagimd
derleme_onay="h"
@ -198,24 +298,14 @@ paket_derle(){
mkdir -p tmp."$1"
cp -a $konum/* tmp."$1"/
cd tmp."$1"
if [ `kurulu_kontrol "$1"` = "kurulu" ] && [ "$zorla_derle" = "yok" ];then
#versiyon kontrolunde acılacak
#while true; do
# read -p "$1 paketi zaten kurulu yine de derlensin mi?" eh
# case $eh in
# [Ee]* ) derleme_onay="e"; break;;
# [Hh]* ) break;;
# * ) echo "e veya h";;
# esac
#done
if [ "`kurulu_kontrol "$1"`" = "kurulu" ] && [ "$zorla_derle" = "yok" ];then
derleme_onay="h"
else
echo "-----"
derleme_onay="e"
fi
if [ "$derleme_onay" = "e" ];then
echo "$1" "derleniyor...."
ryaz 33 "$1" "derleniyor...."
#mpsd -d > /dev/null
#mpsd -d
echo "------------------------"
@ -230,11 +320,14 @@ paket_derle(){
done
fi
mv *.mps.lz ../
else
ryaz 32 "paket zaten kurulu,yine de derlemek için:
mps -zd $1"
fi
cd ..
rm -r tmp."$1"
else
echo "talimat dosyası bulunamadı."
ryaz 31 "talimat dosyası bulunamadı."
fi
}
@ -265,6 +358,21 @@ bagimli_bilgi(){
done
fi
echo "$1" "`kurulu_kontrol $1`"
}
ters_bagimli(){
local ara
ara=" $1 "
sy=`grep -o "/" <<<"$talimatname_dizin" | wc -l`
grep -rli "$ara" "$talimatname_dizin" | cut -d'/' -f`expr $sy + 3`
}
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
}
kurulu_kontrol(){
@ -281,6 +389,93 @@ kaynakdizin_kontrol(){
fi
}
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
}
log_tutma(){
echo "$(date +'%F %T') - $1 - paket" >> test.log
}
git_guncelle() {
kaynakdizin_kontrol
cd $DERLEME_KAYNAKDIZIN
@ -293,14 +488,17 @@ git_guncelle() {
git pull
fi
ryaz 33 "yerele eşitleniyor."
rm -r $talimatname_dizin/*
rsync -a $DERLEME_KAYNAKDIZIN/milis.git/talimatname/ $talimatname_dizin
rm -r `dirname $talimatname_dizin`/bin/*
rsync -a $DERLEME_KAYNAKDIZIN/milis.git/bin/ `dirname $talimatname_dizin`/bin
}
paketvt_guncelle(){
wget -q --spider "$sunucu""paket.vt"
#if wget -P /tmp -q "$sunucu""paket.vt" > /dev/null; then
if [ $? -eq 0 ]; then
echo "paket veritabanı guncellenıyor." "$paketdepo""paket.vt"
ryaz 32 "paket veritabanı guncellenıyor." "$paketdepo""paket.vt"
if [ -f "$paketdepo""paket.vt" ];then
mv "$paketdepo""paket.vt" "$paketdepo""paket.vt.eski"
fi
@ -308,7 +506,7 @@ paketvt_guncelle(){
#rm /tmp/paket.vt*
exit 1
fi
echo "paket veritabanı guncelleme olumsuz."
ryaz 31 "paket veritabanı guncelleme olumsuz."
}
talimat_bilgi(){
@ -326,9 +524,9 @@ sistem_kontrol(){
sunucu_kontrol(){
wget -q --spider $sunucu
if [ $? -eq 0 ]; then
echo "paket sunucu aktif"
ryaz 32 "paket sunucu aktif"
else
echo "sunucu erişim dışı"
ryaz 31 "sunucu erişim dışı"
exit 1
fi
}
@ -356,11 +554,14 @@ ayarlar() {
ikaynak="ag" ;;
-k|--yrku)
ikaynak="yerel" ;;
-s|--pksl)
-k2|--yrku2)
ikaynak="yerel2" ;;
-sil|--pksl)
paket_siles "$2" ;;
-s|--pksil)
paket_sil "$2" ;;
-si|--pksil)
paket_silyeni "$2" ;;
-d|--pkde)
zorla_derle="yok"
kurulum_onay="olumsuz"
paket_derle "$2" ;;
-zd|--pkzde)
@ -374,7 +575,25 @@ ayarlar() {
-odkk|--pkodk2)
paket_derle_oto2 "$2" ;;
-ok|--pkok)
paket_kur_oto "$2" ;;
paket_kur_oto "$2" ;;
-okl|--pkokl)
paket_kur_liste "$2" ;;
-ko|--pkko)
paket_kur_oto2 "$2" ;;
-oik|--pkok2)
paket_diskur_oto "$2" ;;
-iko|--pkko2)
paket_diskur_oto2 "$2" ;;
-pak|--paketle)
yeniden_paketle "$2" ;;
-os|--pkos)
if [ ! "$2" ]; then
ryaz 31 "silme listesi yok"
exit 1
fi
paket_sil_oto "$2" ;;
-kl|--kurulu-liste)
ls $VT ;;
-dly|--drly)
if [ -f derleme.liste ];then
mv derleme.liste derleme.liste.eski
@ -391,7 +610,11 @@ ayarlar() {
paket_bilgi "$2" ;;
-bb|--pkbb)
bagimli_bilgi "$2" | column -t;;
-tb|--talb)
-tb|--pktb)
ters_bagimli "$2" ;;
-tbk|--pktbk)
ters_bagimli_kontrol "$2" ;;
-talb|--talb)
talimat_bilgi "$2" | column -t;;
-Ggit|--gitgun)
git_guncelle ;;
@ -399,16 +622,16 @@ ayarlar() {
paketvt_guncelle ;;
-g|--pkgu)
if [ ! "$2" ]; then
echo "paket ismi eksik"
ryaz 31 "paket ismi eksik"
exit 1
fi
paket_guncelle "$2";;
-kuko|--kurulu-kontrol)
-kk|--kurulu-kontrol)
if [ ! "$2" ]; then
echo "paket ismi eksik"
ryaz 31 "paket ismi eksik"
exit 1
fi
kurulu_kontrol "$2";;
ryaz 31 `kurulu_kontrol "$2"`;;
-suko)
sunucu_kontrol ;;
-cf|--config-file)
@ -418,8 +641,29 @@ ayarlar() {
fi
ayar_dosyasi="$2"
shift ;;
-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 ;;
-v)
echo "$betikad $versiyon"
ryaz 33 "$betikad $versiyon $iletisim"
exit 0 ;;
-h|--help)
yardim
@ -435,8 +679,9 @@ ayarlar "$@"
if [ "$ikaynak" = "ag" ]; then
echo "agdan cekiliyor:" "$2"
#pkt=`cat "$paketdepo""paket.vt" | grep -w "$2" | cut -d' ' -f2`
pkt=`cat "$paketdepo""paket.vt" | grep "$2"# | cut -d' ' -f2`
pkt=`cat "$paketdepo""paket.vt" | grep "^$2 " | cut -d' ' -f3`
echo $pkt
if [ ! -z "$pkt" -a "$pkt" != "" ]; then
cpaket="${pkt/'#'/'%23'}"
#paket sunucuda varsa
@ -451,7 +696,7 @@ if [ "$ikaynak" = "ag" ]; then
icerik_ekle "$paketdepo$pkt"
exit 1
else
echo "paket zaten kurulu!"
ryaz 31 "paket zaten kurulu!"
fi
fi
fi
@ -470,7 +715,8 @@ if [ "$ikaynak" = "yerel" ]; then
icerik_ekle "$2"
else
while true; do
read -p "$2 paketi zaten kurulu silinip kurulsun mu?" eh
ryaz 31 "$2 paketi zaten kurulu silinip kurulsun mu?"
read -p "e veya h -> " eh
case $eh in
[Ee]* ) silme="e"; break;;
[Hh]* ) break;;
@ -478,15 +724,34 @@ if [ "$ikaynak" = "yerel" ]; then
esac
done
if [ "$silme" = "e" ];then
paket_silyeni "$paketad"
ryaz 33 "silinecekelerin kontrolu için"
paket_sil "$paketad"
icerik_ekle "$2"
fi
fi
else
echo "yerelde mps paketi bulunamadı."
ryaz 31 "yerelde mps paketi bulunamadı."
fi
fi
if [ "$ikaynak" = "yerel2" ]; then
local silme
pkontrol=`basename $2 | grep -w "mps.lz"`
if [ ! -z "$pkontrol" -a "$pkontrol" != "" ]; then
paketad=`echo "$2" | cut -d'#' -f1`
kkont=`kurulu_kontrol "$paketad"`
icerik_ekle2 "$2"
else
ryaz 31 "yerelde mps paketi bulunamadı."
fi
fi
}
ana "$@"
#31 kirmizi
#32 yesil
#33 sari
#34 mavi
#34 mor

View File

@ -55,12 +55,12 @@ check_pkgfile() {
exit $E_TALIMAT
fi
if [ "${version}" == "" ]; then
error "Variable 'version' not initiated or not found in $PKGMK_PKGFILE."
error "'versiyon' degeri $PKGMK_PKGFILE dosyası içinde yok veya tanımlı degil."
exit $E_TALIMAT
fi
if [ "$SURUM_YOKSAY" = "yok" ]; then
if [ "${release}" == "" ]; then
error "Variable 'release' not initiated or not found in $PKGMK_PKGFILE."
error " 'release' degeri $PKGMK_PKGFILE dosyası içinde yok veya tanımlı degil."
exit $E_TALIMAT
fi
fi
@ -830,33 +830,24 @@ build_package() {
fi
j=0
done
if [ ! -z PAKET_LOKAL ]; then
local DIR PKGMK_LOCALE LOC
for DIR in usr/share/locale opt/*/share/locale; do
if [ -d $DIR ]; then
for LOC in `cd $DIR && ls`; do
# Need to double check because glibc for exemple create a file in this directory
if [ -d $DIR/$LOC ];then
for PKGMK_LOCALE in ${PAKET_LOKAL[@]}; do
if [ "$PKGMK_LOCALE" == "$LOC" ]; then
if [ "$1" != "$TARGET" ]; then
bsdtar -r -f $PKGMK_PACKAGE_DIR/${name}.${LOC}#$version-any.${PKT_UZANTISI} \
$DIR/$LOC || abort_on_build "${name}.${LOC}#$version-any.${PKT_UZANTISI}"
fi
rm -rf $DIR/$LOC
break
fi
done
fi
done
#dil desteginin eklenmesi-geri kalanın temizlenmesi
if [ ! "$PAKET_LOKAL" == "hepsi" ];then
local lokaldizin
if [ -d usr/share/locale ];then
lokaldizin="usr/share/locale"
fi
if [ -d opt/*/usr/share/locale ];then
lokaldizin="opt/*/usr/share/locale"
fi
for DIR in `ls $lokaldizin` ; do
if [[ "$PAKET_LOKAL" == *"$DIR"* ]]; then
echo $DIR "dil paketi ekleniyor"
else
rm -rf $lokaldizin/$DIR
fi
done
fi
for DIR in usr/share/locale opt/*/share/locale; do
if [ -d $DIR ]; then
rm -rf $DIR
fi
done
if [ "`ls|wc -l`" != "0" ]; then
bsdtar -r -f $PKGMK_PACKAGE_DIR/${name}#$version-${PKGMK_ARCH}.${PKT_UZANTISI} *
else
@ -1510,7 +1501,7 @@ PKGMK_CLEAN="evet"
PAKET_KURMA="evet"
PAKET_GRUPLAR=()
PAKET_LOKAL=(tr)
PAKET_LOKAL="tr"
PKGMK_SOURCE_MIRRORS=()
DERLEME_KAYNAKDIZIN="$PWD"

View File

@ -26,6 +26,6 @@ PKGMK_KEEP_SOURCES="evet"
MD5SUM_YOKSAY="evet"
PKGMK_CLEAN="yok"
PAKET_GRUPLAR=()
PAKET_LOKAL=(tr)
PAKET_LOKAL="tr"
KOLEKSIYON_YOKSAY="yok"
SURUM_YOKSAY="yok"

View File

@ -25,8 +25,8 @@ PKGMK_UPDATE_INDEX="evet"
PKGMK_KEEP_SOURCES="evet"
MD5SUM_YOKSAY="evet"
PKGMK_CLEAN="yok"
PAKET_GRUPLAR=()
PAKET_LOKAL=(tr)
PAKET_GRUPLAR=(devel service)
PAKET_LOKAL="tr"
KOLEKSIYON_YOKSAY="yok"
SURUM_YOKSAY="yok"
SURUM_YOKSAY="evet"
PAKETSIZ_DERLEME="evet"

View File

@ -5,6 +5,7 @@
name=nano
version=2.5.2
release=1
#PAKET_LOKAL="hepsi"
source=(http://ftp.gnu.org/gnu/$name/$name-$version.tar.gz)