cookutils diff modules/compressor @ rev 908

cook: support per-package CONFIG_FILES, fix pre_install etc. extracting; lighttpd/index.cgi: display all descriptions.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon May 29 04:48:50 2017 +0300 (2017-05-29)
parents 897914bd4c94
children 39feb4e7243d
line diff
     1.1 --- a/modules/compressor	Tue Feb 21 21:54:37 2017 +0200
     1.2 +++ b/modules/compressor	Mon May 29 04:48:50 2017 +0300
     1.3 @@ -76,6 +76,8 @@
     1.4  		loc) find $install/usr/share/i18n/locales -type f                                       -exec ls -l \{\} \; ;;
     1.5  		mo2) find $fs/usr/share/locale            -type f -name '*.mo'                          -exec ls -l \{\} \; ;;
     1.6  		gz)  find $install                        -type f -name '*.gz' ! -path '*/share/man/*'  -exec ls -l \{\} \; ;;
     1.7 +		str) find $fs -type f \( -name '*.so*' -o -name '*.a' -o -name '*.pyc' -o -name '*.pyo' \
     1.8 +				-o -name '.packlist' -o -name '*.pm' -o -name '*.pl' -o -name '*.pod' \) -exec ls -l \{\} \; ;;
     1.9  	esac | awk '{s+=$5}END{print s}'
    1.10  }
    1.11  
    1.12 @@ -524,20 +526,29 @@
    1.13  		fi
    1.14  	done
    1.15  
    1.16 +	oldsize=$(sizes str)
    1.17 +
    1.18  	# Strip shared and static libraries
    1.19 -	# Remove Python *.pyc and *.pyo, Perl perllocal.pod and .packlist
    1.20 -	oldsize=$(find $fs -type f \( \
    1.21 -		-name '*.so*' -o -name '*.a' -o \
    1.22 -		-name '*.pyc' -o -name '*.pyo' -o \
    1.23 -		-name 'perllocal.pod' -o -name '.packlist' \) -exec ls -l '{}' \; | awk '{s+=$5}END{print s}')
    1.24 -
    1.25  	find $fs -name '*.so*' -exec $STRIP -s '{}' 2>/dev/null \;
    1.26  	find $fs -name '*.a' -exec $STRIP --strip-debug '{}' 2>/dev/null \;
    1.27 +
    1.28 +	# Remove Python *.pyc and *.pyo
    1.29  	find $fs -type f \( -name '*.pyc' -o -name '*.pyo' \) -delete 2>/dev/null
    1.30 -	find $fs -type f \( -name 'perllocal.pod' -o -name '.packlist' \) -delete 2>/dev/null
    1.31  
    1.32 -	newsize=$(find $fs -type f \( \
    1.33 -		-name '*.so*' -o -name '*.a' -o \) -exec ls -l '{}' \; | awk '{s+=$5}END{print s}')
    1.34 +	# Remove both with the empty subfolders:
    1.35 +	# 1. Perl perllocal.pod and .packlist (unconditionally)
    1.36 +	local perlfiles="$(find $fs -type f \( -name 'perllocal.pod' -o -name '.packlist' \))"
    1.37 +	# 2. Perl *.pod (if not disabled)
    1.38 +	[ "${COOKOPTS/!rmpod/}" == "$COOKOPTS" ] &&
    1.39 +		perlfiles="$perlfiles $(find $fs -type f -name '*.pod')"
    1.40 +	echo "$perlfiles" | xargs rm -f 2>/dev/null
    1.41 +	echo "$perlfiles" | awk 'BEGIN{FS=OFS="/"}{$NF="";print}' | xargs rmdir -p 2>/dev/null
    1.42 +
    1.43 +	# Strip Perl files (*.pm and *.pl) from documentation inside (if not disabled)
    1.44 +	[ "${COOKOPTS/!perlz/}" == "$COOKOPTS" ] &&
    1.45 +		find $fs -type f \( -name '*.pm' -o -name '*.pl' \) -exec sed -i '/^=/,/^=cut/d' '{}' \;
    1.46 +
    1.47 +	newsize=$(sizes str)
    1.48  
    1.49  	comp_summary "$time0" "$((size0 + oldsize))" "$((size1 + newsize))"
    1.50  }