sys-kernel/linux-firmware: Explicitly check for empty removal list.
authorUlrich Müller <ulm@gentoo.org>
Sun, 19 May 2019 09:37:27 +0000 (11:37 +0200)
committerUlrich Müller <ulm@gentoo.org>
Sun, 19 May 2019 09:38:52 +0000 (11:38 +0200)
Closes: https://bugs.gentoo.org/686288
Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
sys-kernel/linux-firmware/linux-firmware-20190514.ebuild
sys-kernel/linux-firmware/linux-firmware-99999999.ebuild

index 02bf11f5772367fe2fe90a22b63d21e92587f3d0..be49f81c70a7f7ba1388c0b18784b67d454936cf 100644 (file)
@@ -249,6 +249,7 @@ src_prepare() {
 
                local file preserved_files=() remove=()
 
+               ebegin "Removing all files not listed in config"
                while IFS= read -r file; do
                        # Ignore comments.
                        if [[ ${file} != "#"* ]]; then
@@ -259,7 +260,10 @@ src_prepare() {
                while IFS= read -d "" -r file; do
                        has "${file}" "${preserved_files[@]}" || remove+=("${file}")
                done < <(find * ! -type d ! -name ${PN}.conf -print0 || die)
-               printf "%s\0" "${remove[@]}" | xargs -0 --no-run-if-empty rm || die
+               if [[ ${#remove[@]} -gt 0 ]]; then
+                       printf "%s\0" "${remove[@]}" | xargs -0 rm || die
+               fi
+               eend 0
        fi
 
        # remove empty directories, bug #396073
index 3c366519cb12498136961b67620d476817f2155b..923cce545de5e1c88d118acdc85ee8b3433629b0 100644 (file)
@@ -249,6 +249,7 @@ src_prepare() {
 
                local file preserved_files=() remove=()
 
+               ebegin "Removing all files not listed in config"
                while IFS= read -r file; do
                        # Ignore comments.
                        if [[ ${file} != "#"* ]]; then
@@ -259,7 +260,10 @@ src_prepare() {
                while IFS= read -d "" -r file; do
                        has "${file}" "${preserved_files[@]}" || remove+=("${file}")
                done < <(find * ! -type d ! -name ${PN}.conf -print0 || die)
-               printf "%s\0" "${remove[@]}" | xargs -0 --no-run-if-empty rm || die
+               if [[ ${#remove[@]} -gt 0 ]]; then
+                       printf "%s\0" "${remove[@]}" | xargs -0 rm || die
+               fi
+               eend 0
        fi
 
        # remove empty directories, bug #396073