Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Jun 2023 06:45:31 GMT
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 67ce8cec004c - main - Mk/Scripts: Fix the 'stripped' check from 'make check-plist' to report all unstripped files
Message-ID:  <202306020645.3526jV0Y019662@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=67ce8cec004c85caeee5a6e965bd10f872e1b895

commit 67ce8cec004c85caeee5a6e965bd10f872e1b895
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-06-02 06:40:46 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-06-02 06:45:29 +0000

    Mk/Scripts: Fix the 'stripped' check from 'make check-plist' to report all unstripped files
    
    Prior to this patch, the 'stripped' check always skipped the first
    unstripped file.
    
    It uses the "find [...] -exec sh -c 'readelf -S -- /dev/null $0 "$@" || :' -- {} +"
    command. When arguments are passed to shell like this:
    "sh -c 'script' arg1 arg2 arg3" - $@ within the script is assigned
    to 'arg2 arg3', and $0 is assigned to arg1. This is a quirk in
    how shells handle arguments in case when the script is passed
    using -c.
    
    This patch adds $0 to account for the first passed file.
    
    PR:             270398
    Approved by:    portmgr-lurkers (garga)
---
 Mk/Scripts/qa.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh
index dd0f3440c299..a65d9475840e 100644
--- a/Mk/Scripts/qa.sh
+++ b/Mk/Scripts/qa.sh
@@ -211,7 +211,7 @@ stripped() {
 	# files with spaces are kept intact.
 	# Using readelf -h ... /ELF Header:/ will match on all ELF files.
 	find ${STAGEDIR} -type f ! -name '*.a' ! -name '*.o' \
-	    -exec sh -c 'readelf -S -- /dev/null "$@" || :' -- {} + 2>/dev/null | awk '
+	    -exec sh -c 'readelf -S -- /dev/null $0 "$@" || :' -- {} + 2>/dev/null | awk '
 	    /File:/ {sub(/File: /, "", $0); file=$0}
 	    /[[:space:]]\.debug_info[[:space:]]*PROGBITS/ {print file}' |
 	    while read -r f; do



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306020645.3526jV0Y019662>