From cdc275741b7a42054043d09905a03efc71ae860a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Fri, 17 Jan 2025 11:17:45 +0100 Subject: [PATCH] extra_isos: Provide arch to extra files getter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The getter is already running once per architecture, it just doesn't make the information available to the scm wrapper. Signed-off-by: Lubomír Sedlář (cherry picked from commit 46d6c48e0a03146f05a996a9529cffbcbcc8447c) --- pungi/phases/extra_isos.py | 2 +- tests/test_extra_isos_phase.py | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pungi/phases/extra_isos.py b/pungi/phases/extra_isos.py index ca161b48..98883c5d 100644 --- a/pungi/phases/extra_isos.py +++ b/pungi/phases/extra_isos.py @@ -349,7 +349,7 @@ def get_extra_files(compose, variant, arch, extra_files): target_path = os.path.join(extra_files_dir, target).rstrip("/") filelist.extend( os.path.join(target, f) - for f in getter(scm_dict, target_path, compose=compose) + for f in getter(scm_dict, target_path, compose=compose, arch=arch) ) if filelist: diff --git a/tests/test_extra_isos_phase.py b/tests/test_extra_isos_phase.py index 52bf03b3..edffde77 100644 --- a/tests/test_extra_isos_phase.py +++ b/tests/test_extra_isos_phase.py @@ -537,7 +537,14 @@ class GetExtraFilesTest(helpers.PungiTestCase): self.assertEqual(get_dir.call_args_list, []) self.assertEqual( get_file.call_args_list, - [mock.call(cfg, os.path.join(self.dir, "legalese"), compose=self.compose)], + [ + mock.call( + cfg, + os.path.join(self.dir, "legalese"), + compose=self.compose, + arch=self.arch, + ) + ], ) self.assertEqual( populate_md.call_args_list, @@ -566,7 +573,14 @@ class GetExtraFilesTest(helpers.PungiTestCase): self.assertEqual(get_file.call_args_list, []) self.assertEqual( get_dir.call_args_list, - [mock.call(cfg, os.path.join(self.dir, "foo"), compose=self.compose)], + [ + mock.call( + cfg, + os.path.join(self.dir, "foo"), + compose=self.compose, + arch=self.arch, + ) + ], ) self.assertEqual( populate_md.call_args_list, @@ -601,8 +615,9 @@ class GetExtraFilesTest(helpers.PungiTestCase): cfg1, os.path.join(self.dir, "legalese"), compose=self.compose, + arch=self.arch, ), - mock.call(cfg2, self.dir, compose=self.compose), + mock.call(cfg2, self.dir, compose=self.compose, arch=self.arch), ], ) self.assertEqual(