Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 883363

Summary: savedconfig.eclass: failure to strip trailing whitespace
Product: Gentoo Linux Reporter: Eric G <eric.gharakhanian>
Component: EclassesAssignee: Gentoo's Team for Core System packages <base-system>
Status: UNCONFIRMED ---    
Severity: minor CC: eric.gharakhanian
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

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.