summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RELEASE_NOTES1
-rw-r--r--debian/changelog3
-rw-r--r--packaging/repa.changes3
-rwxr-xr-xrepa/group.py3
-rw-r--r--repa/obs.py25
5 files changed, 33 insertions, 2 deletions
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 6e98e42..755faa8 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -24,6 +24,7 @@ Release notes for repa 0.2
* repa list: Fixed formatting of output for repa list
* repa group: Fix check for common packages
* repa list: Fix build status reporting
+ * repa group: disable publishing when aggregating packages
Release notes for repa 0.1.1
diff --git a/debian/changelog b/debian/changelog
index 506fa3b..ae88b25 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -27,8 +27,9 @@ repa (0.2) unstable; urgency=low
* common.py: Introduced get_prerelease_projects API
* Implement repa diff
* Correct man page for accept and reject subcommands
+ * group: disable publishing when aggregating packages
- -- Ed Bartosh <eduard.bartosh@intel.com> Sat, 29 Mar 2014 21:19:01 +0200
+ -- Ed Bartosh <eduard.bartosh@intel.com> Wed, 21 May 2014 17:05:10 +0200
repa (0.1.1) unstable; urgency=low
diff --git a/packaging/repa.changes b/packaging/repa.changes
index b018e36..c1d32b8 100644
--- a/packaging/repa.changes
+++ b/packaging/repa.changes
@@ -1,4 +1,4 @@
-* Tue May 20 2014 Ed Bartosh <eduard.bartosh@intel.com> 0.2
+* Tue May 21 2014 Ed Bartosh <eduard.bartosh@intel.com> 0.2
- Implement --processes options for repa list (Fixes: #1762)
- obs/get_projects: retry OBS operations
- Reduce amount of information in repa list output
@@ -28,6 +28,7 @@
- Implement repa diff
- Correct man page for accept and reject subcommands
- Convert repa.changes into rpm format
+- group: disable publishing when aggregating packages
* Tue Mar 18 2014 Ed Bartosh <eduard.bartosh@intel.com> 0.1.1
- Fixed crash when rejecting broken package
diff --git a/repa/group.py b/repa/group.py
index 188d82e..363e86f 100755
--- a/repa/group.py
+++ b/repa/group.py
@@ -112,6 +112,7 @@ def create_group_project(obs, submissions, meta, comment):
def aggregate(obs, bresults, gproject):
"""Aggregate packages into group project."""
aggregated = set()
+ obs.set_global_flag('publish', 'disable', gproject)
for subm, prj, results in bresults:
for res in results.itervalues():
for pkg, state in res['packages']:
@@ -120,6 +121,8 @@ def aggregate(obs, bresults, gproject):
obs.aggregate_package(prj, pkg, gproject, pkg)
aggregated.add(pkg)
+ obs.set_global_flag('publish', 'enable', gproject)
+
return aggregated
diff --git a/repa/obs.py b/repa/obs.py
index 61b9e20..3cf7663 100644
--- a/repa/obs.py
+++ b/repa/obs.py
@@ -212,3 +212,28 @@ class OBS(OSC):
for sr in root.findall('request'):
yield sr.get('id'), sr.find('state').get('name'), \
sr.find('description').text
+
+ def set_global_flag(self, flag, value, prj, pkg=None):
+ """
+ Set global flag in meta
+ Supported flag: publish,build,useforbuild,debuginfo
+ Supported values: enable,disable
+ """
+ supported_flags = ('publish', 'build', 'useforbuild', 'debuginfo')
+ if flag not in supported_flags:
+ raise RepaException("flag %s is not supported. "
+ "supported flags: %s" % \
+ (flag, ', '.join(supported_flags)))
+ supported_vals = ('enable', 'disable')
+ if value not in supported_vals:
+ raise RepaException("value %s is not supported. "
+ "supported values: %s" % \
+ (value, ', '.join(supported_vals)))
+ meta = self.get_meta(prj, pkg)
+ root = ET.fromstring(meta)
+ elem = root.find(flag)
+ if elem is None:
+ elem = ET.SubElement(root, flag)
+ elem.clear()
+ ET.SubElement(elem, value)
+ self.set_meta(ET.tostring(root), prj, pkg)