gen-dependencies.sh: fix handling variations in "file" output

On some systems, file adds ", with debug info" after "not stripped"

Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Felix Fietkau 2017-02-19 15:28:01 +01:00
parent b9b681c067
commit 663f2a0864

View file

@ -19,7 +19,7 @@ XARGS="${XARGS:-xargs -r}"
}
find $TARGETS -type f -a -exec file {} \; | \
sed -n -e 's/^\(.*\):.*ELF.*\(executable\|shared object\).*,.* stripped/\1/p' | \
sed -n -e 's/^\(.*\):.*ELF.*\(executable\|shared object\).*,.*/\1/p' | \
$XARGS -n1 $READELF -d | \
awk '$2 ~ /NEEDED/ && $NF !~ /interpreter/ && $NF ~ /^\[?lib.*\.so/ { gsub(/[\[\]]/, "", $NF); print $NF }' | \
sort -u