From 77ee882c21bebda9890825ecf646d0d7ed3aee43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 18 May 2017 10:57:47 +0200 Subject: [PATCH] comps-wrapper: Fix crash on conditional packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A `requires` attribute is taken from a wrong package (because of a wrong variable used: `pkg` vs. `package`). On RHEL 6 this actually leads to a crash. Let's use only one name to avoid such problems. Signed-off-by: Lubomír Sedlář --- pungi/wrappers/comps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pungi/wrappers/comps.py b/pungi/wrappers/comps.py index 99469dc9..5c14b153 100644 --- a/pungi/wrappers/comps.py +++ b/pungi/wrappers/comps.py @@ -91,8 +91,8 @@ class CompsWrapper(object): packages_by_type[TYPE_MAPPING[pkg.type]].append(pkg) for type_name in TYPE_MAPPING.values(): - for package in sorted(packages_by_type[type_name], key=attrgetter('name')): - node = append(doc, packagelist, "packagereq", package.name, type=type_name) + for pkg in sorted(packages_by_type[type_name], key=attrgetter('name')): + node = append(doc, packagelist, "packagereq", pkg.name, type=type_name) if type_name == "conditional": node.setAttribute("requires", pkg.requires)