cookutils rev 874

modules/compressor: fix compress_manpages(): when there's a lot of manpages (like in openssl package), it found (in the second turn) some of just compressed manpages and compress them again (*.gz.gz)
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Jan 28 13:01:27 2017 +0200 (2017-01-28)
parents f816ea3e8dcc
children 230109645bba
files modules/compressor
line diff
     1.1 --- a/modules/compressor	Fri Jan 27 15:53:28 2017 +0200
     1.2 +++ b/modules/compressor	Sat Jan 28 13:01:27 2017 +0200
     1.3 @@ -112,7 +112,7 @@
     1.4  compress_manpages() {
     1.5  	time0=$(date +%s)
     1.6  	[ "${COOKOPTS/!manz/}" != "$COOKOPTS" ] && return
     1.7 -	manpath="$install/usr/share/man" 
     1.8 +	manpath="$install/usr/share/man"
     1.9  	[ -d "$manpath" ] || return
    1.10  	size0=$(sizes man); [ -z "$size0" ] && return
    1.11  
    1.12 @@ -125,17 +125,17 @@
    1.13  	find $manpath -type f -name '*.xz'  -exec unxz    \{\} \;
    1.14  
    1.15  	# Fast compress with gzip
    1.16 -	find $manpath -type f -name '*.[1-9]*' -exec gzip \{\} \;
    1.17 +	find $manpath -type f ! -name '*.gz' -exec gzip \{\} \;
    1.18  
    1.19  	# Fix symlinks
    1.20 -	for i in $(find $install/usr/share/man -type l); do
    1.21 +	for i in $(find $manpath -type l); do
    1.22  		dest=$(readlink $i | sed 's|\.[gbx]z2*$||')
    1.23  		link=$(echo $i | sed 's|\.[gbx]z2*$||')
    1.24  		rm $i; ln -s $dest.gz $link.gz
    1.25  	done
    1.26  
    1.27  	# Recompress with advdef (it can't compress, only recompress)
    1.28 -	for i in $(find $install/usr/share/man -type f); do
    1.29 +	for i in $(find $manpath -type f); do
    1.30  		if ! cached_path=$(query_cache mangz "$i"); then
    1.31  			advdef -z4q "$i"
    1.32  			store_cache "$cached_path" "$i"