cookutils rev 1024

cook, lighttpd/index.cgi, modules/compressor, modules/mk_pkg_receipt, modules/pkgdb: patch for the x86_64 native architecture support, fix empty depends, etc.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Jan 24 12:14:38 2018 +0200 (2018-01-24)
parents 713fecc03454
children 6943f5f9845a
files cook lighttpd/index.cgi modules/compressor modules/mk_pkg_receipt modules/pkgdb
line diff
     1.1 --- a/cook	Sun Jan 14 17:12:15 2018 +0200
     1.2 +++ b/cook	Wed Jan 24 12:14:38 2018 +0200
     1.3 @@ -303,14 +303,18 @@
     1.4  # Display cooked package summary.
     1.5  
     1.6  summary() {
     1.7 +	local arch=''
     1.8 +	case "$ARCH" in
     1.9 +		arm*|x86_64) arch="-$ARCH" ;;
    1.10 +	esac
    1.11 +
    1.12  	set_paths
    1.13  	cd $WOK/$pkg
    1.14  	[ -d $WOK/$pkg/install ] && prod=$(du -sh $WOK/$pkg/install | awk '{print $1}' 2>/dev/null)
    1.15  	[ -d $WOK/$pkg/source ] && srcdir=$(du -sh $WOK/$pkg/source | awk '{print $1}' 2>/dev/null)
    1.16  	[ -n "$TARBALL" ] && srcsize=$(du -sh $SRC/$TARBALL | awk '{print $1}')
    1.17  
    1.18 -	_ 'Summary for: %s' "$PACKAGE $VERSION$EXTRAVERSION"
    1.19 -	separator
    1.20 +	title 'Summary for: %s' "$PACKAGE $VERSION$EXTRAVERSION$arch"
    1.21  
    1.22  	# L10n: keep the same width of translations to get a consistent view
    1.23  	[ -n "$TARBALL" ] && _ 'Src file    : %s' "$TARBALL"
    1.24 @@ -319,7 +323,7 @@
    1.25  	[ -n "$prod" ]    && _ 'Produced    : %s' "$prod"
    1.26  	_ 'Cook time   : %s' "$(disp_time "$time")"
    1.27  	_ 'Cook date   : %s' "$(date "$(_ '+%%F %%R')")"
    1.28 -	_ 'Host arch   : %s' "$ARCH"
    1.29 +	_ 'Target arch : %s' "$ARCH"
    1.30  
    1.31  	separator -
    1.32  	_ ' # :  Packed : Compressed : Files : Package name'
    1.33 @@ -327,7 +331,7 @@
    1.34  	pkgi=1
    1.35  	for i in $(all_names); do
    1.36  		fs=$(du -sh $WOK/$pkg/taz/$i-$VERSION$EXTRAVERSION | awk '{print $1}')
    1.37 -		pkgname="$i-$VERSION$EXTRAVERSION.tazpkg"
    1.38 +		pkgname="$i-$VERSION$EXTRAVERSION$arch.tazpkg"
    1.39  		size=$(ls -lh $PKGS/$pkgname | awk '{print $5}')
    1.40  		files=$(wc -l < $WOK/$pkg/taz/$i-$VERSION$EXTRAVERSION/files.list)
    1.41  		printf "%2d : %7s : %10s : %5s : %s\n" "$pkgi" "$fs" "$size" "$files" "$pkgname"
    1.42 @@ -559,6 +563,7 @@
    1.43  	set_paths
    1.44  
    1.45  	# Handle cross-tools.
    1.46 +	[ "$BUILD_SYSTEM" != "$HOST_SYSTEM" ] &&
    1.47  	case "$ARCH" in
    1.48  		arm*|x86_64)
    1.49  			# CROSS_COMPILE is used by at least Busybox and the kernel to set
    1.50 @@ -965,8 +970,8 @@
    1.51  	# Build cpio archive.
    1.52  	action 'Compressing the FS...'
    1.53  	find fs -newer $receipt -exec touch -hr $receipt '{}' \;
    1.54 -	find fs | cpio -o -H newc --quiet | lzma-alone e fs.cpio.lzma -si
    1.55 -#	find fs | cpio -o -H newc --quiet | /bin/lzma -zeT0 -vv >fs.cpio.lzma
    1.56 +#	find fs | cpio -o -H newc --quiet | lzma-alone e fs.cpio.lzma -si
    1.57 +	find fs | cpio -o -H newc --quiet | /bin/lzma -qzeT0 >fs.cpio.lzma
    1.58  	mv fs ../
    1.59  	status
    1.60  
    1.61 @@ -1007,9 +1012,14 @@
    1.62  # Verify package quality and consistency.
    1.63  
    1.64  packit_quality() {
    1.65 +	local arch=''
    1.66 +	case "$ARCH" in
    1.67 +		arm*|x86_64) arch="-$ARCH" ;;
    1.68 +	esac
    1.69 +
    1.70  	local rsum rsumold='' rsum_changed old_file
    1.71  	local pi="$PKGS/packages.info" fl="$cache/files.list"
    1.72 -	local pkg_file="$PKGS/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg"
    1.73 +	local pkg_file="$PKGS/$PACKAGE-$VERSION$EXTRAVERSION$arch.tazpkg"
    1.74  	local rsum_file=$(mktemp) rsum_file_old=$(mktemp) tmpdir=$(mktemp -d)
    1.75  
    1.76  
    1.77 @@ -1083,11 +1093,11 @@
    1.78  			status
    1.79  		fi
    1.80  		# package changed, substitute old package by new one
    1.81 -		mv -f $pkgdir/taz/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg $PKGS
    1.82 +		mv -f $pkgdir/taz/$PACKAGE-$VERSION$EXTRAVERSION$arch.tazpkg $PKGS
    1.83  		_ 'The release checksum has changed.'
    1.84  	else
    1.85  		# package not changed, remove new package
    1.86 -		rm -f $pkgdir/taz/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg
    1.87 +		rm -f $pkgdir/taz/$PACKAGE-$VERSION$EXTRAVERSION$arch.tazpkg
    1.88  		_ 'The release checksum has not changed.'
    1.89  	fi
    1.90  
    1.91 @@ -1951,7 +1961,7 @@
    1.92  		esac
    1.93  
    1.94  		# Some packages are not included in some arch or fail to cross compile.
    1.95 -		: ${HOST_ARCH=i486}
    1.96 +		: ${HOST_ARCH=$ARCH}
    1.97  		debug "$(_ 'Host arch %s' "$HOST_ARCH")"
    1.98  		# Handle arm{v6hf,v7,..}
    1.99  		if ! $(echo "$HOST_ARCH" | egrep -q "${ARCH%v[0-9]*}|any"); then
     2.1 --- a/lighttpd/index.cgi	Sun Jan 14 17:12:15 2018 +0200
     2.2 +++ b/lighttpd/index.cgi	Wed Jan 24 12:14:38 2018 +0200
     2.3 @@ -924,8 +924,8 @@
     2.4  <tr><td>Build date</td>		<td colspan="2">$(sed -n '/^Cook date/s|[^:]*: \(.*\)|\1|p' $LOGS/slitaz-toolchain.log)</td></tr>
     2.5  <tr><td>Build duration</td>	<td colspan="2">$(sed -n '/^Cook time/s|[^:]*: \(.*\)|\1|p' $LOGS/slitaz-toolchain.log)</td></tr>
     2.6  <tr><td>Architecture</td>	<td colspan="2">$ARCH</td></tr>
     2.7 -<tr><td>Build system</td>	<td colspan="2">$BUILD_SYSTEM</td></tr>
     2.8 -<tr><td>Host system</td>	<td colspan="2">$HOST_SYSTEM</td></tr>
     2.9 +<tr><td>Host system</td>	<td colspan="2">$BUILD_SYSTEM</td></tr>
    2.10 +<tr><td>Target system</td>	<td colspan="2">$HOST_SYSTEM</td></tr>
    2.11  <tr><th>Package</th><th>Version</th><th>Description</th></tr>
    2.12  $(toolchain_version slitaz-toolchain)
    2.13  $(toolchain_version binutils)
     3.1 --- a/modules/compressor	Sun Jan 14 17:12:15 2018 +0200
     3.2 +++ b/modules/compressor	Wed Jan 24 12:14:38 2018 +0200
     3.3 @@ -68,7 +68,7 @@
     3.4  		"$(calc_time $1)" "$2" "$3" "$saving" "$cache_msg"
     3.5  
     3.6  	if [ -s "$4" ]; then
     3.7 -		_ 'Cleaner warnings and errors:'
     3.8 +		_ 'Compressor warnings and errors:'
     3.9  		awk '{printf "  %s\n", $0;}' "$4"
    3.10  		echo
    3.11  	fi
    3.12 @@ -184,23 +184,27 @@
    3.13  	done
    3.14  
    3.15  	# Recompress with advdef (it can't compress, only recompress)
    3.16 -	cleaner_log="$(mktemp)"
    3.17 -	IFS=$'\n'
    3.18 -	for i in $(find $manpath -type f); do
    3.19 -		if ! cached_path=$(query_cache mangz "$i"); then
    3.20 -			cp -a "$i" "$i.orig$$"		# save the original if something goes wrong
    3.21 -			out="$(advdef -z4q "$i")"
    3.22 -			if [ -n "$out" ]; then
    3.23 -				echo "$i:"$'\n'"$out"$'\n' >> "$cleaner_log"
    3.24 -				mv -f "$i.orig$$" "$i"	# restore the original
    3.25 -			else
    3.26 -				store_cache "$cached_path" "$i"
    3.27 -				rm -f "$i.orig$$"		# clean
    3.28 +	the_log="$(mktemp)"
    3.29 +	if which advdef >/dev/null; then
    3.30 +		IFS=$'\n'
    3.31 +		for i in $(find $manpath -type f); do
    3.32 +			if ! cached_path=$(query_cache mangz "$i"); then
    3.33 +				cp -a "$i" "$i.orig$$"		# save the original if something goes wrong
    3.34 +				out="$(advdef -z4q "$i")"
    3.35 +				if [ -n "$out" ]; then
    3.36 +					echo "$i:"$'\n'"$out"$'\n' >> "$the_log"
    3.37 +					mv -f "$i.orig$$" "$i"	# restore the original
    3.38 +				else
    3.39 +					store_cache "$cached_path" "$i"
    3.40 +					rm -f "$i.orig$$"		# clean
    3.41 +				fi
    3.42  			fi
    3.43 -		fi
    3.44 -	done
    3.45 +		done
    3.46 +	else
    3.47 +		echo 'Warning: advdef not found.' > "$the_log"
    3.48 +	fi
    3.49  
    3.50 -	comp_summary "$time0" "$size0" "$(sizes man)" "$cleaner_log"
    3.51 +	comp_summary "$time0" "$size0" "$(sizes man)" "$the_log"
    3.52  }
    3.53  
    3.54  
    3.55 @@ -217,23 +221,27 @@
    3.56  	action 'Recompressing gzip files...'
    3.57  
    3.58  	# Recompress with advdef
    3.59 -	cleaner_log="$(mktemp)"
    3.60 -	IFS=$'\n'
    3.61 -	for i in $(find $install -type f -name '*.gz' ! -path '*/share/man/*'); do
    3.62 -		if ! cached_path=$(query_cache gz "$i"); then
    3.63 -			cp -a "$i" "$i.orig$$"		# save the original if something goes wrong
    3.64 -			out="$(advdef -z4q "$i")"
    3.65 -			if [ -n "$out" ]; then
    3.66 -				echo "$i:"$'\n'"$out"$'\n' >> "$cleaner_log"
    3.67 -				mv -f "$i.orig$$" "$i"	# restore the original
    3.68 -			else
    3.69 -				store_cache "$cached_path" "$i"
    3.70 -				rm -f "$i.orig$$"		# clean
    3.71 +	the_log="$(mktemp)"
    3.72 +	if which advdef >/dev/null; then
    3.73 +		IFS=$'\n'
    3.74 +		for i in $(find $install -type f -name '*.gz' ! -path '*/share/man/*'); do
    3.75 +			if ! cached_path=$(query_cache gz "$i"); then
    3.76 +				cp -a "$i" "$i.orig$$"		# save the original if something goes wrong
    3.77 +				out="$(advdef -z4q "$i")"
    3.78 +				if [ -n "$out" ]; then
    3.79 +					echo "$i:"$'\n'"$out"$'\n' >> "$the_log"
    3.80 +					mv -f "$i.orig$$" "$i"	# restore the original
    3.81 +				else
    3.82 +					store_cache "$cached_path" "$i"
    3.83 +					rm -f "$i.orig$$"		# clean
    3.84 +				fi
    3.85  			fi
    3.86 -		fi
    3.87 -	done
    3.88 +		done
    3.89 +	else
    3.90 +		echo 'Warning: advdef not found.' > "$the_log"
    3.91 +	fi
    3.92  
    3.93 -	comp_summary "$time0" "$size0" "$(sizes gz)" "$cleaner_log"
    3.94 +	comp_summary "$time0" "$size0" "$(sizes gz)" "$the_log"
    3.95  }
    3.96  
    3.97  
    3.98 @@ -250,23 +258,27 @@
    3.99  	action 'Recompressing zip files...'
   3.100  
   3.101  	# Recompress with advzip
   3.102 -	cleaner_log="$(mktemp)"
   3.103 -	IFS=$'\n'
   3.104 -	for i in $(find $install -type f -name '*.zip'); do
   3.105 -		if ! cached_path=$(query_cache zip "$i"); then
   3.106 -			cp -a "$i" "$i.orig$$"		# save the original if something goes wrong
   3.107 -			out="$(advzip -z3qk "$i")"	# '-4' is more than two orders slower; use '-3'
   3.108 -			if [ -n "$out" ]; then
   3.109 -				echo "$i:"$'\n'"$out"$'\n' >> "$cleaner_log"
   3.110 -				mv -f "$i.orig$$" "$i"	# restore the original
   3.111 -			else
   3.112 -				store_cache "$cached_path" "$i"
   3.113 -				rm -f "$i.orig$$"		# clean
   3.114 +	the_log="$(mktemp)"
   3.115 +	if which advzip >/dev/null; then
   3.116 +		IFS=$'\n'
   3.117 +		for i in $(find $install -type f -name '*.zip'); do
   3.118 +			if ! cached_path=$(query_cache zip "$i"); then
   3.119 +				cp -a "$i" "$i.orig$$"		# save the original if something goes wrong
   3.120 +				out="$(advzip -z3qk "$i")"	# '-4' is more than two orders slower; use '-3'
   3.121 +				if [ -n "$out" ]; then
   3.122 +					echo "$i:"$'\n'"$out"$'\n' >> "$the_log"
   3.123 +					mv -f "$i.orig$$" "$i"	# restore the original
   3.124 +				else
   3.125 +					store_cache "$cached_path" "$i"
   3.126 +					rm -f "$i.orig$$"		# clean
   3.127 +				fi
   3.128  			fi
   3.129 -		fi
   3.130 -	done
   3.131 +		done
   3.132 +	else
   3.133 +		echo 'Warning: advzip not found.' > "$the_log"
   3.134 +	fi
   3.135  
   3.136 -	comp_summary "$time0" "$size0" "$(sizes zip)" "$cleaner_log"
   3.137 +	comp_summary "$time0" "$size0" "$(sizes zip)" "$the_log"
   3.138  }
   3.139  
   3.140  
   3.141 @@ -287,6 +299,16 @@
   3.142  
   3.143  	action 'Compressing png images...'
   3.144  
   3.145 +	the_log="$(mktemp)"
   3.146 +	$use_pq && if ! which pngquant >/dev/null; then
   3.147 +		echo 'Warning: pngquant not found.' > "$the_log"
   3.148 +		use_pq=false
   3.149 +	fi
   3.150 +	$use_op && if ! which optipng >/dev/null; then
   3.151 +		echo 'Warning: optipng not found.' >> "$the_log"
   3.152 +		use_op=false
   3.153 +	fi
   3.154 +
   3.155  	oplevel=$(echo $COOKOPTS | grep 'op[0-8]' | sed 's|.*op\([0-8]\).*|\1|')
   3.156  	[ -z "$oplevel" ] && oplevel='2'
   3.157  
   3.158 @@ -296,7 +318,6 @@
   3.159  
   3.160  	[ "$oplevel" == '8' ] && oplevel='7 -zm1-9'
   3.161  
   3.162 -	cleaner_log="$(mktemp)"
   3.163  	pq_opt='--skip-if-larger' # Sublime Text is mad about `if` in $(), so put it separately
   3.164  	IFS=$'\n'
   3.165  	for i in $(find $install -type f -name '*.png'); do
   3.166 @@ -306,14 +327,14 @@
   3.167  			if $use_pq; then
   3.168  				out="$(pngquant -f $pq_opt --ext .png --speed 1 "$i" 2>&1)"
   3.169  				if [ -n "$out" ]; then
   3.170 -					echo "$i (pngquant):"$'\n'"$out"$'\n' >> "$cleaner_log"
   3.171 +					echo "$i (pngquant):"$'\n'"$out"$'\n' >> "$the_log"
   3.172  					iserror='yes'
   3.173  				fi
   3.174  			fi
   3.175  			if $use_op && [ -z "$iserror" ]; then
   3.176  				out="$(optipng -quiet -strip all -o$oplevel "$i" 2>&1)"
   3.177  				if [ -n "$out" ]; then
   3.178 -					echo "$i (optipng):"$'\n'"$out"$'\n' >> "$cleaner_log"
   3.179 +					echo "$i (optipng):"$'\n'"$out"$'\n' >> "$the_log"
   3.180  					iserror='yes'
   3.181  				fi
   3.182  			fi
   3.183 @@ -326,7 +347,7 @@
   3.184  		fi
   3.185  	done
   3.186  
   3.187 -	comp_summary "$time0" "$size0" "$(sizes png)" "$cleaner_log"
   3.188 +	comp_summary "$time0" "$size0" "$(sizes png)" "$the_log"
   3.189  }
   3.190  
   3.191  
   3.192 @@ -342,17 +363,21 @@
   3.193  
   3.194  	action 'Compressing svg images...'
   3.195  
   3.196 -	[ "${COOKOPTS/!svgextra/}" == "$COOKOPTS" ] &&
   3.197 -	opts="--apply-transform-to-paths yes --coordinates-precision 1 --paths-coordinates-precision 1"
   3.198 +	if which svgcleaner >/dev/null; then
   3.199 +		[ "${COOKOPTS/!svgextra/}" == "$COOKOPTS" ] &&
   3.200 +		opts="--apply-transform-to-paths yes --coordinates-precision 1 --paths-coordinates-precision 1"
   3.201  
   3.202 -	cleaner_log="$(mktemp)"
   3.203 -	for i in $(IFS=$'\n' find $install -type f -name '*.svg'); do
   3.204 -		out="$(unset IFS; svgcleaner "$i" "$i" --copy-on-error --quiet \
   3.205 -			--multipass --remove-unresolved-classes no $opts 2>&1)"
   3.206 -		[ -z "$out" ] || echo "$i:"$'\n'"$out"$'\n' >> "$cleaner_log"
   3.207 -	done
   3.208 +		the_log="$(mktemp)"
   3.209 +		for i in $(IFS=$'\n' find $install -type f -name '*.svg'); do
   3.210 +			out="$(unset IFS; svgcleaner "$i" "$i" --copy-on-error --quiet \
   3.211 +				--multipass --remove-unresolved-classes no $opts 2>&1)"
   3.212 +			[ -z "$out" ] || echo "$i:"$'\n'"$out"$'\n' >> "$the_log"
   3.213 +		done
   3.214 +	else
   3.215 +		echo 'Warning: svgcleaner not found.' > "$the_log"
   3.216 +	fi
   3.217  
   3.218 -	comp_summary "$time0" "$size0" "$(sizes svg)" "$cleaner_log"
   3.219 +	comp_summary "$time0" "$size0" "$(sizes svg)" "$the_log"
   3.220  }
   3.221  
   3.222  
   3.223 @@ -368,21 +393,25 @@
   3.224  
   3.225  	action 'Compressing ui files...'
   3.226  
   3.227 -	size0=$(sizes xml)
   3.228 -	time0=$(get_time)
   3.229 -	temp_ui="$(mktemp)"
   3.230 -	cleaner_log="$(mktemp)"
   3.231 -	IFS=$'\n'
   3.232 -	for ui in $(find $install -type f \( -name '*.ui' -o -name '*.glade' \) ); do
   3.233 -		out="$(xmlstarlet c14n --without-comments "$ui" | xmlstarlet sel -B -t -c '*' > "$temp_ui")"
   3.234 -		if [ -n "$out" ]; then
   3.235 -			echo "$ui:"$'\n'"$out"$'\n' >> "$cleaner_log"
   3.236 -		else
   3.237 -			cat "$temp_ui" > "$ui"
   3.238 -		fi
   3.239 -	done
   3.240 +	if which xmlstarlet >/dev/null; then
   3.241 +		size0=$(sizes xml)
   3.242 +		time0=$(get_time)
   3.243 +		temp_ui="$(mktemp)"
   3.244 +		the_log="$(mktemp)"
   3.245 +		IFS=$'\n'
   3.246 +		for ui in $(find $install -type f \( -name '*.ui' -o -name '*.glade' \) ); do
   3.247 +			out="$(xmlstarlet c14n --without-comments "$ui" | xmlstarlet sel -B -t -c '*' > "$temp_ui")"
   3.248 +			if [ -n "$out" ]; then
   3.249 +				echo "$ui:"$'\n'"$out"$'\n' >> "$the_log"
   3.250 +			else
   3.251 +				cat "$temp_ui" > "$ui"
   3.252 +			fi
   3.253 +		done
   3.254 +	else
   3.255 +		echo 'Warning: xmlstarlet not found.' > "$the_log"
   3.256 +	fi
   3.257  
   3.258 -	comp_summary "$time0" "$size0" "$(sizes xml)" "$cleaner_log"
   3.259 +	comp_summary "$time0" "$size0" "$(sizes xml)" "$the_log"
   3.260  	rm "$temp_ui"
   3.261  }
   3.262  
   3.263 @@ -454,7 +483,11 @@
   3.264  			# Check the rest of errors, warnings and tips
   3.265  			_ 'QA: Checking %s...' "$(basename $desktop)"
   3.266  			busybox diff "$desktop.orig" "$desktop" | sed 's!^!|!'
   3.267 -			desktop-file-validate "$desktop" | busybox fold -s
   3.268 +			if which xmlstarlet >/dev/null; then
   3.269 +				desktop-file-validate "$desktop" | busybox fold -s
   3.270 +			else
   3.271 +				echo 'Warning: desktop-file-validate not found.'
   3.272 +			fi
   3.273  			echo
   3.274  		fi
   3.275  
   3.276 @@ -480,12 +513,21 @@
   3.277  
   3.278  	action 'Normalizing mo files...'
   3.279  
   3.280 +	the_log="$(mktemp)"
   3.281 +	to_continue=true
   3.282 +	for i in msgunfmt msguniq msgconv msgfmt; do
   3.283 +		if ! which $i >/dev/null; then
   3.284 +			echo "Warning: $i not found. Normalizing aborted" > "$the_log"
   3.285 +			to_continue=false
   3.286 +		fi
   3.287 +	done
   3.288 +
   3.289  	size0=$(sizes mo1)
   3.290  	time0=$(get_time)
   3.291  
   3.292  	# Process all existing *.mo files
   3.293 -	cleaner_log="$(mktemp)"
   3.294  	IFS=$'\n'
   3.295 +	$to_continue &&
   3.296  	for mo in $(find "$install" -type f -name '*.mo'); do
   3.297  		tmpfile="$(mktemp)"
   3.298  
   3.299 @@ -494,7 +536,7 @@
   3.300  		if [ -n "$out" ]; then
   3.301  			# using literal $'\n' here instead of using `echo -e "...\n..."` because
   3.302  			# $out may contain escapes ('\r', '\v') that we should print as-is
   3.303 -			echo "$mo:"$'\n'"$out"$'\n' >> "$cleaner_log"
   3.304 +			echo "$mo:"$'\n'"$out"$'\n' >> "$the_log"
   3.305  			continue # proceed to next file
   3.306  		fi
   3.307  
   3.308 @@ -588,15 +630,15 @@
   3.309  
   3.310  		out="$(msgfmt "$tmpfile.awk" -o "$tmpfile.mo" 2>&1)"
   3.311  		if [ -n "$out" ]; then
   3.312 -			echo "$mo (msgfmt):"$'\n'"$out"$'\n' >> "$cleaner_log"
   3.313 +			echo "$mo (msgfmt):"$'\n'"$out"$'\n' >> "$the_log"
   3.314  			continue # proceed to next file
   3.315  		fi
   3.316  
   3.317  		if [ -s "$tmpfile.mo" ]; then
   3.318  			rm "$mo"; mv "$tmpfile.mo" "$mo"
   3.319  		else
   3.320 -			_ 'Error processing %s' "$mo" >> "$cleaner_log"
   3.321 -			echo >> "$cleaner_log"
   3.322 +			_ 'Error processing %s' "$mo" >> "$the_log"
   3.323 +			echo >> "$the_log"
   3.324  			[ -e "$tmpfile.mo" ] && rm "$tmpfile.mo"
   3.325  		fi
   3.326  
   3.327 @@ -604,7 +646,7 @@
   3.328  		rm "$tmpfile" "$tmpfile.pf" "$tmpfile.awk"
   3.329  	done
   3.330  
   3.331 -	comp_summary "$time0" "$size0" "$(sizes mo1)" "$cleaner_log"
   3.332 +	comp_summary "$time0" "$size0" "$(sizes mo1)" "$the_log"
   3.333  }
   3.334  
   3.335  
   3.336 @@ -661,11 +703,12 @@
   3.337  
   3.338  	# Nullify timestamps of files in ar archives
   3.339  	# Skip empty 8-byte archives (hi, musl-libc package)
   3.340 +	# Using ar from binutils (ar from Busybox isn't enough) as ${TOOLPREFIX}ar
   3.341  	whereami=$(pwd)
   3.342  	find $fs -name '*.a' -type f -size +8c | \
   3.343  	while read i; do
   3.344  		tempdir=$(mktemp -d); cd $tempdir
   3.345 -		ar -x $i; ar -crD $(basename $i) *
   3.346 +		${TOOLPREFIX}ar -x $i; ${TOOLPREFIX}ar -crD $(basename $i) *
   3.347  		mv -f $tempdir/$(basename $i) $i
   3.348  		rm -rf $tempdir
   3.349  	done
     4.1 --- a/modules/mk_pkg_receipt	Sun Jan 14 17:12:15 2018 +0200
     4.2 +++ b/modules/mk_pkg_receipt	Wed Jan 24 12:14:38 2018 +0200
     4.3 @@ -12,6 +12,23 @@
     4.4  
     4.5  orig_receipt="$1"
     4.6  
     4.7 +# 1. Main package.
     4.8 +#    By default it has no dependencies.
     4.9 +#    You can write or omit DEPENDS="" for indicating package have no dependencies.
    4.10 +# 2. Split package (excluding *-dev).
    4.11 +#    By default every split package depends on the main package.
    4.12 +#    Unfortunately, in the shell script (receipt is the shell script too),
    4.13 +#    every undeclared variable has empty value, so there's no difference if you
    4.14 +#    wrote DEPENDS="" or omit it - result will be the same empty value.
    4.15 +#    If you want to define the split package has no dependencies - you need to
    4.16 +#    to put single space between the quotes: DEPENDS=" ".
    4.17 +# 3. Development split package.
    4.18 +#    Installing *-dev package should install all the files produced during
    4.19 +#    compilation and then were separated to the different packages, so
    4.20 +#    by default (if you wrote DEPENDS="" or omit it) *-dev package depends on
    4.21 +#    the main package and all the split packages (excluding the itself).
    4.22 +[ "$DEPENDS" == ' ' ] && DEPENDS='@EMPTY@'
    4.23 +
    4.24  # Receipt's signature is important, although some receipts may miss it
    4.25  signature=$(head -n1 "$orig_receipt")
    4.26  [ "${signature:0:1}" == '#' ] || signature='# SliTaz package receipt.'
    4.27 @@ -78,7 +95,10 @@
    4.28  
    4.29  # Optional variables
    4.30  [ -n "$TAGS"            ] && echo "TAGS=\"$TAGS\""                 | tr -ds '\t' ' '
    4.31 -[ -n "${DEPENDS# }"     ] && echo "DEPENDS=\"$DEPENDS\""           | tr -ds '\t' ' '
    4.32 +case "x$DEPENDS" in
    4.33 +	x|x@EMPTY@) ;;
    4.34 +	*)                       echo "DEPENDS=\"$DEPENDS\""           | tr -ds '\t' ' ';;
    4.35 +esac
    4.36  [ -n "$PROVIDE"         ] && echo "PROVIDE=\"$PROVIDE\""           | tr -ds '\t' ' '
    4.37  [ -n "$CONFIG_FILES"    ] && echo "CONFIG_FILES=\"$CONFIG_FILES\"" | tr -ds '\t' ' '
    4.38  [ -n "$SUGGESTED"       ] && echo "SUGGESTED=\"$SUGGESTED\""       | tr -ds '\t' ' '
     5.1 --- a/modules/pkgdb	Sun Jan 14 17:12:15 2018 +0200
     5.2 +++ b/modules/pkgdb	Wed Jan 24 12:14:38 2018 +0200
     5.3 @@ -51,6 +51,11 @@
     5.4  flavors="$SLITAZ/flavors"
     5.5  live="$SLITAZ/live"
     5.6  
     5.7 +arch=''
     5.8 +case "$ARCH" in
     5.9 +	arm*|x86_64) arch="-$ARCH" ;;
    5.10 +esac
    5.11 +
    5.12  echo 'cook:pkgdb' > $command
    5.13  _ 'Cook pkgdb: Creating all packages lists' | log
    5.14  newline; { _ 'Creating lists for "%s"' "$PKGS"; separator; } | dblog
    5.15 @@ -116,8 +121,7 @@
    5.16  		unset_receipt
    5.17  		. ./$pack/receipt
    5.18  
    5.19 -		if [ -f "$PKGS/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg" -o \
    5.20 -		     -f "$PKGS/$PACKAGE-$VERSION$EXTRAVERSION-$ARCH.tazpkg" ]; then
    5.21 +		if [ -f "$PKGS/$PACKAGE-$VERSION$EXTRAVERSION$arch.tazpkg" ]; then
    5.22  
    5.23  			# packages.desc lets us search easily in DB
    5.24  			cat >> $PKGS/packages.desc <<EOT
    5.25 @@ -165,7 +169,7 @@
    5.26  			sed "s|^|$PACKAGE: \0|" $i/taz/$j/files.list >> $PKGS/files.list
    5.27  
    5.28  			# list of unnecessary packages
    5.29 -			sed -i "/ $PACKAGE-$VERSION$EXTRAVERSION.tazpkg/d" $PKGS/packages.toremove
    5.30 +			sed -i "/ $PACKAGE-$VERSION$EXTRAVERSION$arch.tazpkg/d" $PKGS/packages.toremove
    5.31  		else
    5.32  			# if receipt variable HOST_ARCH absent/empty or contains ARCH
    5.33  			if [ -z "$HOST_ARCH" -o "${HOST_ARCH/$ARCH/}" != "$HOST_ARCH" ]; then
    5.34 @@ -209,13 +213,15 @@
    5.35  _n 'Creating file "%s"' 'files.list.lzma' | dblog
    5.36  touch files.list
    5.37  # pkgs.slitaz.org strongly depends on list sorted by packages names
    5.38 -lzma e files.list files.list.lzma
    5.39 +#lzma e files.list files.list.lzma
    5.40 +/bin/lzma -zeqcT0 files.list > files.list.lzma
    5.41  echo " ($(filesize $PKGS/files.list.lzma))" | dblog
    5.42  
    5.43  # Pre-sorting filenames causes 10% smaller resulting lzma file
    5.44  _n 'Creating file "%s"' 'files-list.lzma' | dblog
    5.45  cat files.list | sort -k2 -o files.list.sorted
    5.46 -lzma e files.list.sorted files-list.lzma
    5.47 +#lzma e files.list.sorted files-list.lzma
    5.48 +/bin/lzma -zeqcT0 files.list.sorted > files-list.lzma
    5.49  rm -f files.list files.list.sorted
    5.50  echo " ($(filesize $PKGS/files-list.lzma))" | dblog
    5.51  
    5.52 @@ -235,10 +241,11 @@
    5.53  	wget -q -O extra.list http://mirror1.slitaz.org/packages/get.list
    5.54  	echo -n '.' | dblog; sleep 5
    5.55  done
    5.56 -busybox tar -chaf bundle.tar.lzma \
    5.57 +busybox tar -chf bundle.tar \
    5.58  	mirrors extra.list files-list.md5 packages.info descriptions.txt \
    5.59  	packages.desc packages.md5 packages.txt packages.list packages.equiv
    5.60 -rm ./mirrors
    5.61 +/bin/lzma -zeqcT0 bundle.tar > bundle.tar.lzma
    5.62 +rm ./bundle.tar ./mirrors
    5.63  echo " ($(filesize $PKGS/bundle.tar.lzma))" | dblog
    5.64  
    5.65  # Display some info.