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

Bug 491010

Summary: app-admin/localepurge: program quits when -nocolor (and probably -debug) switches are given on command line
Product: Gentoo Linux Reporter: Jan-Matthias Braun <jan_braun>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED OBSOLETE    
Severity: normal CC: jstein, peter, pmcdermott98, slis, treecleaner, wimmuskee
Priority: Normal Keywords: PATCH, PMASKED
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=651338
Whiteboard: Pending removal: 2018-12-11
Package list:
Runtime testing required: ---
Attachments: Patch fixing the issue by adding an empty if block for -nocolor and -debug options.
Quick fix: patch for ebuild.
Quick fix: patch named suitable for the ebuild patch.
Corrected fix_options_parsing.patch

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.