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

Bug 137907

Summary: Localepurge parses options badly
Product: Gentoo Linux Reporter: Charlie Shepherd (RETIRED) <masterdriverz>
Component: New packagesAssignee: José Alberto Suárez López (RETIRED) <bass>
Status: RESOLVED FIXED    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch to change the way localpurge parses options

Description Charlie Shepherd (RETIRED) gentoo-dev 2006-06-25 01:12:55 UTC
Localepurge currently parses options like this

if [ "$1" = "-debug" ] || [ "$1" = "-d" ] \
    || [ "$2" = "-debug" ] || [ "$2" = "-d" ] \
    || [ "$3" = "-debug" ] || [ "$3" = "-d" ] \
    || [ "$4" = "-debug" ] || [ "$4" = "-d" ] \
    || [ "$5" = "-debug" ] || [ "$5" = "-d" ]; then
set -x
fi

So if I (ok so this is unlikely) execute localepurge -nc -nc -nc -nc -nc -debug it won't find debug. A better way of doing it is

for x in $@
do
    if "$x" = "-debug" ] || [ "$x" = "-d"; then
    set -x
    fi
done

See the attached patch for more comprehensive rewrite.
Comment 1 Charlie Shepherd (RETIRED) gentoo-dev 2006-06-25 01:14:40 UTC
Created attachment 90077 [details, diff]
Patch to change the way localpurge parses options
Comment 2 José Alberto Suárez López (RETIRED) gentoo-dev 2006-07-13 03:08:01 UTC
Thanks :)

nice patch, 0.5.1 now in cvs