wok-current rev 2569

mirror-tools/mkpkgiso: add wok/wok-stable
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Mar 30 16:47:36 2009 +0000 (2009-03-30)
parents e87dfe7c463c
children 7a3ed9be8ba6
files mirror-tools/stuff/usr/bin/mkpkgiso
line diff
     1.1 --- a/mirror-tools/stuff/usr/bin/mkpkgiso	Mon Mar 30 16:42:11 2009 +0000
     1.2 +++ b/mirror-tools/stuff/usr/bin/mkpkgiso	Mon Mar 30 16:47:36 2009 +0000
     1.3 @@ -5,7 +5,7 @@
     1.4  # Authors : Eric Joseph-Alexandre <erjo@slitaz.org>
     1.5  #	    Pascal Bellard <pascal.bellard@slitaz.org>
     1.6  
     1.7 -VERSION=0.3
     1.8 +VERSION=0.4
     1.9  
    1.10  ROOT=/home/slitaz/iso
    1.11  TEMP_DIR=${ROOT}/_iso.$$
    1.12 @@ -114,22 +114,33 @@
    1.13  	fi
    1.14  	echo "$SIZE$UNIT removed.";;
    1.15  esac
    1.16 +
    1.17 +# Copy hg subtree
    1.18 +get_from_hg()
    1.19 +{
    1.20 +[ /slitaz/home/slitaz/hg/$1 ] || return
    1.21 +echo -n "Adding $2"
    1.22 +/usr/sbin/chroot /slitaz hg --repository /home/slitaz/hg/$1 pull >/dev/null
    1.23 +/usr/sbin/chroot /slitaz hg --repository /home/slitaz/hg/$1 update >/dev/null
    1.24 +mkdir $TEMP_DIR/$1
    1.25 +cp -a /slitaz/home/slitaz/hg/$1/* $TEMP_DIR/$1
    1.26 +status
    1.27 +echo "$(du -hs $TEMP_DIR/$1 | awk '{ print $1 }') used by $2."
    1.28 +}
    1.29 +
    1.30  case " $OPTIONS " in
    1.31 +*\ --wok\ *)
    1.32 +	get_from_hg wok "wok (cooking)";;
    1.33 +*\ --wok-stable\ *)
    1.34 +	get_from_hg wok-stable "wok (stable)";;
    1.35  *\ --website\ *)
    1.36 -	if [ -d /slitaz/home/slitaz/hg/website ]; then
    1.37 -		echo -n "Adding web site"
    1.38 -		/usr/sbin/chroot /slitaz hg --repository /home/slitaz/hg/website pull >/dev/null
    1.39 -		/usr/sbin/chroot /slitaz hg --repository /home/slitaz/hg/website update >/dev/null
    1.40 -		mkdir $TEMP_DIR/website
    1.41 -		cp -a /slitaz/home/slitaz/hg/website/* $TEMP_DIR/website
    1.42 +	if get_from_hg website "web site"; then
    1.43  		cat >>$TEMP_DIR/install.sh<<EOF
    1.44  echo "Install http://127.0.0.1/website ..."
    1.45  [ -d /var/www ] || mkdir -p /var/www
    1.46  ln -s \$DIR/website /var/www
    1.47  tazpkg list | grep -q ^lighttpd || yes y | tazpkg get-install lighttpd
    1.48  EOF
    1.49 -		status
    1.50 -		echo "$(du -hs $TEMP_DIR/website | awk '{ print $1 }') used by web site."
    1.51  	fi;;
    1.52  esac
    1.53