From b9523ff5b05db8ce1042794d3b480c131d4ae345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0abata?= Date: Wed, 4 Apr 2018 14:01:10 +0200 Subject: [PATCH] Handle relative paths in module_defaults_dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This now handles strings as well as sct_dicts with type=file that include relative paths. Signed-off-by: Petr Ĺ abata --- pungi/phases/init.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pungi/phases/init.py b/pungi/phases/init.py index a75ba689..e056255b 100644 --- a/pungi/phases/init.py +++ b/pungi/phases/init.py @@ -151,6 +151,11 @@ def create_comps_repo(compose, arch): def write_module_defaults(compose): scm_dict = compose.conf["module_defaults_dir"] + if isinstance(scm_dict, dict): + if scm_dict["scm"] == "file": + scm_dict["dir"] = os.path.join(compose.config_dir, scm_dict["dir"]) + else: + scm_dict = os.path.join(compose.config_dir, scm_dict) with temp_dir(prefix="moduledefaults_") as tmp_dir: get_dir_from_scm(scm_dict, tmp_dir, logger=compose._logger)