path_args=path,
data=ElementTree.tostring(root))
+ def get_sourceinfo_list(self, prj):
+ """
+ Get source info list of the project
+ { package1: [],
+ package2: ['Source Project'/'Source Package'], # if linked package
+ ...}
+ """
+ query = {}
+ query['view'] = 'info'
+ query['parse'] = 0
+ query['nofilename'] = 1
+
+ url = core.makeurl(self.apiurl, ['source', prj], query)
+ _file = core.http_GET(url)
+ root = ElementTree.parse(_file).getroot()
+
+ s_dict = {}
+ for s in root.iter('sourceinfo'):
+ s_dict[s.get('package')] = \
+ ''.join([node.get('project') + '/' + node.get('package') for node in s.findall('linked')])
+ return s_dict
+
obs_pre_prj is the prelease project
pre_package is the original package
"""
- for package in build.get_package_list(obs_target_prj):
- link_prj, link_pkg = build.get_package_linkinfo(obs_target_prj, package)
- if link_prj == obs_target_prj and link_pkg == pre_package:
- build.create_link_pac(obs_pre_prj, pre_package, \
- obs_pre_prj, package)
+ sourceinfo = build.get_sourceinfo_list(obs_target_prj)
+ for package in sourceinfo:
+ if sourceinfo[package]:
+ link_prj, link_pkg = sourceinfo[package].split('/')
+ if link_prj == obs_target_prj and link_pkg == pre_package:
+ build.create_link_pac(obs_pre_prj, pre_package, \
+ obs_pre_prj, package)
def create_project(git_url, git_project, git_tag, git_revision, build,
obs_target_prj, obs_project, submitter, package):