aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2015-10-20 00:59:49 +0800
committerbdrewery <bdrewery@FreeBSD.org>2015-10-20 00:59:49 +0800
commitdff7ffee6320f26114ff1d30a4af2a609026f356 (patch)
tree7443a3e04336f5f635540c1dbf3659b6f527cb98 /Mk
parent28be9fdb3bb281dc83ccc89b7c3e259cac4660d7 (diff)
downloadfreebsd-ports-gnome-dff7ffee6320f26114ff1d30a4af2a609026f356.tar.gz
freebsd-ports-gnome-dff7ffee6320f26114ff1d30a4af2a609026f356.tar.zst
freebsd-ports-gnome-dff7ffee6320f26114ff1d30a4af2a609026f356.zip
Switch strip test to using readelf(1) instead of file(1) to identify symbols.
This has been slightly faster in my tests since readelf(1) will fail on the file much quicker if it doesn't find the ELF headers. This also more directly finds the symbol table. With hat: portmgr
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Scripts/qa.sh14
1 files changed, 6 insertions, 8 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh
index a7da3e9d5ef2..f444dac1ee21 100644
--- a/Mk/Scripts/qa.sh
+++ b/Mk/Scripts/qa.sh
@@ -173,15 +173,13 @@ stripped() {
[ -n "${STRIP}" ] || return 0
# Split file and result into 2 lines and read separately to ensure
# files with spaces are kept intact.
- find ${STAGEDIR} -type f \
- -exec /usr/bin/file --exclude ascii -nNF "${LF}" {} + |
+ # Using readelf -h ... /ELF Header:/ will match on all ELF files.
+ find ${STAGEDIR} -type f ! -name '*.a' \
+ -exec readelf -S {} + 2>/dev/null | awk '\
+ /File:/ {sub(/File: /, "", $0); file=$0} \
+ /SYMTAB/ {print file}' |
while read f; do
- read output
- case "${output}" in
- *ELF\ *\ executable,\ *FreeBSD*,\ not\ stripped*|*ELF\ *\ shared\ object,\ *FreeBSD*,\ not\ stripped*)
- warn "'${f#${STAGEDIR}${PREFIX}/}' is not stripped consider trying INSTALL_TARGET=install-strip or using \${STRIP_CMD}"
- ;;
- esac
+ warn "'${f#${STAGEDIR}${PREFIX}/}' is not stripped consider trying INSTALL_TARGET=install-strip or using \${STRIP_CMD}"
done
}