tazpkg rev 748

tazpkg-find-depends: speedup
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jan 26 10:36:04 2015 +0100 (2015-01-26)
parents 1d6e23a2782f
children 2e322fe014a2
files modules/tazpkg-find-depends
line diff
     1.1 --- a/modules/tazpkg-find-depends	Wed Jan 21 17:53:26 2015 +0200
     1.2 +++ b/modules/tazpkg-find-depends	Mon Jan 26 10:36:04 2015 +0100
     1.3 @@ -36,6 +36,8 @@
     1.4  		[ -f $i ] && lzma d $i -so >> $TMP_DIR/files.list
     1.5  	done
     1.6  
     1.7 +	echo "Find depends..." 1>&2
     1.8 +	libs_found=""
     1.9  	find ${1:-$TMP_DIR/$file/fs} -type f | \
    1.10  	while read chkfile ; do
    1.11  		is_elf $chkfile || continue
    1.12 @@ -43,13 +45,17 @@
    1.13  			*.o|*.ko|*.ko.gz) continue;;
    1.14  		esac
    1.15  
    1.16 -		ldd $chkfile | \
    1.17 -		while read lib rem; do
    1.18 +		for lib in $(ldd $chkfile | sed '/=>/!d;s/ =>.*//') ; do
    1.19 +			case " $libs_found " in
    1.20 +			*\ $lib\ *) continue
    1.21 +			esac
    1.22 +			libs_found="$libs_found $lib"
    1.23  			case "$lib" in
    1.24  				statically|linux-gate.so*|ld-*.so|*/ld-*.so) continue;;
    1.25  			esac
    1.26  			find ${1:-$TMP_DIR/$file/fs} | grep -q /$lib$ && continue
    1.27  
    1.28 +			echo -ne "for $lib                   \r" 1>&2
    1.29  			for dep in $(fgrep $lib files.list | cut -d: -f1); do
    1.30  				case " $DEFAULT_DEPENDS " in
    1.31  					*\ $dep\ *) continue 2;;