summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Bartosh <eduard.bartosh@intel.com>2014-05-26 13:59:43 +0300
committerEd Bartosh <eduard.bartosh@intel.com>2014-05-26 13:59:43 +0300
commitbb846affc10167c2af2a34eddf7e00e0761fc91b (patch)
treefccf0970599833cf71738e1960fb0e4ab656292e
parentb551eee625e65cf767041edda40ff879ec28b9cb (diff)
downloadrepa-bb846affc10167c2af2a34eddf7e00e0761fc91b.tar.gz
repa-bb846affc10167c2af2a34eddf7e00e0761fc91b.tar.bz2
repa-bb846affc10167c2af2a34eddf7e00e0761fc91b.zip
Skip conflicting submissions when creating a group
It's hard for users to create the group with many submissions as every time conflict is found group creation fails and they have to start grouping again, removing conflicting submission. This change makes repa to skip conflicting submission and continue group creation without it. It should simplify and spead up RE work a lot. Change-Id: I5a08059849e63e7fb8a07e4b05f9c81846d8af57 Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
-rwxr-xr-xrepa/group.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/repa/group.py b/repa/group.py
index 363e86f..2778491 100755
--- a/repa/group.py
+++ b/repa/group.py
@@ -68,9 +68,11 @@ def check_binary_pkgs(obs, submissions, force=False):
"""
Check if submissions have common binary packages.
Check if binary packages exist.
+ Returns: list of non-conflicting submissions
"""
binaries = defaultdict(dict)
- for submission, data in submissions.iteritems():
+ result = set(submissions.keys())
+ for submission, data in sorted(submissions.iteritems()):
pkgs = list(obs.get_binary_packages(data['project']))
# check if submission has binary packages
for repo, bins in pkgs:
@@ -83,10 +85,16 @@ def check_binary_pkgs(obs, submissions, force=False):
if repo in info:
common = set(info[repo]).intersection(bins)
if common:
- msg = '%s and %s have common packages: %s' % \
- (subm, submission, ','.join(common))
- raise RepaException(msg)
- binaries[submission][repo] = bins
+ print '%s and %s have %d common packages,' \
+ ' skipping %s' % (subm, submission,
+ len(common), submission)
+ if submission in result:
+ result.remove(submission)
+ break
+ else:
+ binaries[submission][repo] = bins
+
+ return result
def create_group_project(obs, submissions, meta, comment):
@@ -143,7 +151,10 @@ def group_submissions(obs, submissions, target, comment, force=False):
for subm, data in info.iteritems()]
check_build_results(bresults)
- check_binary_pkgs(obs, info, force)
+ # filter out conflicting submissions
+ filtered = check_binary_pkgs(obs, info, force)
+ bresults = [item for item in bresults if item[0] in filtered]
+ info = dict(item for item in info.iteritems() if item[0] in filtered)
# create group project
name, gproject = create_group_project(obs, info.keys(),