diff options
author | tnut <thierryn1 at hispeed dot ch> | 2010-09-08 22:47:30 +0200 |
---|---|---|
committer | tnut <thierryn1 at hispeed dot ch> | 2010-09-08 22:47:30 +0200 |
commit | a9fd14f65e9135ab32dac7eff76464050236e394 (patch) | |
tree | 0153f97197b61a4ee5e513b64a672802f246b897 /base/pkg-get/syn | |
parent | 2516921cc8d37126ab30db439cdd33b0b21b805e (diff) | |
download | nutyx-pakxe-a9fd14f65e9135ab32dac7eff76464050236e394.tar.gz nutyx-pakxe-a9fd14f65e9135ab32dac7eff76464050236e394.tar.bz2 nutyx-pakxe-a9fd14f65e9135ab32dac7eff76464050236e394.tar.xz nutyx-pakxe-a9fd14f65e9135ab32dac7eff76464050236e394.zip |
maj pkg-get#0.5.1-2
Diffstat (limited to 'base/pkg-get/syn')
-rw-r--r-- | base/pkg-get/syn | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/base/pkg-get/syn b/base/pkg-get/syn index 70beace61..d29fcd6f7 100644 --- a/base/pkg-get/syn +++ b/base/pkg-get/syn @@ -1,16 +1,32 @@ #!/bin/bash MediaDepot=/media/cdrom/depot Depot=/srv/NuTyX +find_cd() { +EXPECT_LABEL="nutyxcd" +let PKGNB=0 +for SYS in /sys/block/sd* /sys/block/sr* ; do + if [ ! -d "$SYS" ]; then continue; fi + DEV=/dev/${SYS##*/} + LABEL=`dd if=$DEV bs=1 skip=32808 count=32 2>/dev/null` + if [ $LABEL == $EXPECT_LABEL ] 2>/dev/null ; then + mkdir -p /media/cdrom 2>/dev/null + mount $DEV /media/cdrom + if [ ! -d /media/cdrom/depot ]; then + umount -n /media/cdrom + fi + break + fi +done +} if [ ! "$EUID" -eq 0 ]; then echo "Seul le compte root peut synchroniser les ports NuTyX" exit 1 fi +if ! mountpoint /media/cdrom > /dev/null; then + find_cd +fi if [ ! -L /depot ]; then - if [ ! -d $Depot/locale ]; then mkdir -p $Depot/locale; fi - pushd $Depot/locale > /dev/null - pkg-repgen - popd - for i in test release + for i in `cat /etc/pkg-get.conf |grep -v ^#|grep http|cut -d "|" -f 1|cut -d" " -f2|cut -d"/" -f4` do if [ -a $Depot/$i ]; then rm -r $Depot/$i @@ -20,14 +36,17 @@ if [ ! -L /depot ]; then for i in `cat /etc/pkg-get.conf |grep -v ^#|grep http|cut -d "|" -f 1|cut -d" " -f2|cut -d"/" -f4` do if [ -d $MediaDepot/$i ]; then - echo "Dépot $i trouvé sur le media" rm -r $Depot/$i > /dev/null 2>&1 mkdir -p $Depot/$i - for j in $MediaDepot/$i/*.gz + for j in $MediaDepot/$i/*.xz do + let PKGNB=$PKGNB+1 + fj=`basename $j` - ln -svf $MediaDepot/$i/$fj $Depot/$i/$fj > /dev/null + ln -sf $MediaDepot/$i/$fj $Depot/$i/$fj + echo -n -e "$PKGNB Paquets trouvés sur le média\r" done + echo "$PKGNB Paquets trouvés sur le média" cp $MediaDepot/$i/PKG* $Depot/$i/ fi done @@ -36,5 +55,4 @@ else do rsync -avuz --delete-before rsync://nutyx.meticul.eu/nutyx/attapu/i686/$i/ $Depot/$i/ done -fi - +fi |