From e3d7e987ab63d94aeabe12a239b7ec24ee80977d Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Mon, 9 Dec 2013 11:32:41 +0200 Subject: [PATCH] Fixed linking and unlinking repositories Linking and unlinking was changing only first repository in the project. The rest repos were left unchanged. Fixes: #1530 Change-Id: Ia40fc6249f244644375a1b71f2c9a8ddfccc2067 Signed-off-by: Ed Bartosh --- common/buildservice.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/common/buildservice.py b/common/buildservice.py index 2eef25a..97fa82d 100644 --- a/common/buildservice.py +++ b/common/buildservice.py @@ -496,10 +496,8 @@ class BuildService(OSC): {"project": "%s" %src}) xml_root.append(link_element) - # Modify repo attribute - repo_element = xml_root.find('repository') - - if repo_element is not None: + # Set linkedbuild attribute for all repositories + for repo_element in xml_root.findall('repository'): repo_element.set('linkedbuild', linktype) self.set_meta(ElementTree.tostring(xml_root), project) @@ -519,8 +517,8 @@ class BuildService(OSC): # remov linked project xml_root.remove(xml_root.find('link')) - # Modify repo attribute - repo_element = xml_root.find('repository') - repo_element.attrib.pop('linkedbuild') + # Remove linkedbuild attribute from all repositories + for repo_element in xml_root.findall('repository'): + repo_element.attrib.pop('linkedbuild') self.set_meta(ElementTree.tostring(xml_root), project) -- 2.7.4