Bug 270398 - Fix the 'stripped' check from 'make check-plist' to report all unstripped files
Summary: Fix the 'stripped' check from 'make check-plist' to report all unstripped files
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-22 06:00 UTC by Yuri Victorovich
Modified: 2023-06-05 15:24 UTC (History)
2 users (show)

See Also:


Attachments
patch (640 bytes, patch)
2023-03-22 06:00 UTC, Yuri Victorovich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2023-03-22 06:00:45 UTC
Created attachment 241047 [details]
patch

Currently the 'stripped' check always skips 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.

The attached script adds $0 to account for the first passed file.
Comment 1 Renato Botelho freebsd_committer freebsd_triage 2023-06-01 21:15:36 UTC
It looks good to me.  Go ahead with `Approved by: portmgr-lurkers (garga)`
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2023-06-02 06:45:46 UTC
Committed, thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-06-02 06:46:11 UTC
A commit in branch main references this bug:

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(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-06-05 15:24:14 UTC
A commit in branch main references this bug:

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

commit c92e6eff6f2c3dcdfb2340f66dd3eb374e28075b
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-06-05 15:21:32 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-06-05 15:24:03 +0000

    Mk/Scripts: Add quotes to $0 in the stripped() function in qa.sh

    This is a followup to the previous patch that fixed the bug with
    missing unstripped file suggestions.

    PR:             270398
    Suggested by:   mat@

 Mk/Scripts/qa.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)