Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 943848 - sys-kernel/linux-firmware-99999999: non-functional test for PIPESTATUS
Summary: sys-kernel/linux-firmware-99999999: non-functional test for PIPESTATUS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Chí-Thanh Christopher Nguyễn
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-18 20:23 UTC by Ulrich Müller
Modified: 2024-12-21 20:29 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2024-11-18 20:23:17 UTC
In src_install():

            einfo "Applying USE=savedconfig; Removing all files not listed in config ..."
            find ! -type d -printf "%P\n" \
                | grep -Fvx -f "${files_to_keep}" \
                | xargs -d '\n' --no-run-if-empty rm -v

            if [[ ${PIPESTATUS[0]} -ne 0 ]]; then
                die "Find failed to print installed files"
            elif [[ ${PIPESTATUS[1]} -eq 2 ]]; then
                # grep returns exit status 1 if no lines were selected
                # which is the case when we want to keep all files
                die "Grep failed to select files to keep"
            elif [[ ${PIPESTATUS[2]} -ne 0 ]]; then
                die "Failed to remove files not listed in config"
            fi

When the first test [[ ${PIPESTATUS[0]} -ne 0 ]] succeeds, it will reset the whole array. So the subsequent two tests will never fail.

(Presumably the live ebuild should be synced from the non-live one, where that pipe was removed some time ago.)
Comment 1 Ulrich Müller gentoo-dev 2024-11-19 08:24:40 UTC
(In reply to Ulrich Müller from comment #0)
> When the first test [[ ${PIPESTATUS[0]} -ne 0 ]] succeeds, it will reset the
> whole array. So the subsequent two tests will never fail.

Sorry, this wasn't quite accurate. Of course the command will always reset PIPESTATUS (which is only relevant when it doesn't die because of the first test).
Comment 2 Larry the Git Cow gentoo-dev 2024-12-21 20:29:03 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1df2365983e9304c6482ba69d81b8675457a4566

commit 1df2365983e9304c6482ba69d81b8675457a4566
Author:     Mike Pagano <mpagano@gentoo.org>
AuthorDate: 2024-12-21 20:27:06 +0000
Commit:     Mike Pagano <mpagano@gentoo.org>
CommitDate: 2024-12-21 20:27:06 +0000

    sys-kernel/linux-firmware: savedconfig fixes inline with non-git version
    
    Closes: https://bugs.gentoo.org/943848
    
    Signed-off-by: Mike Pagano <mpagano@gentoo.org>

 .../linux-firmware/linux-firmware-99999999.ebuild  | 36 ++++++++--------------
 1 file changed, 13 insertions(+), 23 deletions(-)