Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 145174 - eclean long options reject arguments
Summary: eclean long options reject arguments
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-26 06:15 UTC by Woza
Modified: 2010-03-07 04:13 UTC (History)
1 user (show)

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


Attachments
Use '=' to tag long options requiring arguments (eclean_long_opt.diff,597 bytes, patch)
2006-08-26 06:17 UTC, Woza
Details | Diff
Use '=' to tag long options requiring arguments ( corrected ) (eclean_long_opt.diff,828 bytes, patch)
2006-08-26 06:29 UTC, Woza
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Woza 2006-08-26 06:15:59 UTC
eclean has two global options that require arguments: --time-limit and --exclude-file.  However, attempting to pass arguments to these generates the message "Wrong option on command line."  As far as I can see, this is because python getopt requires long options accepting arguments to be tagged with '='.
This behaviour was observed with python 2.4.3.

I have attached a patch to fix this problem.  The diff was made against eclean version 0.4.1 (which corresponds to CVS HEAD, revision 268).

Cheers,
Woza
Comment 1 Woza 2006-08-26 06:17:24 UTC
Created attachment 95130 [details, diff]
Use '=' to tag long options requiring arguments

Command used to generate:
diff -u ./eclean ./patched_eclean > eclean_long_opt.diff
Comment 2 Woza 2006-08-26 06:27:57 UTC
Comment on attachment 95130 [details, diff]
Use '=' to tag long options requiring arguments

--- ./eclean    2006-08-25 22:54:02.000000000 +1000
+++ ./patched_eclean    2006-08-25 23:23:30.000000000 +1000
@@ -330,10 +330,10 @@
        getopt_options = {'short':{}, 'long':{}}
        getopt_options['short']['global'] = "Cdipqe::t::nhV"
        getopt_options['long']['global'] = ["nocolor", "destructive", \
-                       "interactive", "pretend", "quiet", "exclude-file", "time-limit", \
+                       "interactive", "pretend", "quiet", "exclude-file=", "time-limit=", \
                        "package-names", "help", "version"]
        getopt_options['short']['distfiles'] = "fs::"
-       getopt_options['long']['distfiles'] = ["fetch-restricted", "size-limit"]
+       getopt_options['long']['distfiles'] = ["fetch-restricted", "size-limit="]
        getopt_options['short']['packages'] = ""
        getopt_options['long']['packages'] = [""]
        # set default options, except 'nocolor', which is set in main()
Comment 3 Woza 2006-08-26 06:29:44 UTC
Created attachment 95132 [details, diff]
Use '=' to tag long options requiring arguments  ( corrected )
Comment 4 Woza 2006-08-26 06:33:06 UTC
Sorry for the comment spam below - not experienced with bugzilla.  I realised after submitting that I forgot to patch the '--size-limit' option - hence the new patch.
Comment 5 Roumano 2008-06-19 15:16:44 UTC
Still not resolved but it's a very simple task :s

Can you valid this path ?

eclean -p --time-limit=1m distfiles
 * Wrong option on command line.
Comment 6 Woza 2008-06-20 02:50:03 UTC
Not quite sure what you meant by 'valid this path' - I've synched to the portage 
repository, and checked that the bug still happens, and the patch still fixes 
it:

> emerge -p gentoolkit
[ebuild   R   ] app-portage/gentoolkit-0.2.3-r1

> cd /usr/bin/
> eclean --version
eclean (version 0.4.1) - A cleaning tool for Gentoo distfiles and binaries.

> cp eclean eclean-patched
> patch -u eclean-patched < eclean_long_opt.diff
patching file eclean-patched

> eclean -p --time-limit=1m distfiles
 * Wrong option on command line.

> eclean-patched -p --time-limit=1m distfiles
 * Building file list for distfiles cleaning...


If this is not what you were asking, my apologies, and could you clarify?
Comment 7 Roumano 2008-06-21 14:41:48 UTC
I'am apologize for my poor english.  
No, your patch is good but i don't understand why is not already in the trunk of gentoolkit
Comment 8 Woza 2008-06-22 04:37:14 UTC
I'm not a Gentoo developer, and assumed I wouldn't have the required permissions 
to commit a patch.  I submitted it so that someone who does can vet it and commit 
it.
Comment 9 Douglas Anderson 2010-03-07 04:13:30 UTC
Fixed at least in gentoolkit-0.3.0 branch. (didn't check earlier)