1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-27 07:06:13 +01:00

add option to request former build status due to popular request.

(Requires an OBS > 1.5)
This commit is contained in:
Adrian Schröter 2009-02-18 09:53:38 +00:00
parent c3136c8bf5
commit 85d53187cf
2 changed files with 9 additions and 4 deletions

View File

@ -1594,6 +1594,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print '\n'.join(get_results(pac.apiurl, pac.prjname, pac.name))
@cmdln.option('-l', '--last-build', action='store_true',
help='show last build results (succeeded/failed/unknown)')
def do_rresults(self, subcmd, opts, prj, pkg):
"""${cmd_name}: Shows the build results of a remote package
@ -1606,7 +1609,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
"""
apiurl = conf.config['apiurl']
print '\n'.join(get_results(apiurl, prj, pkg))
print '\n'.join(get_results(apiurl, prj, pkg, opts.last_build))
@cmdln.option('-q', '--hide-legend', action='store_true',

View File

@ -2594,10 +2594,12 @@ def get_binarylist_published(apiurl, prj, repo, arch):
return r
def show_results_meta(apiurl, prj, package=None):
def show_results_meta(apiurl, prj, package=None, lastbuild=None):
query = None
if package:
query = { 'package': package }
if lastbuild:
query['lastbuild'] = 1
u = makeurl(apiurl, ['build', prj, '_result'], query=query)
f = http_GET(u)
return f.readlines()
@ -2609,11 +2611,11 @@ def show_prj_results_meta(apiurl, prj):
return f.readlines()
def get_results(apiurl, prj, package):
def get_results(apiurl, prj, package, lastbuild=None):
r = []
result_line_templ = '%(rep)-15s %(arch)-10s %(status)s'
f = show_results_meta(apiurl, prj, package=package)
f = show_results_meta(apiurl, prj, package=package, lastbuild=lastbuild)
tree = ET.parse(StringIO(''.join(f)))
root = tree.getroot()