tazwok rev 104

Add tazwok gen-list --text --fakewok
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Nov 19 12:07:50 2008 +0000 (2008-11-19)
parents b9206ba8ecf1
children 4e05e33a12cf
files tazwok
line diff
     1.1 --- a/tazwok	Thu Nov 13 10:12:14 2008 +0000
     1.2 +++ b/tazwok	Wed Nov 19 12:07:50 2008 +0000
     1.3 @@ -593,6 +593,7 @@
     1.4  	# packages.desc is used by Tazpkgbox <tree>.
     1.5  	echo "$PACKAGE | $VERSION | $SHORT_DESC | $CATEGORY | $WEB_SITE" >> packages.desc
     1.6  	# packages.equiv is used by tazpkg install to check depends
     1.7 +	touch packages.equiv
     1.8  	for i in $PROVIDE; do
     1.9  		DEST=""
    1.10  		echo $i | grep -q : && DEST="${i#*:}:"
    1.11 @@ -1048,8 +1049,23 @@
    1.12  		# if $2 is not empty cd into $2. A text packages list can also be gen
    1.13  		# with the option --text.
    1.14  		#
    1.15 +		fakewok="no"
    1.16  		if [ "$2" == "--text" ]; then
    1.17  			textlist="yes"
    1.18 +			if [ "$3" == "--fakewok" ]; then
    1.19 +				fakewok="yes"
    1.20 +				WOK=/tmp/fakewok-$$
    1.21 +				mkdir -p $WOK
    1.22 +				PACKAGES_REPOSITORY=$(pwd)
    1.23 +				for i in *.tazpkg; do
    1.24 +					(cd $WOK; cpio -i receipt files.list) < $i
    1.25 +					. $WOK/receipt
    1.26 +					mkdir -p $WOK/$PACKAGE/taz/$PACKAGE-$VERSION
    1.27 +					mv $WOK/receipt $WOK/files.list \
    1.28 +						$WOK/$PACKAGE/taz/$PACKAGE-$VERSION
    1.29 +					ln $WOK/$PACKAGE/taz/$PACKAGE-$VERSION/receipt $WOK/$PACKAGE
    1.30 +				done
    1.31 +			fi
    1.32  		elif [ -z "$2" ]; then
    1.33  			PACKAGES_REPOSITORY=$PACKAGES_REPOSITORY
    1.34  		else
    1.35 @@ -1070,6 +1086,7 @@
    1.36  		# Generate packages.txt
    1.37  		if [ "$textlist" == "yes" ]; then
    1.38  			gen_textlist
    1.39 +			[ "$fakewok" == "yes" ] && rm -rf $WOK
    1.40  		fi
    1.41  		echo -n "Creating the raw packages list... "
    1.42  		ls -1 *.tazpkg > /tmp/packages.list