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
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 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()
Created attachment 95132 [details, diff] Use '=' to tag long options requiring arguments ( corrected )
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.
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.
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?
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
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.
Fixed at least in gentoolkit-0.3.0 branch. (didn't check earlier)