wok-current rev 4719
slitaz-dev-tools: add tazdev dry-purge
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jan 05 12:39:19 2010 +0100 (2010-01-05) |
parents | 8fbfc72ff1a2 |
children | d6b1e6646591 |
files | slitaz-dev-tools/stuff/tazdev |
line diff
1.1 --- a/slitaz-dev-tools/stuff/tazdev Tue Jan 05 13:23:23 2010 +0100 1.2 +++ b/slitaz-dev-tools/stuff/tazdev Tue Jan 05 12:39:19 2010 +0100 1.3 @@ -31,6 +31,7 @@ 1.4 gen-chroot Generate a chroot using the last cooking base rootfs. 1.5 clean-chroot Clean a chroot environment (skip root/ and home/). 1.6 purge Remove obsolate packages and obsolate source tarballs. 1.7 + dry-purge Show obsolate packages and obsolate source tarballs. 1.8 push Upload new packages to the main mirror (-p). 1.9 dry-push Show what will be uploaded to the mirror. Does nothing (-dp). 1.10 pull Download new packages from the main mirror. 1.11 @@ -149,6 +150,7 @@ 1.12 # Remove obsolate slitaz packages 1.13 purge_packages() 1.14 { 1.15 + arg=$1 1.16 TMP_FILE=/tmp/tazdev.$$ 1.17 ls $BUILD_WOK | while read pkg; do 1.18 [ -f $BUILD_WOK/$pkg/taz/*/receipt ] || continue 1.19 @@ -161,6 +163,7 @@ 1.20 *.tazpkg) 1.21 grep -q ^$pkg$ $TMP_FILE && continue 1.22 echo Remove $pkg 1.23 + [ "$arg" == "purge" ] && 1.24 rm -f $SLITAZ/chroot/home/slitaz/packages/$pkg ;; 1.25 esac 1.26 done 1.27 @@ -170,6 +173,7 @@ 1.28 # Remove obsolate source tarballs 1.29 purge_sources() 1.30 { 1.31 + arg=$1 1.32 TMP_FILE=/tmp/tazdev.$$ 1.33 ls $BUILD_WOK | while read pkg; do 1.34 [ -f $BUILD_WOK/$pkg/taz/*/receipt ] || continue 1.35 @@ -180,6 +184,7 @@ 1.36 ls $SLITAZ/chroot/home/slitaz/src | while read pkg; do 1.37 grep -q ^$pkg$ $TMP_FILE && continue 1.38 echo Remove $pkg 1.39 + [ "$arg" == "purge" ] && 1.40 rm -f $SLITAZ/chroot/home/slitaz/src/$pkg 1.41 done 1.42 rm -f $TMP_FILE 1.43 @@ -300,11 +305,11 @@ 1.44 check_mirror $@ 1.45 rsync -r -t -l -v -z --delete --dry-run \ 1.46 -e ssh $USER@$MIRROR:$REMOTE_DIR $LOCAL_DIR ;; 1.47 - purge) 1.48 + purge|dry-purge) 1.49 check_root 1.50 get_version $@ 1.51 - purge_packages 1.52 - purge_sources 1.53 + purge_packages $1 1.54 + purge_sources $1 1.55 ;; 1.56 usage|*) 1.57 usage ;;