From fe7a6c6181b65bdff6a66732ed5bb0fceb30721a Mon Sep 17 00:00:00 2001 From: Eugenio Paolantonio Date: Mon, 10 Jun 2024 16:15:07 +0200 Subject: [PATCH] osclib: freeze_command: handle 'product' repositories if used Some projects (such as SLFO) are using product-composer, and they build and publish in the 'product' repository. If the 'product' repository is configured in the project meta, ensure it gets configured when freezing the staging. Signed-off-by: Eugenio Paolantonio --- osclib/freeze_command.py | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/osclib/freeze_command.py b/osclib/freeze_command.py index 474a8125..7e5b83ac 100644 --- a/osclib/freeze_command.py +++ b/osclib/freeze_command.py @@ -154,6 +154,12 @@ class FreezeCommand(object): for lprj in links: ET.SubElement(root, 'link', {'project': lprj}) + # 'images' and 'product' repositories are closely related, + # and they need to be handled the same way. + image_repositories = ['images'] + if self.api.project_has_repo('product', self.prj): + image_repositories.append('product') + # build flag f = ET.SubElement(root, 'build') # this one is the global toggle @@ -161,12 +167,14 @@ class FreezeCommand(object): # this one stays ET.SubElement(f, 'disable', {'repository': 'bootstrap_copy'}) # to be flipped by botmaster - ET.SubElement(f, 'disable', {'repository': 'images'}) + for repository in image_repositories: + ET.SubElement(f, 'disable', {'repository': repository}) # publish flag f = ET.SubElement(root, 'publish') ET.SubElement(f, 'disable') - ET.SubElement(f, 'enable', {'repository': 'images'}) + for repository in image_repositories: + ET.SubElement(f, 'enable', {'repository': repository}) # debuginfo flag f = ET.SubElement(root, 'debuginfo') @@ -184,18 +192,20 @@ class FreezeCommand(object): a = ET.SubElement(r, 'arch') a.text = arch - r = ET.SubElement(root, 'repository', {'name': 'images', 'linkedbuild': 'all'}) - ET.SubElement(r, 'path', {'project': self.prj, 'repository': 'standard'}) + for repository in image_repositories: + r = ET.SubElement(root, 'repository', {'name': repository, 'linkedbuild': 'all'}) + ET.SubElement(r, 'path', {'project': self.prj, 'repository': 'standard'}) - if self.prj.startswith('SUSE:'): - a = ET.SubElement(r, 'arch') - a.text = 'local' - a = ET.SubElement(r, 'arch') - a.text = 'x86_64' + if self.prj.startswith('SUSE:'): + a = ET.SubElement(r, 'arch') + a.text = 'local' - if 'ppc64le' in self.api.cstaging_archs: a = ET.SubElement(r, 'arch') - a.text = 'ppc64le' + a.text = 'x86_64' + + if 'ppc64le' in self.api.cstaging_archs: + a = ET.SubElement(r, 'arch') + a.text = 'ppc64le' return ET.tostring(root)