From ad5b23d9755f1ea421c5cfb1e2e3b7ba3ee1b30c Mon Sep 17 00:00:00 2001 From: Juergen Weigert Date: Sat, 20 Mar 2010 12:27:27 +0100 Subject: [PATCH] added 'bse' as a shortcur for 'search --binary' --- TODO | 1 + osc/commandline.py | 6 ++++-- osc/core.py | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index 5832e12c..c5cfe6c9 100644 --- a/TODO +++ b/TODO @@ -12,6 +12,7 @@ CRITICAL: apiurl/source/prj/pkg The current working directory or its descendants should provide defaults for apiurl, prj and/or pkg. + See also http://en.opensuse.org/Build_Service/Concepts/OscProjPack MAJOR: diff --git a/osc/commandline.py b/osc/commandline.py index 742e38af..95b9a162 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -3988,6 +3988,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='search packages built for PROJECT (implies --binary)') @cmdln.alias('sm') @cmdln.alias('se') + @cmdln.alias('bse') def do_search(self, subcmd, opts, search_term): """${cmd_name}: Search for a project and/or package. @@ -3997,7 +3998,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. usage: osc search \'search term\' - osc sm \'source package name\' + osc sm \'source package name\' ('osc search --maintained') + osc bse ... ('osc search --binary') osc se ... ${cmd_option_list} """ @@ -4021,7 +4023,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. opts.package = True if not opts.substring: opts.exact = True - if opts.baseproject: + if subcmd == 'bse' or opts.baseproject: opts.binary = True if opts.binary and (opts.title or opts.description or opts.involved or opts.bugowner or opts.maintainer diff --git a/osc/core.py b/osc/core.py index df0d7dd0..2733c45e 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2632,9 +2632,9 @@ def get_user_projpkgs_request_list(apiurl, user, req_state=('new',), req_type=No """Return all new requests for all projects/packages where is user is involved""" if not projpkgs: res = get_user_projpkgs(apiurl, user, exclude_projects=exclude_projects) - for i in res['project_id'].findall('project'): + for i in res['project'].findall('project'): projpkgs[i.get('name')] = [] - for i in res['package_id'].findall('package'): + for i in res['package'].findall('package'): if not i.get('project') in projpkgs.keys(): projpkgs.setdefault(i.get('project'), []).append(i.get('name')) xpath = '' @@ -4683,9 +4683,9 @@ def get_user_projpkgs(apiurl, user, role=None, exclude_projects=[], proj=True, p xpath_prj = xpath_join(xpath, excl_prj, op='and') what = {} if pkg: - what['package_id'] = xpath_pkg + what['package'] = xpath_pkg if proj: - what['project_id'] = xpath_prj + what['project'] = xpath_prj try: res = search(apiurl, **what) except urllib2.HTTPError, e: