cookutils rev 955

modules/compressor: Nullify timestamps of files in ar archives (aka static libs) to make "release checksum" stable for dev-packages containing *.a.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Aug 04 16:26:58 2017 +0300 (2017-08-04)
parents 0f4636284a32
children 7cdd0d3b59b7
files modules/compressor
line diff
     1.1 --- a/modules/compressor	Wed Aug 02 18:44:51 2017 +0300
     1.2 +++ b/modules/compressor	Fri Aug 04 16:26:58 2017 +0300
     1.3 @@ -562,7 +562,18 @@
     1.4  
     1.5  	# Strip shared and static libraries
     1.6  	find $fs -name '*.so*' -exec $STRIP -s '{}' 2>/dev/null \;
     1.7 -	find $fs -name '*.a' -exec $STRIP --strip-debug '{}' 2>/dev/null \;
     1.8 +	find $fs -name '*.a'   -exec $STRIP -d '{}' 2>/dev/null \;
     1.9 +
    1.10 +	# Nullify timestamps of files in ar archives
    1.11 +	whereami=$(pwd)
    1.12 +	find $fs -name '*.a' | \
    1.13 +	while read i; do
    1.14 +		tempdir=$(mktemp -d); cd $tempdir
    1.15 +		ar -x $i; ar -crD $(basename $i) *
    1.16 +		mv -f $tempdir/$(basename $i) $i
    1.17 +		rm -rf $tempdir
    1.18 +	done
    1.19 +	cd $whereami; unset whereami
    1.20  
    1.21  	# Remove Python *.pyc and *.pyo
    1.22  	find $fs -type f \( -name '*.pyc' -o -name '*.pyo' \) -delete 2>/dev/null