Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 491010 - app-admin/localepurge: program quits when -nocolor (and probably -debug) switches are given on command line
Summary: app-admin/localepurge: program quits when -nocolor (and probably -debug) swit...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard: Pending removal: 2018-12-11
Keywords: PATCH, PMASKED
: 541910 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-11-11 09:44 UTC by Jan-Matthias Braun
Modified: 2018-12-11 13:57 UTC (History)
6 users (show)

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


Attachments
Patch fixing the issue by adding an empty if block for -nocolor and -debug options. (localepurge_fix_unidentified_options_debug_and_nocolor.patch,597 bytes, patch)
2013-11-11 10:15 UTC, Jan-Matthias Braun
Details | Diff
Quick fix: patch for ebuild. (localepurge-0.5.4-r3.ebuild.patch,342 bytes, patch)
2013-11-12 09:34 UTC, Jan-Matthias Braun
Details | Diff
Quick fix: patch named suitable for the ebuild patch. (localepurge-0.5.4-fix_option_parsing.patch,597 bytes, patch)
2013-11-12 09:37 UTC, Jan-Matthias Braun
Details | Diff
Corrected fix_options_parsing.patch (localepurge-0.5.4-fix_option_parsing.patch,593 bytes, patch)
2015-03-20 10:12 UTC, peter@prh.myzen.co.uk
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan-Matthias Braun 2013-11-11 09:44:53 UTC
If localepurge is called with -nocolor or -nc, the script exits complaining about the unknown parameter.

For the -nocolor -debug switches to apply for other options with immediate effect, these parameters are parsed upfront.
The second parameter loop does not check them again, therefore they end up in the else block for unknown parameters.

Reproducible: Always

Steps to Reproduce:
1. Call "localepurge -nc"

Actual Results:  
localepurge exiting at parameter parsing because of an unknown option.

Expected Results:  
normal operation.
Comment 1 Jan-Matthias Braun 2013-11-11 10:15:41 UTC
Created attachment 363062 [details, diff]
Patch fixing the issue by adding an empty if block for -nocolor and -debug options.
Comment 2 Jan-Matthias Braun 2013-11-12 09:34:58 UTC
Created attachment 363112 [details, diff]
Quick fix: patch for ebuild.
Comment 3 Jan-Matthias Braun 2013-11-12 09:37:11 UTC
Created attachment 363114 [details, diff]
Quick fix: patch named suitable for the ebuild patch.
Comment 4 peter@prh.myzen.co.uk 2015-03-20 10:07:59 UTC
(In reply to Jan-Matthias Braun from comment #3)
> Created attachment 363114 [details, diff] [details, diff]
> Quick fix: patch named suitable for the ebuild patch.

There's a small error in the patch. I submit a corrected version (with improved English in the comments :) )
Comment 5 peter@prh.myzen.co.uk 2015-03-20 10:12:01 UTC
Created attachment 399308 [details, diff]
Corrected fix_options_parsing.patch

Corrected the number of lines in the patch from 15 to 14.
Comment 6 peter@prh.myzen.co.uk 2015-03-20 10:29:20 UTC
(In reply to Peter Humphrey from comment #4)
> (In reply to Jan-Matthias Braun from comment #3)
> > Created attachment 363114 [details, diff] [details, diff] [details, diff]
> > Quick fix: patch named suitable for the ebuild patch.
> 
> There's a small error in the patch. I submit a corrected version (with
> improved English in the comments :) )

It tests out OK here; can it be included in the ebuild and a version -r3 released, please?
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2018-03-26 08:07:14 UTC
*** Bug 541910 has been marked as a duplicate of this bug. ***
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-12-11 13:57:16 UTC
Removing wrt #183273.