Licence: GPL version 2
Author: Ed Bartosh <eduard.bartosh@intel.com>
-OBS module.
+OBS module.
Interface module to access Open Build System.
This module is a intermediate step for new APIs
should be contributed to oscapi.
"""
+import sys
import re
from base64 import b64encode
from xml.etree import cElementTree as ET
+from StringIO import StringIO
from osc import core
if node.get('code') != 'excluded':
pkgresults.append((node.get('package'), code))
buildres[key]['packages'] = pkgresults
-
+
return buildres
+
+ def get_source_packages(self, prj):
+ """Get list of binary packages in the project."""
+ return iter(core.meta_get_packagelist(self.apiurl, prj))
+
+
+ def get_binary_packages(self, prj):
+ """Get list of binary packages in the project."""
+ for repo in core.get_repos_of_project(self.apiurl, prj):
+ yield (repo.name, repo.arch), core.get_binarylist(self.apiurl,
+ prj,
+ repo.name,
+ repo.arch)
+
+ @staticmethod
+ def aggregate_package(src_project, src_package, dst_project,
+ dst_package):
+ """Aggregate package. Wraps core.aggregate_pack."""
+ saved = sys.stdout
+ sys.stdout = StringIO()
+ try:
+ core.aggregate_pac(src_project, src_package,
+ dst_project, dst_package)
+ finally:
+ sys.stdout = saved