Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 686288 - sys-kernel/linux-firmware-20190514 USE=savedconfig - rm: cannot remove '': No such file or directory
Summary: sys-kernel/linux-firmware-20190514 USE=savedconfig - rm: cannot remove '': No...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Chí-Thanh Christopher Nguyễn
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2019-05-19 08:05 UTC by Jeroen Roovers (RETIRED)
Modified: 2019-05-19 20:46 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeroen Roovers (RETIRED) gentoo-dev 2019-05-19 08:05:42 UTC
>>> Emerging (1 of 5) sys-kernel/linux-firmware-20190514::gentoo
 * Fetching files in the background.
 * To view fetch progress, run in another terminal:
 * tail -f /var/log/emerge-fetch.log
 * waiting for lock on /aches/gentoo/distfiles/.linux-firmware-20190514.tar.gz.portage_lockfile ...                                                     [ ok ]
 * linux-firmware-20190514.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                           [ ok ]
>>> Unpacking source...
>>> Unpacking linux-firmware-20190514.tar.gz to /home/portage/sys-kernel/linux-firmware-20190514/work
>>> Source unpacked in /home/portage/sys-kernel/linux-firmware-20190514/work
>>> Preparing source in /home/portage/sys-kernel/linux-firmware-20190514/work/linux-firmware-20190514 ...
 * Checking existence of //etc/portage/savedconfig/sys-kernel/linux-firmware-20190514 ...
 * Checking existence of //etc/portage/savedconfig/sys-kernel/linux-firmware-20190514 ...
 * Checking existence of //etc/portage/savedconfig/sys-kernel/linux-firmware ...
 * No saved config to restore - please remove USE=savedconfig or
 * provide a configuration file in //etc/portage/savedconfig/sys-kernel/linux-firmware
 * Your config file(s) will not be used this time
rm: cannot remove '': No such file or directory
 * ERROR: sys-kernel/linux-firmware-20190514::gentoo failed (prepare phase):
 *   (no error message)
 *
 * Call stack:
 *     ebuild.sh, line 124:  Called src_prepare
 *   environment, line 743:  Called die
 * The specific snippet of code:
 *           printf "%s" "${remove[@]}" | xargs -0 --no-run-if-empty rm || die;



[ebuild     U ~] sys-kernel/linux-firmware-20190514::gentoo [20190502::gentoo] USE="redistributable%* savedconfig (-unknown-license)" 0 KiB
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2019-05-19 08:15:20 UTC
Looks like a bootstrapping issue. When you install sys-kernel/linux-firmware-20190514 with USE=savedconfig for the first time, restore_config does not have a file to restore, so the rest of the logic then starts failing badly. You can only get the configuration saved during the first install, but the ebuild fails before that ever happens.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2019-05-19 09:05:54 UTC
--- a/sys-kernel/linux-firmware/linux-firmware-20190514.ebuild
+++ b/sys-kernel/linux-firmware/linux-firmware-20190514.ebuild
@@ -259,7 +259,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 [[ -n "${remove[@]}" ]]; then
+                       printf "%s\0" "${remove[@]}" | xargs -0 --no-run-if-empty rm || die
+               fi
        fi

        # remove empty directories, bug #396073
Comment 3 Larry the Git Cow gentoo-dev 2019-05-19 09:39:25 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0baeda7ca327b256ce34b40965640cebb8080f95

commit 0baeda7ca327b256ce34b40965640cebb8080f95
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2019-05-19 09:37:27 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2019-05-19 09:38:52 +0000

    sys-kernel/linux-firmware: Explicitly check for empty removal list.
    
    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 | 6 +++++-
 sys-kernel/linux-firmware/linux-firmware-99999999.ebuild | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
Comment 4 Jeroen Roovers (RETIRED) gentoo-dev 2019-05-19 20:46:19 UTC
*** Bug 686330 has been marked as a duplicate of this bug. ***