cookutils rev 1072

cook, lighttpd/index.cgi: add */share/metainfo/* to the "GNOME goodies" and exclude they from @std; modules/compressor: cache compressed gif's too
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Jun 09 12:24:58 2018 +0300 (2018-06-09)
parents 7e99c6e7eb42
children ecb4a935ac17
files cook lighttpd/index.cgi modules/compressor
line diff
     1.1 --- a/cook	Wed Jun 06 15:31:35 2018 +0300
     1.2 +++ b/cook	Sat Jun 09 12:24:58 2018 +0300
     1.3 @@ -1562,7 +1562,7 @@
     1.4  					/\/share\/devhelp\//d; /\/share\/locale\//d;
     1.5  					/\/share\/bash-completion\//d; /\/etc\/bash_completion\.d\//d; /\/lib\/systemd\//d;
     1.6  					/\/fonts\.scale$/d; /\/fonts\.dir$/d;
     1.7 -					/\/share\/appdata\//d; /\/share\/help\//d;
     1.8 +					/\/share\/appdata\//d; /\/share\/help\//d; /\/share\/metainfo\//d;
     1.9  					/\/share\/icons\/hicolor\/[12356][1245][268]*x[12356][1245][268]*\//d;	# 22, 24, 32, 64, 128, 256, 512
    1.10  					/\.so\.dbg$/d;
    1.11  					' $filelist
     2.1 --- a/lighttpd/index.cgi	Wed Jun 06 15:31:35 2018 +0300
     2.2 +++ b/lighttpd/index.cgi	Sat Jun 09 12:24:58 2018 +0300
     2.3 @@ -1721,7 +1721,8 @@
     2.4  							/\/share\/locale\// { tag("loc", 4); next }
     2.5  							/\.h$/ || /\.a$/ || /\.pc$/ || /\/bin\/.*-config$/ ||
     2.6  								/\/Makefile.*$/ { tag("dev", 3); next }
     2.7 -							/\/share\/help\// || /\/share\/appdata\// { tag("gnm", 6); next }
     2.8 +							/\/share\/help\// || /\/share\/appdata\// ||
     2.9 +							/\/share\/metainfo\// { tag("gnm", 6); next }
    2.10  							{ tag("???", 1) }
    2.11  							' "$orphans" > $table
    2.12  
     3.1 --- a/modules/compressor	Wed Jun 06 15:31:35 2018 +0300
     3.2 +++ b/modules/compressor	Sat Jun 09 12:24:58 2018 +0300
     3.3 @@ -366,11 +366,11 @@
     3.4  
     3.5  	action 'Compressing svg images...'
     3.6  
     3.7 +	the_log="$(mktemp)"
     3.8  	if which svgcleaner >/dev/null; then
     3.9  		[ "${COOKOPTS/!svgextra/}" == "$COOKOPTS" ] &&
    3.10  		opts="--apply-transform-to-paths yes --coordinates-precision 1 --paths-coordinates-precision 1"
    3.11  
    3.12 -		the_log="$(mktemp)"
    3.13  		for i in $(IFS=$'\n' find $install -type f -name '*.svg'); do
    3.14  			out="$(unset IFS; svgcleaner "$i" "$i" --copy-on-error --quiet \
    3.15  				--multipass --remove-unresolved-classes no $opts 2>&1)"
    3.16 @@ -396,16 +396,21 @@
    3.17  
    3.18  	action 'Compressing gif images...'
    3.19  
    3.20 +	the_log="$(mktemp)"
    3.21  	if which gifsicle >/dev/null; then
    3.22 -		the_log="$(mktemp)"
    3.23  		IFS=$'\n'
    3.24  		for i in $(find $install -type f -name '*.gif'); do
    3.25 -			unset IFS
    3.26 -			# use intermediate file, if all well ($?=0), then substitute the original
    3.27 -			if gifsicle -O3 "$i" -o "$i.$$" >> "$the_log" 2>&1; then
    3.28 -				if [ -s "$i.$$" ]; then mv "$i.$$" "$i"; fi
    3.29 -			else
    3.30 -				rm "$i.$$"
    3.31 +			if ! cached_path=$(query_cache gif "$i"); then
    3.32 +				unset IFS
    3.33 +				# use intermediate file, if all well ($?=0), then substitute the original
    3.34 +				if gifsicle -O3 "$i" -o "$i.$$" >> "$the_log" 2>&1; then
    3.35 +					if [ -s "$i.$$" ]; then
    3.36 +						mv "$i.$$" "$i"
    3.37 +						store_cache "$cached_path" "$i"
    3.38 +					fi
    3.39 +				else
    3.40 +					rm "$i.$$"
    3.41 +				fi
    3.42  			fi
    3.43  		done
    3.44  	else
    3.45 @@ -428,11 +433,11 @@
    3.46  
    3.47  	action 'Compressing ui files...'
    3.48  
    3.49 +	the_log="$(mktemp)"
    3.50  	if which xmlstarlet >/dev/null; then
    3.51  		size0=$(sizes xml)
    3.52  		time0=$(get_time)
    3.53  		temp_ui="$(mktemp)"
    3.54 -		the_log="$(mktemp)"
    3.55  		IFS=$'\n'
    3.56  		for ui in $(find $install -type f \( -name '*.ui' -o -name '*.glade' \) ); do
    3.57  			out="$(xmlstarlet c14n --without-comments "$ui" | xmlstarlet sel -B -t -c '*' > "$temp_ui")"