cookutils diff modules/pack @ rev 1135

Small improvements and fixes:
1. cook: summary(): skip unpackaged packages (when use CATEGORY="nopack");
2. modules/compressor:
a) move strip_package from "fs" to "install" stage - from this moment files in $install and $fs are identical (of course, if you use genpkg_rules() only for copying) - we may clean taz/*/fs/ in the future;
b) remove "empty" *.mo;
c) skip silly error messages when $install or $fs absent;
3. modules/pack:
a) move symlinks *.so to the @dev;
b) small improvements;
4. doc/cookopts.txt: small update;
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Jan 29 14:12:35 2019 +0200 (2019-01-29)
parents 0385051c3996
children 4f2ea8b43594
line diff
     1.1 --- a/modules/pack	Fri Jan 11 15:14:53 2019 +0200
     1.2 +++ b/modules/pack	Tue Jan 29 14:12:35 2019 +0200
     1.3 @@ -65,8 +65,9 @@
     1.4  
     1.5  remove_already_packed() {
     1.6  	local i j
     1.7 -	# $pkg is the name of the main package; $PACKAGE is the name of the current one
     1.8 -	# $pkg may (or may not) be included in the $SPLIT
     1.9 +	# $basepkg is the name of the main package;
    1.10 +	# $thispkg is the name of the current one.
    1.11 +	# $basepkg may (or may not) be included in the $SPLIT
    1.12  	neighbors=$(
    1.13  		echo $basepkg $SPLIT" " \
    1.14  		| awk -F$'\t' -vpkg="$thispkg" '
    1.15 @@ -115,12 +116,23 @@
    1.16  
    1.17  copy() {
    1.18  	action 'Copying folders and files...'
    1.19 -	local i j k filelist=$(mktemp) folderlist=$(mktemp)
    1.20 +	if [ ! -d "$install" ]; then
    1.21 +		false; status
    1.22 +		die 'ERROR: copy from the empty $install'
    1.23 +	fi
    1.24 +
    1.25 +	local i j k
    1.26 +	local tmp=$(mktemp -d) filelist=$tmp/f folderlist=$tmp/d solist=$tmp/s
    1.27 +	local copylist=$tmp/c
    1.28  
    1.29  	IFS=$'\n'
    1.30  	cd $install
    1.31 -	find ! -type d | sed 's|\.||' > $filelist
    1.32 -	find   -type d | sed 's|\.||' > $folderlist
    1.33 +	# filelist: all files and symlinks excluding *.so symlinks
    1.34 +	find \( -type f -o \( -type l ! -name '*.so' \) \) | sed 's|\.||' >$filelist
    1.35 +	# solist: *.so symlinks only
    1.36 +	find -type l -name '*.so' | sed 's|\.||' >$solist
    1.37 +	# folderlist: folders
    1.38 +	find -type d | sed 's|\.||' >$folderlist
    1.39  
    1.40  	for i in $@; do
    1.41  		case $i in
    1.42 @@ -149,6 +161,7 @@
    1.43  					/\/Makefile.*/p; /\.inc$/p; /\/include\//p;
    1.44  					/\.so\.dbg$/p;
    1.45  					' $filelist
    1.46 +				cat $solist # append copy list by *.so symlinks
    1.47  				;;
    1.48  			@ruby)
    1.49  				# Copy mandatory Ruby files
    1.50 @@ -195,8 +208,8 @@
    1.51  			@std)
    1.52  				while read j; do
    1.53  					case $j in
    1.54 -						# skip empty man & doc folders
    1.55 -						*/man/*|*/doc/*) continue;;
    1.56 +						# skip empty man, doc and locale folders
    1.57 +						*/man/*|*/doc/*|*/share/locale/*) continue;;
    1.58  					esac
    1.59  					[ -z "$(ls -A "$install$j")" ] || continue
    1.60  					# directory $j is empty
    1.61 @@ -227,7 +240,7 @@
    1.62  	done
    1.63  	cd - >/dev/null
    1.64  	unset IFS
    1.65 -	rm $filelist $folderlist
    1.66 +	rm -r $tmp # clean
    1.67  	status
    1.68  }
    1.69