cookutils diff cook @ rev 1010

Major release. cook: fix remove_already_packed(), now it works inside the set; package cooking stops if cookit() return non-zero return code while processing compile_rules() from receipt; lighttpd/index.cgi: 'files' page reworked, now it knows about the sets; finally fixed bug when out-of-tree files (such as pulled into $fs NOT from $install) mistakenly displayed as "unpackaged".
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Nov 22 19:51:01 2017 +0200 (2017-11-22)
parents 845d62611d92
children 51460e8c74d7
line diff
     1.1 --- a/cook	Sat Nov 18 16:38:50 2017 +0200
     1.2 +++ b/cook	Wed Nov 22 19:51:01 2017 +0200
     1.3 @@ -992,9 +992,8 @@
     1.4  	find . | cpio -o -H newc --quiet > ../$PACKAGE-$VERSION$EXTRAVERSION$arch.tazpkg
     1.5  	status
     1.6  
     1.7 -#	action 'Restoring original package tree...'
     1.8 +	# Restoring original package tree.
     1.9  	mv ../fs .
    1.10 -#	status
    1.11  
    1.12  	rm fs.cpio.lzma; cd ..
    1.13  
    1.14 @@ -1346,11 +1345,24 @@
    1.15  
    1.16  # Remove from current $fs files that are already packed (for receipts v2).
    1.17  # Note: the order in $SPLIT is very important.
    1.18 +# Note 2: working in the current set.
    1.19  
    1.20  remove_already_packed() {
    1.21  	local i j
    1.22 +	neighbors=$(
    1.23 +		echo $SPLIT" " \
    1.24 +		| awk -F$'\t' -vpkg="$PACKAGE" '
    1.25 +		BEGIN { RS = " "; FS = ":"; }
    1.26 +		      { set[$1] = $2; }
    1.27 +		END   {
    1.28 +		        current_set = set[pkg];
    1.29 +		        for (i in set)
    1.30 +		          { if (i != pkg && set[i] == current_set) print i; }
    1.31 +		}
    1.32 +	')
    1.33  	IFS=$'\n'
    1.34 -	for i in $taz/*/files.list; do
    1.35 +	for neighbor in $neighbors; do
    1.36 +		i="$taz/$neighbor-$VERSION$EXTRAVERSION/files.list"
    1.37  		[ -e "$i" ] || continue
    1.38  		while read j; do
    1.39  			[ -f $fs$j -o -h $fs$j ] || continue
    1.40 @@ -2030,10 +2042,24 @@
    1.41  		done
    1.42  
    1.43  		# Cook and pack or exit on error and log everything.
    1.44 -		cookit $@ 2>&1 | loglimit 50 > $LOGS/$pkg.log
    1.45 +		((((cookit $@ 2>&1; echo $? >&3) | loglimit 50 > $LOGS/$pkg.log) 3>&1) | (read rq; exit $rq))
    1.46 +		rq=$?	# the return code of `cookit $@` above command
    1.47 +
    1.48 +		# Remove build dependencies both when `cookit` done or fail
    1.49  		remove_deps | tee -a $LOGS/$pkg.log
    1.50  		cookit_quality
    1.51 +
    1.52 +		# Log and stop if `cookit` fails
    1.53 +		if [ $rq -eq 1 ]; then
    1.54 +			debug_info | tee -a $LOGS/$pkg.log
    1.55 +			put_status $pkg Failed
    1.56 +			rm -f $command
    1.57 +			broken; exit 1
    1.58 +		fi
    1.59 +
    1.60 +		# Proceed only if `cookit` return code is zero-OK
    1.61  		packall 2>&1 | loglimit 5 >> $LOGS/$pkg.log
    1.62 +
    1.63  		clean_log
    1.64  
    1.65  		# Exit if any error in packing.