From 217db3c20ca1b94b995728f1a203e883b52c2000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 13 Jan 2010 13:35:45 +0100 Subject: [PATCH] show scheduler state for each repo with "results" and "prjresults" --- NEWS | 1 + osc/core.py | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 3ce7e455..dc7f2f71 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ - new config option 'submitrequest_on_accept_action' to specify a default action if a submitrequest has been accepted - add "osc linktobranch" command to convert a classic link to a branch package + - show scheduler state for each repo with "results" and "prjresults" 0.124 - added 'osc bugowner' as a more intelligent version of 'osc maintainer -B' diff --git a/osc/core.py b/osc/core.py index a465d20e..c1dd64a8 100644 --- a/osc/core.py +++ b/osc/core.py @@ -3452,6 +3452,8 @@ def get_results(apiurl, prj, package, lastbuild=None, repository=[], arch=[]): rmap['pac'] = package rmap['rep'] = node.get('repository') rmap['arch'] = node.get('arch') + rmap['state'] = node.get('state') + rmap['dirty'] = node.get('dirty') statusnode = node.find('status') try: @@ -3467,6 +3469,11 @@ def get_results(apiurl, prj, package, lastbuild=None, repository=[], arch=[]): rmap['status'] += ': %s' % apiurl + \ '/build/%(prj)s/%(rep)s/%(arch)s/%(pac)s/_log' % rmap + if rmap['dirty'] == 'true': + rmap['status'] += ' (outdated)' + else: + rmap['status'] += ' (repository is %s)' % rmap['state'] + r.append(result_line_templ % rmap) return r @@ -3496,7 +3503,11 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non continue if repo != None and repo != node.get('repository'): continue - tg = (node.get('repository'), node.get('arch')) + if node.get('dirty') == "true": + state = "outdated" + else: + state = node.get('state') + tg = (node.get('repository'), node.get('arch'), state) targets.append(tg) for pacnode in node.findall('status'): pac = pacnode.get('package') @@ -3572,7 +3583,7 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non buildstatus_symbols[status[pac][tg]] = '?' line.append(st) line.append(' ') - line.append(' %s %s' % tg) + line.append(' %s %s (%s)' % tg) line = ''.join(line) r.append(line)