mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 09:56:13 +01:00
allow filtering by repo/arch in prjresults
This commit is contained in:
parent
ca237c5af9
commit
5ef036a578
@ -2291,6 +2291,10 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
help='show only packages with buildstatus STATUS (see legend)')
|
||||
@cmdln.option('-n', '--name-filter', metavar='EXPR',
|
||||
help='show only packages whose names match EXPR')
|
||||
@cmdln.option('-a', '--arch', metavar='ARCH',
|
||||
help='show results only for specified architecture(s)')
|
||||
@cmdln.option('-r', '--repo', metavar='REPO',
|
||||
help='show results only for specified repo(s)')
|
||||
@cmdln.option('-p', '--project', metavar='PROJECT',
|
||||
help='show packages in project PROJECT')
|
||||
@cmdln.alias('pr')
|
||||
@ -2316,7 +2320,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
project = store_read_project(wd)
|
||||
apiurl = store_read_apiurl(wd)
|
||||
|
||||
print '\n'.join(get_prj_results(apiurl, project, hide_legend=opts.hide_legend, csv=opts.csv, status_filter=opts.status_filter, name_filter=opts.name_filter))
|
||||
print '\n'.join(get_prj_results(apiurl, project, hide_legend=opts.hide_legend, csv=opts.csv, status_filter=opts.status_filter, name_filter=opts.name_filter, repo=opts.repo, arch=opts.arch))
|
||||
|
||||
|
||||
@cmdln.option('-q', '--hide-legend', action='store_true',
|
||||
|
@ -3274,7 +3274,7 @@ def get_results(apiurl, prj, package, lastbuild=None, repository=[], arch=[]):
|
||||
r.append(result_line_templ % rmap)
|
||||
return r
|
||||
|
||||
def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=None, name_filter=None):
|
||||
def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=None, name_filter=None, arch=None, repo=None):
|
||||
#print '----------------------------------------'
|
||||
|
||||
r = []
|
||||
@ -3296,6 +3296,11 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non
|
||||
pacs.append(node.get('package'))
|
||||
pacs.sort()
|
||||
for node in root.findall('result'):
|
||||
# filter architecture and repository
|
||||
if arch != None and arch != node.get('arch'):
|
||||
continue
|
||||
if repo != None and repo != node.get('repository'):
|
||||
continue
|
||||
tg = (node.get('repository'), node.get('arch'))
|
||||
targets.append(tg)
|
||||
for pacnode in node.findall('status'):
|
||||
|
Loading…
Reference in New Issue
Block a user