Force group creation for submissions without binary packages. Useful when grouping failed submissions for rejection.
.RE
+.PP
+\--noaggregate <regexp>
+.RS 2
+Do not aggregate binary packages matching regexp. This is useful to skip aggregates, propagated by OBS from target project to prerlease projects, e.g. qemu-accel-*, mic-bootstrap, etc.
+.RE
+
.\"
.\" The "rmgroup" command description
.\"
.RS 2
ignore = arm-.*/armv7./.*_aggregate$
.RE
+.RS 2
+noaggregate = mic-bootstrap-x86-arm.rpm|mic-bootstrap.rpm|mic-bootstrap-debugsource.rpm|qemu-accel-armv7l.rpm|qemu-accel-armv7l-cross-arm.rpm|qemu-linux-user-cross-arm.rpm
+.RE
.RS 2
.RE
.RS 2
-Some options (project, processes, colorize, showurls, ignore) can be overridden by commandline options (--project, --processes, --colorize, --showurls, --ignore)
+Some options (project, processes, colorize, showurls, ignore, noaggregate) can be overridden by commandline options (--project, --processes, --colorize, --showurls, --ignore, --noaggregate)
.RE
.SH BUGS
import sys
import time
import json
+import re
from collections import defaultdict
from StringIO import StringIO
# target project: for pkg, status in res['packages'] ...
-def check_binary_pkgs(obs, submissions, force=False):
+def check_binary_pkgs(obs, submissions, force=False, noaggregate=''):
"""
Check if submissions have common binary packages.
Check if binary packages exist.
for subm, info in binaries.iteritems():
if repo in info:
common = set(info[repo]).intersection(bins)
+ if common and noaggregate:
+ common = set(pkg for pkg in common \
+ if not re.match(noaggregate, pkg))
if common:
print '%s and %s have %d common packages,' \
' skipping %s' % (subm, submission,
break
else:
binaries[submission][repo] = bins
-
return result
def group_submissions(obs, submissions, target, comment,
- force=False, processes=0):
+ force=False, processes=0, noaggregate=''):
"""Group multiple submissions into one group."""
# find correspondent prerelease projects
info = {}
check_build_results(bresults)
# filter out conflicting submissions
- filtered = check_binary_pkgs(obs, info, force)
+ filtered = check_binary_pkgs(obs, info, force, noaggregate)
bresults = [item for item in bresults if item[0] in filtered]
info = dict(item for item in info.iteritems() if item[0] in filtered)
parser.add_argument('-c', '--comment', help='comment', default='')
parser.add_argument('-f', '--force', action='store_true',
help='force group creation')
+ parser.add_argument('--noaggregate', default=config.get('noaggregate', ''),
+ help='do not aggregate packages matching regexp')
@staticmethod
def run(argv):
"""Command line entry point. Called from [sub_]main."""
obs = OBS(argv.apiurl, argv.apiuser, argv.apipasswd)
return group_submissions(obs, argv.submission, argv.project,
- argv.comment, argv.force, argv.processes)
+ argv.comment, argv.force, argv.processes,
+ argv.noaggregate)
if __name__ == '__main__':