From 761a0ef40e751d24cb9e8cd259937a7621546049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 10 Aug 2016 09:32:39 +0200 Subject: [PATCH] Improve error messages for gathering packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When package has incompatible arch for a tree, the same error message could be raised from two different places. This patch adds more information to the message, so that it is easier to find the actual problem. Signed-off-by: Lubomír Sedlář --- pungi/phases/gather/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pungi/phases/gather/__init__.py b/pungi/phases/gather/__init__.py index 2f12e58b..d3b39a16 100644 --- a/pungi/phases/gather/__init__.py +++ b/pungi/phases/gather/__init__.py @@ -425,7 +425,9 @@ def get_prepopulate_packages(compose, arch, variant): for i in packages: pkg_name, pkg_arch = split_name_arch(i) if pkg_arch not in get_compatible_arches(arch, multilib=True): - raise ValueError("Incompatible package arch '%s' for tree arch '%s'" % (pkg_arch, arch)) + raise ValueError( + "Incompatible package arch '%s' for tree arch '%s' in prepopulate package '%s'" + % (pkg_arch, arch, pkg_name)) result.add(i) return result @@ -435,7 +437,9 @@ def get_additional_packages(compose, arch, variant): for i in get_arch_variant_data(compose.conf, "additional_packages", arch, variant): pkg_name, pkg_arch = split_name_arch(i) if pkg_arch is not None and pkg_arch not in get_compatible_arches(arch, multilib=True): - raise ValueError("Incompatible package arch '%s' for tree arch '%s'" % (pkg_arch, arch)) + raise ValueError( + "Incompatible package arch '%s' for tree arch '%s' in additional package '%s'" + % (pkg_arch, arch, pkg_name)) result.add((pkg_name, pkg_arch)) return result