Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 883363 - savedconfig.eclass: failure to strip trailing whitespace
Summary: savedconfig.eclass: failure to strip trailing whitespace
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-27 22:48 UTC by Eric G
Modified: 2022-12-01 06:51 UTC (History)
1 user (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 Eric G 2022-11-27 22:48:18 UTC
When parsing savedconfig files, a 'hard' match that is inclusive of trailing whitespace is used.  This leads to unexpected behavior as most gentoo config files are tolerant of trailing whitespace

Reproducible: Always

Steps to Reproduce:
1. # echo "amd-ucode/microcode_amd_fam17h.bin " > /etc/portage/savedconfig/sys-kernel/linux-firmware
2. # emerge linux-firmware
3.
Actual Results:  
1. Error message:
 * No files to install. Check your USE flag settings
 * and the list of files in your saved configuration.
 * ERROR: sys-kernel/linux-firmware-20221109::gentoo failed (install phase):
 *   Refusing to install an empty package

2. No File is created in /etc/portage/savedconfig/sys-kernel i.e. etc/portage/savedconfig/sys-kernel/linux-firmware-20221109.

3. amd-ucode/microcode_amd_fam17h.bin is not present in /lib/firmware


Expected Results:  
1.No error messages
2. linux-firmware-20221109 file is created
3. /lib/firmware contains amd-ucode/microcode_amd_fam17h.bin

Removing trailing whitespace resolves the problem.  The issue with this bug is that for cases where there are multiple lines parsed and some have white space, it's a silent failure which can lead to unexpected results.