diff options
author | Ed Bartosh <eduard.bartosh@intel.com> | 2014-06-12 15:54:45 +0300 |
---|---|---|
committer | Eduard Bartosh <eduard.bartosh@intel.com> | 2014-06-13 22:28:30 +0300 |
commit | 8f753c3be161fb07c77241748eedffab39220219 (patch) | |
tree | 38dcced8231a5132226f02fb58597eed3225302a | |
parent | eebc0561fb78a6277996c749f91861406398f5ab (diff) | |
download | repa-8f753c3be161fb07c77241748eedffab39220219.tar.gz repa-8f753c3be161fb07c77241748eedffab39220219.tar.bz2 repa-8f753c3be161fb07c77241748eedffab39220219.zip |
list: Implement --ignore command line option
This option gives user possibility to ignore broken state of
packages. For Tizen:Common and Tizen:IVI it's must have currently
as _aggregate packages are broken in prerelease projects because
of OBS bug. This causes wrong status reported for all submissions.
Change-Id: Iaac19a922a4b5996aff8d7cd277f20ec6868794c
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
-rw-r--r-- | repa.1 | 13 | ||||
-rwxr-xr-x | repa/list.py | 20 |
2 files changed, 25 insertions, 8 deletions
@@ -90,7 +90,7 @@ Turn on colorized output .\" .\" The "list" command description .\" -.SS \fBlist\fR [\-\-help] [\-\-processes <processes>] [\-\-showurls] +.SS \fBlist\fR [\-\-help] [\-\-processes <processes>] [\-\-showurls] [\-\-ignore <regexp>] .RS 2 List submissions in the following format: @@ -140,6 +140,12 @@ Show OBS and download urls in the output. It's switched off by default. Note, that this parameter can also be specified in \fIrepa\fR configuration file. .RE +.PP +.B \-\-ignore <regexp> +.RS 2 +Ignore packaging failures for specified regexp. <regexp> is a slash-separated string <repository>/<architecture>/<package>, for example arm.*/armv7./.*_aggregate. +Note, that this parameter can also be specified in \fIrepa\fR configuration file. +.RE .PP .\" @@ -380,6 +386,9 @@ color = off .RS 2 showurls = off .RE +.RS 2 +ignore = arm-.*/armv7./.*_aggregate$ +.RE .RS 2 @@ -387,7 +396,7 @@ Mandatory options: apiurl, apiuser, apipasswd and project .RE .RS 2 -Some options (project, processes, colorize, showurls) can be overridden by commandline options (--project, --processes, --colorize, --showurls) +Some options (project, processes, colorize, showurls, ignore) can be overridden by commandline options (--project, --processes, --colorize, --showurls, --ignore) .RE .SH BUGS diff --git a/repa/list.py b/repa/list.py index 28f602d..654672e 100755 --- a/repa/list.py +++ b/repa/list.py @@ -31,21 +31,26 @@ Get list of submissions. import sys import json +import re from repa.common import (OBS_PROJECT_PREFIX, Colorizer, get_download_url, get_obs_url) from repa.obs import OBS from repa.main import sub_main -def get_status(meta, colorizer, build_results=None): +def get_status(meta, colorizer, build_results=None, ignore=''): """Get overall status by analyzing package and image build status.""" if build_results: codes = set() - for target in build_results.itervalues(): + pkgstatus = {} + for (repo, arch), target in build_results.iteritems(): codes.add(target.get('code')) codes.add(target.get('state')) for pkginfo in target['packages']: - codes.add(pkginfo[1]) + # ignore packages if they match ignore regexp + if not (ignore and re.match(ignore, "%s/%s/%s" % \ + (repo, arch, pkginfo[0]))): + codes.add(pkginfo[1]) statuses = [('broken', ('red', 'broken source')), ('unresolvable', ('red', 'unresolvable packages')), @@ -81,7 +86,7 @@ def show_urls(meta): def list_submissions(obs, target, processes, is_colorize=False, - showurls=False): + showurls=False, ignore=''): """List submissions and groups.""" colorizer = Colorizer(is_colorize) # submissions @@ -95,7 +100,8 @@ def list_submissions(obs, target, processes, is_colorize=False, continue projects = [project.split('/')[-1] for project in meta['projects']] print '%-37s %-37s %s' % (meta['git_tag'], \ - get_status(meta, colorizer, build_results), ','.join(projects)) + get_status(meta, colorizer, build_results, ignore), + ','.join(projects)) if showurls: show_urls(meta) @@ -127,13 +133,15 @@ class List(object): parser.add_argument('--showurls', action='store_true', help='show OBS and download urls', default=config.get('showurls', '').lower() == 'on') + parser.add_argument('--ignore', default=config.get('ignore', ''), + help='ignore package failures by regexp') @staticmethod def run(argv): """Command line entry point. Called from [sub_]main""" obs = OBS(argv.apiurl, argv.apiuser, argv.apipasswd) return list_submissions(obs, argv.project, argv.processes, - argv.colorize, argv.showurls) + argv.colorize, argv.showurls, argv.ignore) if __name__ == '__main__': |