wok-4.x rev 4839

mirror-tools: add --sources
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jan 28 16:26:39 2010 +0100 (2010-01-28)
parents ff5cd7e10116
children 85313fe45f02
files mirror-tools/stuff/usr/bin/mkpkgiso
line diff
     1.1 --- a/mirror-tools/stuff/usr/bin/mkpkgiso	Wed Jan 27 12:53:01 2010 +0100
     1.2 +++ b/mirror-tools/stuff/usr/bin/mkpkgiso	Thu Jan 28 16:26:39 2010 +0100
     1.3 @@ -5,11 +5,12 @@
     1.4  # Authors : Eric Joseph-Alexandre <erjo@slitaz.org>
     1.5  #	    Pascal Bellard <pascal.bellard@slitaz.org>
     1.6  
     1.7 -VERSION=0.7
     1.8 +VERSION=0.8
     1.9  
    1.10  PKG_VER=$1
    1.11  ROOT=/home/slitaz/iso
    1.12  REPOS=/var/www/slitaz/mirror/packages/$PKG_VER
    1.13 +SOURCES=/var/www/slitaz/mirror/sources/packages
    1.14  IFMEM_C32=/var/www/slitaz/mirror/pxe/ifmem.c32
    1.15  ISO_DIR=/var/www/slitaz/mirror/iso/$PKG_VER
    1.16  
    1.17 @@ -22,12 +23,17 @@
    1.18  shift
    1.19  OPTIONS=$@
    1.20  PKG_DIR=$TEMP_DIR/packages/$PKG_VER
    1.21 +SRC_DIR=$TEMP_DIR/src
    1.22  LOG=$PWD/$(basename $0).log
    1.23  
    1.24  #
    1.25  VOLUME_ID="packages-${PKG_VER}"
    1.26  PUBLISHER="SliTaz http://www.slitaz.org/"
    1.27  IMAGE="packages-${PKG_VER}.iso"
    1.28 +case " $@ " in
    1.29 +*\ --sources\ *)
    1.30 +	IMAGE="sources-${PKG_VER}.iso" ;;
    1.31 +esac
    1.32  OUTPUT="$ROOT/$IMAGE"
    1.33  
    1.34  # Check command line option.
    1.35 @@ -35,9 +41,9 @@
    1.36  	cat <<EOT
    1.37  Usage: $(basename $0) <Version> 
    1.38  	[--boot [--auto-install] [--loram-detect]]|--webboot] [--filter]
    1.39 -	[--wok] [--wok-stable] [--website][--dry-run]
    1.40 +	[--wok] [--wok-stable] [--website] [--sources] [--dry-run]
    1.41  Example:
    1.42 -$(basename $0) cooking --boot --auto-install --loram-detect --filter --wok --website
    1.43 +$(basename $0) cooking --boot --auto-install --loram-detect --filter --wok --website --sources
    1.44  EOT
    1.45  	exit 1
    1.46  fi
    1.47 @@ -232,6 +238,23 @@
    1.48  echo "=> slitaz web site installed in file://\$DIR/website/index.html"
    1.49  EOF
    1.50  	fi;;
    1.51 +--sources)
    1.52 +	cat >>$TEMP_DIR/install.sh<<EOF
    1.53 +mkdir -p /home/slitaz
    1.54 +ln -s \$DIR/src /home/slitaz
    1.55 +echo "=> sources are in /home/slitaz/src"
    1.56 +EOF
    1.57 +	mkdir -p $SRC_DIR
    1.58 +	cd $SRC_DIR
    1.59 +	for i in $SOURCES/*/*
    1.60 +	do
    1.61 +		case "$i" in
    1.62 +		*/md5sum) continue;;
    1.63 +		esac
    1.64 +		ln -s $i >> $LOG 2>&1
    1.65 +	done
    1.66 +	find * -not -type d | grep -v md5sum | xargs md5sum > md5sum
    1.67 +	echo "$(du -hs $SOURCES | awk '{ print $1 }') used by sources." ;;
    1.68  esac
    1.69  done
    1.70