svn commit: r399699 - head/Mk/Scripts

Bryan Drewery bdrewery at FreeBSD.org
Mon Oct 19 16:59:50 UTC 2015


Author: bdrewery
Date: Mon Oct 19 16:59:49 2015
New Revision: 399699
URL: https://svnweb.freebsd.org/changeset/ports/399699

Log:
  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

Modified:
  head/Mk/Scripts/qa.sh

Modified: head/Mk/Scripts/qa.sh
==============================================================================
--- head/Mk/Scripts/qa.sh	Mon Oct 19 16:45:51 2015	(r399698)
+++ head/Mk/Scripts/qa.sh	Mon Oct 19 16:59:49 2015	(r399699)
@@ -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
 }
 


More information about the svn-ports-all mailing list