From 33d7290d780ab976f6d7a448778be534fdec5145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 10 Nov 2021 10:51:43 +0100 Subject: [PATCH] gather: Stop requiring all variants/arches in JSON MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The JSON source file should not require a mapping for all variants/architectures. When something is specified, it should be included. Signed-off-by: Lubomír Sedlář --- pungi/phases/gather/sources/source_json.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pungi/phases/gather/sources/source_json.py b/pungi/phases/gather/sources/source_json.py index 2be88eb0..819ba25a 100644 --- a/pungi/phases/gather/sources/source_json.py +++ b/pungi/phases/gather/sources/source_json.py @@ -48,12 +48,14 @@ class GatherSourceJson(pungi.phases.gather.source.GatherSourceBase): if variant is None: # get all packages for all variants for variant_uid in mapping: - for pkg_name, pkg_arches in mapping[variant_uid][arch].items(): + for pkg_name, pkg_arches in mapping[variant_uid].get(arch, {}).items(): for pkg_arch in pkg_arches: packages.add((pkg_name, pkg_arch)) else: # get packages for a particular variant - for pkg_name, pkg_arches in mapping[variant.uid][arch].items(): + for pkg_name, pkg_arches in ( + mapping.get(variant.uid, {}).get(arch, {}).items() + ): for pkg_arch in pkg_arches: packages.add((pkg_name, pkg_arch)) return packages, set()