# HG changeset patch # User Pascal Bellard # Date 1275132762 -7200 # Node ID 2c7074daece038ae7dc803eff6b7fddf7f17e848 # Parent b453ffcf59cd9ce150ca7f1069fc563511a7f279 mirror-tools: may use local hg copy diff -r b453ffcf59cd -r 2c7074daece0 mirror-tools/stuff/usr/bin/mkpkgiso --- a/mirror-tools/stuff/usr/bin/mkpkgiso Sat May 29 12:06:33 2010 +0200 +++ b/mirror-tools/stuff/usr/bin/mkpkgiso Sat May 29 13:32:42 2010 +0200 @@ -5,7 +5,7 @@ # Authors : Eric Joseph-Alexandre # Pascal Bellard -VERSION=0.8 +VERSION=0.9 PKG_VER=$1 ROOT=/home/slitaz/iso @@ -42,12 +42,25 @@ Usage: $(basename $0) [--boot [--auto-install] [--loram-detect]]|--webboot] [--filter] [--wok] [--wok-stable] [--website] [--sources] [--dry-run] + $(basename $0) update-hg Example: $(basename $0) cooking --boot --auto-install --loram-detect --filter --wok --website --sources EOT exit 1 fi +# Update hg repos +if [ "$PKG_VER" == "update-hg" ]; then + for i in $1/* ; do + [ -s $i/.hg/hgrc ] || continue + cd $i + hg pull + hg update + cd - > /dev/null + done + exit 1 +fi + # Check if we provide a valide version if [ ! -d $REPOS ]; then echo "Boooh! $PKG_VER is not a valid version." @@ -204,8 +217,12 @@ get_from_hg() { echo -n "Adding $2" -wget -q -O - http://hg.slitaz.org/$1/archive/tip.tar.bz2 | tar xjf - -C $TEMP_DIR -mv $TEMP_DIR/$1-* $TEMP_DIR/$1 +if [ -s /home/slitaz/$1/.hg/hgrc ]; then + cp -a /home/slitaz/$1 $TEMP_DIR +else + wget -q -O - http://hg.slitaz.org/$1/archive/tip.tar.bz2 | tar xjf - -C $TEMP_DIR + mv $TEMP_DIR/$1-* $TEMP_DIR/$1 +fi status echo "$(du -hs $TEMP_DIR/$1 | awk '{ print $1 }') used by $2." }