summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Bartosh <eduard.bartosh@intel.com>2014-06-17 23:22:28 +0300
committerEd Bartosh <eduard.bartosh@intel.com>2014-06-17 23:56:12 +0300
commitc219d862f51ec9d31ce9ecd3e92e76592b5a6329 (patch)
tree2b5ba7fc2eeb17e1eebde60fd9d30b4189d34c6f
parentcd9994b28a7655f002c633e66053a0edd55f14d6 (diff)
downloadrepa-c219d862f51ec9d31ce9ecd3e92e76592b5a6329.tar.gz
repa-c219d862f51ec9d31ce9ecd3e92e76592b5a6329.tar.bz2
repa-c219d862f51ec9d31ce9ecd3e92e76592b5a6329.zip
Implement --noaggregate command line and config option
After adding arm targets to Tizen:IVI and Tizen:Common it became impossible for repa to create groups as every submission contains mic-bootstrap and qemu aggregated packages. Repa doesn't allow to group submissions if they contain the same packages. This is quite ugly solution. repa group should be refactored to allow proper implementation. With this line in config: 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 it should be possible to create groups again. Fixes: #1990 Change-Id: I4d13a95e6947634df87eead2821efbd943d85822 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
-rw-r--r--repa.111
-rwxr-xr-xrepa/group.py16
2 files changed, 21 insertions, 6 deletions
diff --git a/repa.1 b/repa.1
index dadeb4b..6a14762 100644
--- a/repa.1
+++ b/repa.1
@@ -285,6 +285,12 @@ Add comment to created submit group. It will be shown by list command.
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
.\"
@@ -389,6 +395,9 @@ showurls = off
.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
@@ -396,7 +405,7 @@ Mandatory options: apiurl, apiuser, apipasswd and project
.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
diff --git a/repa/group.py b/repa/group.py
index 49c8619..4a9c2e9 100755
--- a/repa/group.py
+++ b/repa/group.py
@@ -32,6 +32,7 @@ Group submissions.
import sys
import time
import json
+import re
from collections import defaultdict
from StringIO import StringIO
@@ -66,7 +67,7 @@ def check_build_results(bresults):
# 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.
@@ -82,6 +83,9 @@ def check_binary_pkgs(obs, submissions, force=False):
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,
@@ -91,7 +95,6 @@ def check_binary_pkgs(obs, submissions, force=False):
break
else:
binaries[submission][repo] = bins
-
return result
@@ -149,7 +152,7 @@ def aggregate(obs, bresults, gproject, processes):
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 = {}
@@ -167,7 +170,7 @@ def group_submissions(obs, submissions, target, comment,
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)
@@ -200,13 +203,16 @@ class Group(object):
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__':