From 0042855237fe4d948ccbc510ccfc2da22fc358cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 29 Apr 2010 15:37:47 +0200 Subject: [PATCH] fix creation of package link, when target project has the package via linked project. We might have this also in other places, it is not enough anymore to check for the existens of a package _meta file, we need also to check the "project" attribute, if it really comes from this project. --- NEWS | 1 + osc/core.py | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 84f90a60..845f3f30 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ - --csv/--format options for results command - using format user can explicitly specify what he wants print - support for "unresolvable" state of OBS 2.0 - osc branch reads project/package in package directory + - fix creation of package link, when target project has the package via linked project 0.126 - added VM autosetup to osc. This requires appropriate OBS version and build script version. diff --git a/osc/core.py b/osc/core.py index ac64563f..f0f86b6c 100644 --- a/osc/core.py +++ b/osc/core.py @@ -3176,10 +3176,17 @@ def link_pac(src_project, src_package, dst_project, dst_package, force, rev='', path_args=(quote_plus(dst_project), quote_plus(dst_package)), template_args=None, create_new=False, apiurl=conf.config['apiurl']) + root = ET.fromstring(''.join(dst_meta)) + print root.attrib['project'] + if root.attrib['project'] != dst_project: + # The source comes from a different project via a project link, we need to create this instance + meta_change = True except: + meta_change = True + + if meta_change: src_meta = show_package_meta(conf.config['apiurl'], src_project, src_package) dst_meta = replace_pkg_meta(src_meta, dst_package, dst_project) - meta_change = True if disable_publish: meta_change = True @@ -3190,6 +3197,7 @@ def link_pac(src_project, src_package, dst_project, dst_package, force, rev='', elm.clear() ET.SubElement(elm, 'disable') dst_meta = ET.tostring(root) + if meta_change: edit_meta('pkg', path_args=(dst_project, dst_package),