cookutils rev 969

cook: allow empty packages.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Sep 18 20:08:03 2017 +0300 (2017-09-18)
parents 4eb836a25786
children 68c17954b51b
files cook doc/cookopts.txt
line diff
     1.1 --- a/cook	Fri Sep 08 15:42:26 2017 +0300
     1.2 +++ b/cook	Mon Sep 18 20:08:03 2017 +0300
     1.3 @@ -1006,7 +1006,8 @@
     1.4  	# Build cpio archive.
     1.5  	action 'Compressing the FS...'
     1.6  	find fs -newer $receipt -exec touch -hr $receipt '{}' \;
     1.7 -	find fs | cpio -o -H newc --quiet | lzma e fs.cpio.lzma -si
     1.8 +	find fs | cpio -o -H newc --quiet | lzma-alone e fs.cpio.lzma -si
     1.9 +#	find fs | cpio -o -H newc --quiet | /bin/lzma -zeT0 -vv >fs.cpio.lzma
    1.10  	mv fs ../
    1.11  	status
    1.12  
    1.13 @@ -1032,9 +1033,9 @@
    1.14  	find . | cpio -o -H newc --quiet > ../$PACKAGE-$VERSION$EXTRAVERSION$arch.tazpkg
    1.15  	status
    1.16  
    1.17 -	action 'Restoring original package tree...'
    1.18 +#	action 'Restoring original package tree...'
    1.19  	mv ../fs .
    1.20 -	status
    1.21 +#	status
    1.22  
    1.23  	rm fs.cpio.lzma; cd ..
    1.24  
    1.25 @@ -1081,21 +1082,25 @@
    1.26  	#[ "$link" ] && echo -e "\nERROR: broken link in filesystem"
    1.27  	#status
    1.28  
    1.29 -	# Exit if any error found in log file.
    1.30 -	lerror=$(_n 'ERROR')
    1.31 -	if fgrep -q ^$lerror $LOGS/$pkg.log; then
    1.32 -		rm -f $command
    1.33 -		broken; exit 1
    1.34 +	if [ "${COOKOPTS/skip-log-errors/}" == "$COOKOPTS" ]; then
    1.35 +		# Exit if any error found in log file.
    1.36 +		if fgrep -q ^ERROR $LOGS/$pkg.log; then
    1.37 +			rm -f $command
    1.38 +			broken; exit 1
    1.39 +		fi
    1.40  	fi
    1.41  
    1.42 -	action 'QA: checking for empty package...'
    1.43 -	if [ ! -s "$pack/files.list" -a "$CATEGORY" != 'meta' ]; then
    1.44 -		broken
    1.45 -		rm -f $command
    1.46 -		die 'ERROR: empty package'
    1.47 +	if [ "${COOKOPTS/empty-pkg/}" == "$COOKOPTS" ]; then
    1.48 +		action 'QA: checking for empty package...'
    1.49 +		if [ ! -s "$pack/files.list" -a "$CATEGORY" != 'meta' ]; then
    1.50 +			broken
    1.51 +			rm -f $command
    1.52 +			false; status
    1.53 +			die 'ERROR: empty package'
    1.54 +		fi
    1.55 +		:; status
    1.56  	fi
    1.57  
    1.58 -	:; status
    1.59  
    1.60  	# Find and remove old package(s) only if "release checksum" has changed
    1.61  	rsum=$(release_checksum $pack)
     2.1 --- a/doc/cookopts.txt	Fri Sep 08 15:42:26 2017 +0300
     2.2 +++ b/doc/cookopts.txt	Mon Sep 18 20:08:03 2017 +0300
     2.3 @@ -154,3 +154,8 @@
     2.4      g_simple_async_result_set_error (simple, G_IO_ERROR, G_IO_ERROR_FAILED
     2.5      The presence of this option overrides the default behaviour (word "ERROR" in
     2.6      the log will not produce errors, etc.)
     2.7 +
     2.8 +empty-pkg
     2.9 +    Default behaviour is to end work with error message when package contains no
    2.10 +    files (exception is made for packages belongs to the "meta" category).
    2.11 +    Presence of this option allows the package not to contain files.