tools/osbuild-depsolve-dnf: extend default config with loaded

Instead of completely overriding the default solver configuration with
the one loaded from a file, just extend the default config. This will
allow to specify just desired config options and keeping the defaults
for the rest.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2025-02-04 18:07:27 +01:00 committed by Tomáš Hozza
parent cce8ee31c4
commit 99a7047173

View file

@ -20,7 +20,8 @@ config = {"use_dnf5": False}
config_path = os.environ.get("OSBUILD_SOLVER_CONFIG") or "/usr/lib/osbuild/solver.json"
try:
with open(config_path, encoding="utf-8") as f:
config = json.load(f)
loaded_config = json.load(f)
config.update(loaded_config)
except FileNotFoundError:
pass