cookutils rev 43

cook: allow empty packages for CATEGORY meta
author Christophe Lincoln <pankso@slitaz.org>
date Sat May 07 02:56:03 2011 +0200 (2011-05-07)
parents 49f9b134c2a9
children 969f0ec4eeac
files cook
line diff
     1.1 --- a/cook	Sat May 07 02:22:37 2011 +0200
     1.2 +++ b/cook	Sat May 07 02:56:03 2011 +0200
     1.3 @@ -412,7 +412,7 @@
     1.4  # but it dont handle EXTRAVERSION.
     1.5  packit() {
     1.6  	set_paths
     1.7 -	echo "Packing: $PACKAGE $VERSION"
     1.8 +	echo "Pack: $PACKAGE $VERSION"
     1.9  	separator
    1.10  	if grep -q ^genpkg_rules $pkgdir/receipt; then
    1.11  		gettext -e "Executing: genpkg_rules\n"
    1.12 @@ -420,16 +420,13 @@
    1.13  		mkdir -p $fs && genpkg_rules || (echo -e \
    1.14  			"\nERROR: genpkg_rules failed\n" >> $LOGS/$pkg.log && exit 1)
    1.15  	fi
    1.16 -	packit_quality
    1.17  	cd $pkgdir/taz
    1.18 -	strip_package
    1.19  	for file in receipt description.txt
    1.20  	do
    1.21  		[ ! -f "../$file" ] && continue
    1.22  		gettext "Copying"; echo -n " $file..."
    1.23  		cp -f ../$file $pack && chown 0.0 $pack/$file && status
    1.24  	done
    1.25 -	copy_generic_files
    1.26  	
    1.27  	# Create files.list with redirecting find outpout.
    1.28  	gettext "Creating the list of files..." && cd $fs
    1.29 @@ -437,6 +434,13 @@
    1.30  	find . -type l -print >> ../files.list
    1.31  	cd .. && sed -i s/'^.'/''/ files.list
    1.32  	status
    1.33 +
    1.34 +	# QA, strip and stuff files.
    1.35 +	
    1.36 +	strip_package
    1.37 +	copy_generic_files
    1.38 +
    1.39 +	# Md5sum of files.
    1.40  	gettext "Creating md5sum of files..."
    1.41  	while read file; do
    1.42  		[ -L "fs$file" ] && continue
    1.43 @@ -482,9 +486,11 @@
    1.44  	unlzma -c fs.cpio.lzma | cpio -idm --quiet
    1.45  	status
    1.46  	rm fs.cpio.lzma && cd ..
    1.47 -	separator && gettext "Package: "
    1.48 -	du -sh $PACKAGE-${VERSION}${EXTRAVERSION}.tazpkg
    1.49 -	echo ""
    1.50 +
    1.51 +	# QA and give info.
    1.52 +	tazpkg=$(ls *.tazpkg)
    1.53 +	packit_quality
    1.54 +	separator && gettext "Package:"; echo -e " $tazpkg\n"
    1.55  }
    1.56  
    1.57  # Verify package quality and consitensy.
    1.58 @@ -492,8 +498,9 @@
    1.59  	if fgrep -q ERROR: $LOGS/$pkg.log; then
    1.60  		rm -f $command && exit 1
    1.61  	fi
    1.62 -	if ! grep -q ^/ $WOK/$pkg/taz/$pkg-*/files.list; then
    1.63 -		echo -e "ERROR: empty package\n" | tee -a $LOGS/$pkg.log
    1.64 +	files=$(grep -q ^/ $pkgdir/taz/$pkg-*/files.list)
    1.65 +	if [ ! "$files" ] && [ "$CATEGORY" != "meta" ]; then
    1.66 +		echo -e "ERROR: empty package"
    1.67  		rm -f $command && exit 1
    1.68  	else
    1.69  		mv -f $WOK/$pkg/taz/$pkg-*.tazpkg $PKGS