From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5F970138359 for ; Thu, 19 Nov 2020 18:26:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ACD2CE07DB; Thu, 19 Nov 2020 18:26:19 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 944A7E07DB for ; Thu, 19 Nov 2020 18:26:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ADE6E335DC9 for ; Thu, 19 Nov 2020 18:26:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 619C43C3 for ; Thu, 19 Nov 2020 18:26:17 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1605810365.57616accfd55b736e3b402ead96637e23792772a.whissi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-kernel/linux-firmware/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild sys-kernel/linux-firmware/linux-firmware-99999999.ebuild X-VCS-Directories: sys-kernel/linux-firmware/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: 57616accfd55b736e3b402ead96637e23792772a X-VCS-Branch: master Date: Thu, 19 Nov 2020 18:26:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: aa06b106-76f0-407f-9ef4-427daed6e15e X-Archives-Hash: 0a396d845ef8f97c57e198bfec5ced84 commit: 57616accfd55b736e3b402ead96637e23792772a Author: Thomas Deutschmann gentoo org> AuthorDate: Thu Nov 19 18:24:44 2020 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Thu Nov 19 18:26:05 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57616acc sys-kernel/linux-firmware: check each command in pipeline manually We cannot use Bash's pipefail option because grep can return exit status 1 to indicate that no line was selected which isn't an error. Fixes: 9bf0896d9 ("sys-kernel/linux-firmware: use copy-firmware.sh to install firmwares") Closes: https://bugs.gentoo.org/754960 Package-Manager: Portage-3.0.9, Repoman-3.0.2 Signed-off-by: Thomas Deutschmann gentoo.org> sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild | 11 +++++++++-- sys-kernel/linux-firmware/linux-firmware-99999999.ebuild | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild b/sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild index bc7bc76e3b0..01b85b27a4f 100644 --- a/sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild @@ -276,12 +276,19 @@ src_install() { [[ -s "${files_to_keep}" ]] || die "grep failed, empty config file?" einfo "Applying USE=savedconfig; Removing all files not listed in config ..." - set -o pipefail find ! -type d -printf "%P\n" \ | grep -Fvx -f "${files_to_keep}" \ | xargs -d '\n' --no-run-if-empty rm -v - [[ ${?} -ne 0 ]] && die "Failed to remove files not listed in config" + 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 fi fi diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild index bc7bc76e3b0..01b85b27a4f 100644 --- a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild @@ -276,12 +276,19 @@ src_install() { [[ -s "${files_to_keep}" ]] || die "grep failed, empty config file?" einfo "Applying USE=savedconfig; Removing all files not listed in config ..." - set -o pipefail find ! -type d -printf "%P\n" \ | grep -Fvx -f "${files_to_keep}" \ | xargs -d '\n' --no-run-if-empty rm -v - [[ ${?} -ne 0 ]] && die "Failed to remove files not listed in config" + 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 fi fi