Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 396031 - app-portage/layman should support multiple actions for --add / --delete
Summary: app-portage/layman should support multiple actions for --add / --delete
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Devan Franchini (RETIRED)
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2011-12-26 03:19 UTC by Patrick Lauer
Modified: 2014-09-29 13:50 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Lauer gentoo-dev 2011-12-26 03:19:14 UTC
# layman -d qiaomuf mozilla
Usage: 
  layman (-a|-d|-s|-i) (OVERLAY|ALL)
  layman -f [-o URL]
  layman (-l|-L|-S)

layman: error: ArgsParser(): Unhandled parameters: "mozilla"

# layman -d qiaomuf

 * Deleting selected overlays,...
 * Deleting directory "/var/lib/layman/qiaomuf"

Would be nice if you were allowed to add or delete multiple items in one invocation.

app-portage/layman-2.0.0_rc3
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2011-12-27 00:19:35 UTC
"CC: 	brian.dolbec@gmail.com did not match anything", said bugzilla.

Maybe fix gentoo-x86/app-portage/layman/metadata.xml now?
Comment 2 Brian Dolbec (RETIRED) gentoo-dev 2011-12-27 00:54:54 UTC
Layman already does, but due to the way argspaser works it needs to have the switch for each one.

It also supports multiple actions in the same line.

layman -d qiaomuf -d mozilla -a sunrise -s gentoo-guis -i x11

I'll extend the usage example to show that.

I'll also have someone update metadata.xml with my new @gentoo email
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2011-12-27 02:28:28 UTC
I've added more info to the usage as follows:


_USAGE = """
  layman (-a|-d|-s|-i) (OVERLAY|ALL)
  # it also supports multiple actions
  layman (-a|-d|-s|-i) (OVERLAY|ALL) [ [(-a|-d|-s|-i) (OVERLAY)] ...]
  layman -f [-o URL]
  layman (-l|-L|-S)"""

git commit: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=46444286c8d70797964dc80dd70e42a0f2d35723

Also, just to explain a bit more on argsparser and multiple values for and argument.

argsparser.add_argument() takes an narg param that will handle any number of values and return a list of them.

Unfortunately when using optiongroups like layman does, the add_option()'s narg will not accept the '+', '*' values like add_argument().  It only accepts integers

  File "/usr/lib64/python2.7/optparse.py", line 1540, in _process_short_opts
    % (opt, nargs))
TypeError: %d format: a number is required, not str

I had tried fix to take multiple values after I took over layman development without success, and again just now with the newest python's.  Again without success.
Comment 4 Brian Dolbec (RETIRED) gentoo-dev 2011-12-27 04:22:52 UTC
Ok, I hadn't realized the difference between optparse and argparse.  I was inadvertently mixing them up.  Since optparse is now deprecated, I'll migrate it to argparse so that it will work correctly.
Comment 5 Devan Franchini (RETIRED) gentoo-dev 2014-07-11 22:00:09 UTC
This has been fixed on my github repo for layman and will be moved to the master branch of g.o.g.o soon enough. Until then, I'll keep this bug open.
Comment 6 Devan Franchini (RETIRED) gentoo-dev 2014-09-29 13:50:40 UTC
Available in layman-2.2.0, closing as fixed.