1 |
commit: 5051834606a77afa11c0e9c96bc298872bc11650 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Oct 30 16:37:00 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Oct 30 16:45:50 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=50518346 |
7 |
|
8 |
sys-kernel/linux-firmware: keep misc files |
9 |
|
10 |
Whitelist misc files like copy-firmware.sh or WHENCE which we will use |
11 |
later. |
12 |
|
13 |
Closes: https://bugs.gentoo.org/751901 |
14 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
15 |
|
16 |
.../linux-firmware/linux-firmware-99999999.ebuild | 20 +++++++++++++++++--- |
17 |
1 file changed, 17 insertions(+), 3 deletions(-) |
18 |
|
19 |
diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild |
20 |
index fcd90451c74..6a67500e679 100644 |
21 |
--- a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild |
22 |
+++ b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild |
23 |
@@ -114,6 +114,13 @@ src_prepare() { |
24 |
fi |
25 |
fi |
26 |
|
27 |
+ # whitelist of misc files |
28 |
+ local misc_files=( |
29 |
+ copy-firmware.sh |
30 |
+ WHENCE |
31 |
+ README |
32 |
+ ) |
33 |
+ |
34 |
# whitelist of images with a free software license |
35 |
local free_software=( |
36 |
# keyspan_pda (GPL-2+) |
37 |
@@ -238,9 +245,16 @@ src_prepare() { |
38 |
# everything else is confirmed (or assumed) to be redistributable |
39 |
# based on upstream acceptance policy |
40 |
einfo "Removing non-redistributable files ..." |
41 |
- IFS=$'\n' find ! -type d -printf "%P\n" \ |
42 |
- | grep -Fvx -e "${free_software[*]}" -e "${unknown_license[*]}" \ |
43 |
- | xargs -d '\n' rm -v || die |
44 |
+ local OLDIFS="${IFS}" |
45 |
+ local IFS=$'\n' |
46 |
+ set -o pipefail |
47 |
+ find ! -type d -printf "%P\n" \ |
48 |
+ | grep -Fvx -e "${misc_files[*]}" -e "${free_software[*]}" -e "${unknown_license[*]}" \ |
49 |
+ | xargs -d '\n' --no-run-if-empty rm -v |
50 |
+ |
51 |
+ [[ ${?} -ne 0 ]] && die "Failed to remove non-redistributable files" |
52 |
+ |
53 |
+ IFS="${OLDIFS}" |
54 |
fi |
55 |
|
56 |
restore_config ${PN}.conf |