Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 137907 - Localepurge parses options badly
Summary: Localepurge parses options badly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: José Alberto Suárez López (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-25 01:12 UTC by Charlie Shepherd (RETIRED)
Modified: 2006-07-13 03:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to change the way localpurge parses options (rewrite.diff,3.52 KB, patch)
2006-06-25 01:14 UTC, Charlie Shepherd (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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