diff options
author | Mike Pagano <mpagano@gentoo.org> | 2024-12-21 15:27:06 -0500 |
---|---|---|
committer | Mike Pagano <mpagano@gentoo.org> | 2024-12-21 15:27:06 -0500 |
commit | 1df2365983e9304c6482ba69d81b8675457a4566 (patch) | |
tree | 0b379d86eeb2e29c46ded29ae012db6dcefbc839 /sys-kernel | |
parent | dev-util/spirv-tools: Set NDEBUG (diff) | |
download | gentoo-1df2365983e9304c6482ba69d81b8675457a4566.tar.gz gentoo-1df2365983e9304c6482ba69d81b8675457a4566.tar.bz2 gentoo-1df2365983e9304c6482ba69d81b8675457a4566.zip |
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>
Diffstat (limited to 'sys-kernel')
-rw-r--r-- | sys-kernel/linux-firmware/linux-firmware-99999999.ebuild | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild index f49e8118b8be..a563075cac21 100644 --- a/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-99999999.ebuild @@ -72,6 +72,9 @@ IDEPEND=" " QA_PREBUILT="*" +PATCHES=( + "${FILESDIR}"/${PN}-copy-firmware-r7.patch +) pkg_pretend() { if use initramfs; then @@ -231,6 +234,16 @@ src_install() { local FW_OPTIONS=( "-v" ) git config --global --add safe.directory "${S}" || die + local files_to_keep= + + if use savedconfig; then + if [[ -s "${S}/${PN}.conf" ]]; then + files_to_keep="${T}/files_to_keep.lst" + grep -v '^#' "${S}/${PN}.conf" 2>/dev/null > "${files_to_keep}" || die + [[ -s "${files_to_keep}" ]] || die "grep failed, empty config file?" + FW_OPTIONS+=( "--firmware-list" "${files_to_keep}" ) + fi + fi if use compress-xz; then FW_OPTIONS+=( "--xz" ) @@ -296,29 +309,6 @@ src_install() { einfo "Removing broken symlinks ..." find * -xtype l -print -delete || die - if use savedconfig; then - if [[ -s "${S}/${PN}.conf" ]]; then - local files_to_keep="${T}/files_to_keep.lst" - grep -v '^#' "${S}/${PN}.conf" 2>/dev/null > "${files_to_keep}" || die - [[ -s "${files_to_keep}" ]] || die "grep failed, empty config file?" - - 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 - fi - fi - # remove empty directories, bug #396073 find -type d -empty -delete || die |