From ec6206b06440e722172c4e8bb987f27d023bcf69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 7 Dec 2016 14:15:46 +0100 Subject: [PATCH] pungi: Fix --nosource option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When running with this option, if a debuginfo package is included in the final package set, there would be a crash due to missing SRPM. To replicate this issue, just use the argument with input kickstart listing a single package which has debuginfo. This is not an issue for Pungi 4, as it never uses the option in the first place. Signed-off-by: Lubomír Sedlář --- pungi/gather.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pungi/gather.py b/pungi/gather.py index fe3ddd7a..daf9582a 100644 --- a/pungi/gather.py +++ b/pungi/gather.py @@ -1158,7 +1158,11 @@ class Pungi(PungiBase): self.add_debuginfo(po, msg) # flags - srpm_po = self.sourcerpm_srpmpo_map[po.sourcerpm] + try: + srpm_po = self.sourcerpm_srpmpo_map[po.sourcerpm] + except: + self.logger.warning('Failed to find source for %s', po.sourcerpm) + srpm_po = None if srpm_po in self.input_packages: self.input_packages.add(po) if srpm_po in self.fulltree_packages: