summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild')
-rw-r--r--sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild b/sys-kernel/linux-firmware/linux-firmware-20201022-r2.ebuild
index bc7bc76e3b09..01b85b27a4f0 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