src_install() { if use !savedconfig; then save_config ${PN}.conf fi Yank/paste error? --- a/sys-kernel/linux-firmware/linux-firmware-20190514.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-20190514.ebuild @@ -267,7 +270,7 @@ src_prepare() { } src_install() { - if use !savedconfig; then + if use savedconfig; then save_config ${PN}.conf fi rm ${PN}.conf || die
Since you were doing so well on resolving bug #686288 (and since you're not on the kernel@ alias or listed in metadata.xml).
That's intentional (and like this since 2016), see bug 546690.
Um. So on first install, USE=savedconfig is not actually used to save the config, and then on the next install USE=savedconfig is not actually used to restore the config, because it wasn't installed on the first run. What?
<[Arfrever]> ulm: This code was in this way for long time, but jer's suggestion seems valid. <[Arfrever]> ulm: Maybe 'save_config ${PN}.conf' should be called unconditionally. <[Arfrever]> ulm: It seems to me that restore_config() is intended to be used conditionally (and it already internally has 'use savedconfig || return'), while save_config() is intended to \ be used unconditionally. <@ulm> [Arfrever]: bug 546690 <+willikins> ulm: https://bugs.gentoo.org/546690 "sys-kernel/linux-firmware: Don't re-save configuration if 'savedconfig' is enabled"; Gentoo Linux, [OLD] Core system; RESO, FIXE; aranea:c\ hithanh <[Arfrever]> ulm: Maybe the right solution would be (beside unconditional call to save_config()) in savedconfig.eclass... <[Arfrever]> ulm: restore_config() supports multiple variants of file name: ${PF}, ${P}, ${PN} <[Arfrever]> ulm: But save_config() always uses ${PF}. <@ulm> so it would create a new config file for every version bump? <[Arfrever]> ulm: https://bugs.gentoo.org/546690#c0 <[Arfrever]> ulm: restore_config() could set a private global variable indicating which variant of file name was used. save_config() could check this private global variable... <[Arfrever]> So if restore_config() has read data from /etc/portage/savedconfig/sys-kernel/linux-firmware then save_config() should write data to ${ED}/portage/savedconfig/sys-kernel/linux\ -firmware <@ulm> yeah, but IMHO this is a bad time for doing unrelated functional changes to the ebuild <[Arfrever]> It seems that it is originally a design bug in savedconfig.eclass which was wrought around in that ebuild... <@ulm> [Arfrever]: can you please file a bug for the eclass? <@ulm> [Arfrever]: can I post the above to #686296? <[Arfrever]> Yes
There is a race between installing linux-firmware to find out which blobs you want, and then configuring the saved configuration file to reflect that, so in order to find out what you want to keep/remove, the config should be installed first, then edited, and then applied to the same version on the re-install. savedconfig.eclass has all kinds of problems that really require an `ebuild ... unpack` to figure out, but this is not the place to solve those.
After fix for bug #686348 is applied, the correct solution for sys-kernel/linux-firmware, working for all use cases, will be: --- a/sys-kernel/linux-firmware/linux-firmware-20190514.ebuild +++ b/sys-kernel/linux-firmware/linux-firmware-20190514.ebuild @@ -274,9 +274,7 @@ src_prepare() { } src_install() { - if use !savedconfig; then - save_config ${PN}.conf - fi + save_config ${PN}.conf rm ${PN}.conf || die if ! ( shopt -s failglob; : * ) 2>/dev/null; then
savedconfig.eclass is now properly fixed (bug #686348). Please apply solution to sys-kernel/linux-firmware described in comment #6.
Created attachment 587066 [details, diff] Patch
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d0c32e684cc7579efed02f2b96729eefeb439f5f commit d0c32e684cc7579efed02f2b96729eefeb439f5f Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-08-16 20:00:38 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-08-16 20:10:56 +0000 sys-kernel/linux-firmware: new snapshot Closes: https://bugs.gentoo.org/686296 Package-Manager: Portage-2.3.71, Repoman-2.3.17 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> sys-kernel/linux-firmware/Manifest | 1 + .../linux-firmware/linux-firmware-20190815.ebuild | 352 +++++++++++++++++++++ .../linux-firmware/linux-firmware-99999999.ebuild | 4 +- 3 files changed, 354 insertions(+), 3 deletions(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82ac7733be67373d2224206429e8c736e497d05e commit 82ac7733be67373d2224206429e8c736e497d05e Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2019-08-16 20:05:39 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2019-08-16 20:10:58 +0000 sys-kernel/linux-firmware: update saveconfig logic Bug: https://bugs.gentoo.org/686296 Package-Manager: Portage-2.3.71, Repoman-2.3.17 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org> sys-kernel/linux-firmware/linux-firmware-20190603.ebuild | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)