diff --git a/doc/configuration.rst b/doc/configuration.rst index 65226de2..3c9f66d1 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -911,7 +911,8 @@ Options **gather_source_mapping** (*str*) -- JSON mapping with initial packages for the compose. The value should be a path to JSON file with following mapping: ``{variant: {arch: - {rpm_name: [rpm_arch|None]}}}``. + {rpm_name: [rpm_arch|None]}}}``. Relative paths are interpreted relative to + the location of main config file. **gather_profiler** = False (*bool*) -- When set to ``True`` the gather tool will produce additional diff --git a/pungi/phases/gather/sources/source_json.py b/pungi/phases/gather/sources/source_json.py index 819ba25a..b336f9b5 100644 --- a/pungi/phases/gather/sources/source_json.py +++ b/pungi/phases/gather/sources/source_json.py @@ -32,6 +32,7 @@ set([(rpm_name, rpm_arch or None)]) import json +import os import pungi.phases.gather.source @@ -41,7 +42,7 @@ class GatherSourceJson(pungi.phases.gather.source.GatherSourceBase): json_path = self.compose.conf.get("gather_source_mapping") if not json_path: return set(), set() - with open(json_path, "r") as f: + with open(os.path.join(self.compose.config_dir, json_path), "r") as f: mapping = json.load(f) packages = set()