diff --git a/1310.patch b/1310.patch new file mode 100644 index 0000000..6394ef5 --- /dev/null +++ b/1310.patch @@ -0,0 +1,42 @@ +From e721c05849351762b912dca395655f75393b8cea Mon Sep 17 00:00:00 2001 +From: Lubomír Sedlář +Date: Dec 05 2019 13:28:34 +0000 +Subject: Avoid crash if a module is not available on all arches + + +Theoretically it is possible, and this is the bare minimum of changes +needed to survive such situation. There may be other pitfalls. + +Fixes: https://pagure.io/pungi/issue/1309 +JIRA: COMPOSE-4016 +Signed-off-by: Lubomír Sedlář + +--- + +diff --git a/pungi/phases/createrepo.py b/pungi/phases/createrepo.py +index e0a1da9..852af01 100644 +--- a/pungi/phases/createrepo.py ++++ b/pungi/phases/createrepo.py +@@ -198,7 +198,7 @@ def create_variant_repo(compose, arch, variant, pkg_type, pkgset, modules_metada + mod_index = Modulemd.ModuleIndex() + metadata = [] + +- for module_id, mmd in variant.arch_mmds[arch].items(): ++ for module_id, mmd in variant.arch_mmds.get(arch, {}).items(): + if modules_metadata: + module_rpms = mmd.get_rpm_artifacts() + metadata.append((module_id, module_rpms)) +diff --git a/pungi/phases/gather/sources/source_module.py b/pungi/phases/gather/sources/source_module.py +index 8e5de32..b2ef7ad 100644 +--- a/pungi/phases/gather/sources/source_module.py ++++ b/pungi/phases/gather/sources/source_module.py +@@ -38,7 +38,7 @@ class GatherSourceModule(pungi.phases.gather.source.GatherSourceBase): + + compatible_arches = pungi.arch.get_compatible_arches(arch, multilib=True) + +- for nsvc, module_stream in variant.arch_mmds[arch].items(): ++ for nsvc, module_stream in variant.arch_mmds.get(arch, {}).items(): + available_rpms = sum( + ( + variant.nsvc_to_pkgset[nsvc].rpms_by_arch.get(a, []) + diff --git a/pungi.spec b/pungi.spec index 9811094..8b78e18 100644 --- a/pungi.spec +++ b/pungi.spec @@ -2,12 +2,13 @@ Name: pungi Version: 4.1.41 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Distribution compose tool License: GPLv2 URL: https://pagure.io/pungi Source0: https://pagure.io/releases/%{name}/%{name}-%{version}.tar.bz2 +Patch0: https://pagure.io/pungi/pull-request/1310.patch BuildRequires: python3-nose BuildRequires: python3-mock @@ -141,6 +142,9 @@ nosetests-3 --exe %{_bindir}/%{name}-wait-for-signed-ostree-handler %changelog +* Thu Dec 05 2019 Lubomír Sedlář - 4.1.41-2 +- Avoid crash when module has limited arches + * Mon Dec 02 2019 Lubomír Sedlář - 4.1.41-1 - repoclosure: Parse all fus logs (lsedlar) - runroot: Log different commands to different files (lsedlar)