[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1011254: The UDEB package "localechooser" contains probably some buggy source code in "05localechooser" file



Package: localechooser
Version: 2.94

Dear Maintainers,

While working on my customized Debian installer (DI) I noticed that the "./usr/lib/post-base-installer.d/05localechooser" file from the "localechooser_2.93_*.udeb" package (at least for AMD64 and ARM64 architectures) contains probably buggy source code for calculating the value of the "LEVEL" variable (on lines 87-91). The problems are in "cut" commands (on lines 88 and 91) which should probably be:
cut -f 1-3 -d \;
cut -f 2 -d \;

Currently the "LEVEL" variable seems to get the empty string value because the "grep" command (on line 89) cannot find the language code (because the first field is removed by the first "cut" command). Maybe the "LANGUAGECODE" variable on line 83 could be avoided and merged into the "LEVEL" variable if command substitution is done using "$(...)" resulting in this proposed source code:
LEVEL=$(cat /usr/share/localechooser/languagelist | \
            cut -f 1-3 -d \; | \
            grep $(echo $LOCALE | cut -f 1 -d _) | \
            head -n 1 | \
            cut -f 2 -d \;)

My customized DI (with various other removed and modified files) seems to work normally with the mentioned proposed source code. I also successfully tested the proposed source code for calculating the value of the "LEVEL" variable on the "./usr/share/localechooser/languagelist" file from the "localechooser_2.93_*.udeb" package.

I checked the "localechooser" 2.94 package and the "05localechooser" file is the same (and "languagelist" file structure is also the same), but verify/test what I found if needed.

Best Regards
Jmkr


Reply to: