mirror of
https://github.com/openSUSE/osc.git
synced 2025-11-18 19:48:20 +01:00
fix and rename osc pr --show-non-building
fix osc pr --show-non-building to actually do what it is supposed to do. Change default to not do filtering by renaming the option to --hide-disabled
This commit is contained in:
@@ -3335,8 +3335,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
help='show results only for specified repo(s)')
|
help='show results only for specified repo(s)')
|
||||||
@cmdln.option('-V', '--vertical', action='store_true',
|
@cmdln.option('-V', '--vertical', action='store_true',
|
||||||
help='list packages vertically instead horizontally')
|
help='list packages vertically instead horizontally')
|
||||||
@cmdln.option('-S', '--show-non-building', action='store_true',
|
@cmdln.option('--hide-disabled', action='store_true',
|
||||||
help='Show also packages which are build disabled or excluded')
|
help='hide packages that are disabled or excluded in all repos, also hide repos that have only disabled or excluded packages')
|
||||||
@cmdln.alias('pr')
|
@cmdln.alias('pr')
|
||||||
def do_prjresults(self, subcmd, opts, *args):
|
def do_prjresults(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: Shows project-wide build results
|
"""${cmd_name}: Shows project-wide build results
|
||||||
@@ -3358,7 +3358,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
wd = os.curdir
|
wd = os.curdir
|
||||||
project = store_read_project(wd)
|
project = store_read_project(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, repo=opts.repo, arch=opts.arch, vertical=opts.vertical, show_non_building=opts.show_non_building))
|
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, vertical=opts.vertical, hide_disabled=opts.hide_disabled))
|
||||||
|
|
||||||
|
|
||||||
@cmdln.option('-q', '--hide-legend', action='store_true',
|
@cmdln.option('-q', '--hide-legend', action='store_true',
|
||||||
|
|||||||
18
osc/core.py
18
osc/core.py
@@ -3892,7 +3892,7 @@ def get_results(apiurl, prj, package, lastbuild=None, repository=[], arch=[], ve
|
|||||||
|
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=None, name_filter=None, arch=None, repo=None, vertical=None, show_non_building=None):
|
def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=None, name_filter=None, arch=None, repo=None, vertical=None, hide_disabled=None):
|
||||||
#print '----------------------------------------'
|
#print '----------------------------------------'
|
||||||
|
|
||||||
r = []
|
r = []
|
||||||
@@ -3931,7 +3931,7 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non
|
|||||||
targets.sort()
|
targets.sort()
|
||||||
|
|
||||||
# filter option
|
# filter option
|
||||||
if status_filter or name_filter or not show_non_building:
|
if status_filter or name_filter or hide_disabled:
|
||||||
|
|
||||||
pacs_to_show = []
|
pacs_to_show = []
|
||||||
targets_to_show = []
|
targets_to_show = []
|
||||||
@@ -3958,15 +3958,19 @@ def get_prj_results(apiurl, prj, hide_legend=False, csv=False, status_filter=Non
|
|||||||
pacs_to_show.append(pkg)
|
pacs_to_show.append(pkg)
|
||||||
|
|
||||||
#filter non building states
|
#filter non building states
|
||||||
elif not show_non_building:
|
elif hide_disabled:
|
||||||
|
enabled = {}
|
||||||
for pkg in status.keys():
|
for pkg in status.keys():
|
||||||
print "RUN for", pkg
|
showpkg = False
|
||||||
for repo in status[pkg].keys():
|
for repo in status[pkg].keys():
|
||||||
if status[pkg][repo] != "excluded" and status[pkg][repo] != "disabled":
|
if status[pkg][repo] != "excluded" and status[pkg][repo] != "disabled":
|
||||||
pacs_to_show.append(pkg)
|
enabled[repo] = 1
|
||||||
targets_to_show.append(repo)
|
showpkg = True
|
||||||
break
|
|
||||||
|
|
||||||
|
if showpkg:
|
||||||
|
pacs_to_show.append(pkg)
|
||||||
|
|
||||||
|
targets_to_show = enabled.keys()
|
||||||
|
|
||||||
pacs = [ i for i in pacs if i in pacs_to_show ]
|
pacs = [ i for i in pacs if i in pacs_to_show ]
|
||||||
if len(targets_to_show):
|
if len(targets_to_show):
|
||||||
|
|||||||
Reference in New Issue
Block a user