From c120c9bc36b703d5982ec87c96d83a50804ffde3 Mon Sep 17 00:00:00 2001 From: Giacomo Leidi Date: Mon, 13 May 2024 15:43:16 +0200 Subject: [PATCH] pkglistgen.py: Run productcomposer iif there's a *.productcompose.in file and a 000productcompose directory. Previously pkglistgen.py assumed that a project either used product-builder or the new product-composer, by exiting unrecoverably when a *.productcompose.in file was found but the relative 000productcompose directory was absent. This is not the case for SL Micro as the shared SLFO codebase is still an hybrid OBS/git project and hence its stagings are not git based and can't use product composer. This patch was tested for the SUSE:ALP:Source:Standard:1.0:Staging:A and SUSE:ALP:Products:Marble:6.0 projects (together with https://github.com/openSUSE/openSUSE-release-tools/pull/3078). Instead of raising an exception when the 000productcompose directory is not found it makes a log stating that product-composer will be skipped. --- pkglistgen/tool.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkglistgen/tool.py b/pkglistgen/tool.py index 22317b447..ac272466c 100644 --- a/pkglistgen/tool.py +++ b/pkglistgen/tool.py @@ -769,9 +769,7 @@ def update_and_solve_target( # new product-composer fn = os.path.join(group_dir, 'default.productcompose.in') - if os.path.isfile(fn): - if not os.path.isdir(self.productcompose_dir): - raise Exception('default.productcompose.in exists, but output directory is missing in git!') + if os.path.isfile(fn) and os.path.isdir(self.productcompose_dir): lines = open(fn).readlines() new_lines = [] for line in lines: @@ -789,6 +787,7 @@ def update_and_solve_target( else: # No template file, so we don't create one either self.skip_productcompose = True + logging.debug('skipping productcompose') logging.debug('-> do_update') # make sure we only calculcate existant architectures