tazwok rev 13

Create a files.list suitable for 'tazpkg repack'
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Dec 15 09:43:14 2007 +0000 (2007-12-15)
parents c10b966d9bf2
children 3cee15956bd9
files tazwok
line diff
     1.1 --- a/tazwok	Wed Dec 12 19:00:28 2007 +0100
     1.2 +++ b/tazwok	Sat Dec 15 09:43:14 2007 +0000
     1.3 @@ -295,21 +295,35 @@
     1.4  	# Creat the files.list by redirecting find outpout.
     1.5  	echo -n "Creating the list of files..."
     1.6  	cd taz/$PACKAGE-$VERSION/fs
     1.7 -	find . -type f -print > ../files.list
     1.8 -	find . -type l -print >> ../files.list
     1.9 -	cd .. && sed -i s/'^.'/''/ files.list
    1.10 +	ALL_FILES="$(find . -print)"
    1.11 +  	LAST_FILE=""
    1.12 +  	FILES_LIST=""
    1.13 +  	for i in $FILES_LIST; do
    1.14 +		if [ "$LAST_FILE" != "" ]; then
    1.15 +			case "$i" in
    1.16 +			$LAST_FILE/*)
    1.17 +				case "$(ls -ld \"$LAST_FILE\")" in 
    1.18 +				drwxr-xr-x\ *\ root\ root\ *);;
    1.19 +				*) FILES_LIST="$FILES_LIST '${LAST_FILE#fs}'";;
    1.20 +				esac;;
    1.21 +			*) FILES_LIST="$FILES_LIST '${LAST_FILE#fs}'";;
    1.22 +			esac
    1.23 +		fi
    1.24 +		LAST_FILE=$i
    1.25 +	done
    1.26 +	FILES_LIST="$FILES_LIST '${LAST_FILE#fs}'"
    1.27 +	cd .. 
    1.28 +	eval 'for i in' $FILES_LIST '; do echo $i; done' > ../files.list
    1.29  	status
    1.30  	# Build cpio archives. Find, cpio and gzip the fs, finish by
    1.31  	# removing the fs tree.
    1.32  	echo -n "Compressing the fs... "
    1.33 -	find fs -print | cpio -o -H newc > fs.cpio
    1.34 -	gzip fs.cpio && rm -rf fs
    1.35 +	find fs -print | cpio -o -H newc | gzip > fs.cpio.gz && rm -rf fs
    1.36  	echo -n "Creating full cpio archive... "
    1.37  	find . -print | cpio -o -H newc > $PACKAGES_REPOSITORY/$PACKAGE-$VERSION.tazpkg
    1.38  	# Restore package tree in case we want to browse it.
    1.39  	echo -n "Restoring original package tree... "
    1.40 -	gzip -d fs.cpio.gz && cpio -id < fs.cpio
    1.41 -	rm fs.cpio && cd ..
    1.42 +	zcat fs.cpio.gz | cpio -id && cd ..
    1.43  	# Log process.
    1.44  	echo "$PACKAGE-$VERSION.tazpkg (done)" >> $LOG
    1.45  	echo "================================================================================"