# HG changeset patch # User Pascal Bellard # Date 1422264964 -3600 # Node ID 721c57a2f5f1ba0ef007551066b01c18178d4305 # Parent 1d6e23a2782f893d5ff26bb0b98e5c97ea1b7764 tazpkg-find-depends: speedup diff -r 1d6e23a2782f -r 721c57a2f5f1 modules/tazpkg-find-depends --- a/modules/tazpkg-find-depends Wed Jan 21 17:53:26 2015 +0200 +++ b/modules/tazpkg-find-depends Mon Jan 26 10:36:04 2015 +0100 @@ -36,6 +36,8 @@ [ -f $i ] && lzma d $i -so >> $TMP_DIR/files.list done + echo "Find depends..." 1>&2 + libs_found="" find ${1:-$TMP_DIR/$file/fs} -type f | \ while read chkfile ; do is_elf $chkfile || continue @@ -43,13 +45,17 @@ *.o|*.ko|*.ko.gz) continue;; esac - ldd $chkfile | \ - while read lib rem; do + for lib in $(ldd $chkfile | sed '/=>/!d;s/ =>.*//') ; do + case " $libs_found " in + *\ $lib\ *) continue + esac + libs_found="$libs_found $lib" case "$lib" in statically|linux-gate.so*|ld-*.so|*/ld-*.so) continue;; esac find ${1:-$TMP_DIR/$file/fs} | grep -q /$lib$ && continue + echo -ne "for $lib \r" 1>&2 for dep in $(fgrep $lib files.list | cut -d: -f1); do case " $DEFAULT_DEPENDS " in *\ $dep\ *) continue 2;;