Skip to content

Commit

Permalink
Fix handling of meta command within local working directory
Browse files Browse the repository at this point in the history
* Fix osc ignoring -A apiurl command option when arguments are
  less than 2 and executed within local working copy

* Enhance handling of meta command within local working copy.
  - meta prj: Try to use project and apiurl of local working copy
    if no arguments are passed
  - meta pkg: Try to use project and apiurl of local working copy
    if one argument is passed (single argument assumed to be package
    name), and try to use project, package and apiurl if no
    arguments are passed
  • Loading branch information
sbahling authored and adrianschroeter committed Feb 27, 2014
1 parent 7b3b9eb commit a33c40e
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions osc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,22 +731,30 @@ def do_meta(self, subcmd, opts, *args):
raise oscerr.WrongArgs('Too many arguments.')

apiurl = self.get_api_url()
if len(args) < 2:
apiurl = store_read_apiurl(os.curdir)

# specific arguments
# Specific arguments
#
# If project or package arguments missing, assume to work
# with project and/or package in current local directory.
attributepath = []
if cmd in ['pkg', 'prj', 'prjconf' ]:
if len(args) == 0:
if cmd in ['prj', 'prjconf']:
if len(args) < 1:
apiurl = store_read_apiurl(os.curdir)
project = store_read_project(os.curdir)
else:
project = args[0]

if cmd == 'pkg':
if len(args) < 2:
elif cmd == 'pkg':
if len(args) < 2:
apiurl = store_read_apiurl(os.curdir)
project = store_read_project(os.curdir)
if len(args) < 1:
package = store_read_package(os.curdir)
else:
package = args[1]
package = args[0]
else:
project = args[0]
package = args[1]

elif cmd == 'attribute':
project = args[0]
Expand Down

0 comments on commit a33c40e

Please sign in to comment.