From 1f4f6ceb08df25443363bd5668d0692aecf4882f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 18 Oct 2016 09:00:10 +0200 Subject: [PATCH] metadata: Correctly clone buildinstall .treeinfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lorax/buildinstall produce .treeinfo file that is cloned into the compose dir. However since lorax runs separately for each arch, the files are nested in a subdirectory. With old buildinstall method, this causes the file to not be found and copied. Signed-off-by: Lubomír Sedlář --- pungi/metadata.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pungi/metadata.py b/pungi/metadata.py index 7679ec7d..a18c1fe1 100644 --- a/pungi/metadata.py +++ b/pungi/metadata.py @@ -279,7 +279,15 @@ def write_tree_info(compose, arch, variant, timestamp=None): os_tree = compose.paths.compose.os_tree(arch, variant) # clone all but 'general' sections from buildinstall .treeinfo - bi_treeinfo = os.path.join(compose.paths.work.buildinstall_dir(arch), variant.uid, ".treeinfo") + + bi_dir = compose.paths.work.buildinstall_dir(arch) + if compose.conf['buildinstall_method'] == 'lorax': + # The .treeinfo file produced by lorax is nested in variant + # subdirectory. Legacy buildinstall runs once per arch, so there is + # only one file. + bi_dir = os.path.join(bi_dir, variant.uid) + bi_treeinfo = os.path.join(bi_dir, ".treeinfo") + if os.path.exists(bi_treeinfo): bi_ti = LoraxTreeInfo() bi_ti.load(bi_treeinfo)