summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-10-30 17:37:00 +0100
committerThomas Deutschmann <whissi@gentoo.org>2020-10-30 17:45:50 +0100
commit5051834606a77afa11c0e9c96bc298872bc11650 (patch)
treed5a18dfce70df9dcc03b1523416175f5edf2c707 /sys-kernel/linux-firmware
parentmedia-tv/kodi: 19.0_alpha2_p20201030 version bump (diff)
downloadgentoo-5051834606a77afa11c0e9c96bc298872bc11650.tar.gz
gentoo-5051834606a77afa11c0e9c96bc298872bc11650.tar.bz2
gentoo-5051834606a77afa11c0e9c96bc298872bc11650.zip
sys-kernel/linux-firmware: keep misc files
Whitelist misc files like copy-firmware.sh or WHENCE which we will use later. Closes: https://bugs.gentoo.org/751901 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'sys-kernel/linux-firmware')
-rw-r--r--sys-kernel/linux-firmware/linux-firmware-99999999.ebuild20
1 files changed, 17 insertions, 3 deletions
diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
index fcd90451c740..6a67500e679c 100644
--- a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
+++ b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild
@@ -114,6 +114,13 @@ src_prepare() {
fi
fi
+ # whitelist of misc files
+ local misc_files=(
+ copy-firmware.sh
+ WHENCE
+ README
+ )
+
# whitelist of images with a free software license
local free_software=(
# keyspan_pda (GPL-2+)
@@ -238,9 +245,16 @@ src_prepare() {
# everything else is confirmed (or assumed) to be redistributable
# based on upstream acceptance policy
einfo "Removing non-redistributable files ..."
- IFS=$'\n' find ! -type d -printf "%P\n" \
- | grep -Fvx -e "${free_software[*]}" -e "${unknown_license[*]}" \
- | xargs -d '\n' rm -v || die
+ local OLDIFS="${IFS}"
+ local IFS=$'\n'
+ set -o pipefail
+ find ! -type d -printf "%P\n" \
+ | grep -Fvx -e "${misc_files[*]}" -e "${free_software[*]}" -e "${unknown_license[*]}" \
+ | xargs -d '\n' --no-run-if-empty rm -v
+
+ [[ ${?} -ne 0 ]] && die "Failed to remove non-redistributable files"
+
+ IFS="${OLDIFS}"
fi
restore_config ${PN}.conf