From 27b24a489f0b18df9cf49b82efb60f64096ea089 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Mar 24 2017 08:24:50 +0000 Subject: Handle noarch debuginfo packages Pull debuginfo packages for noarch packages as well, but only when the debuginfo is noarch as well. Signed-off-by: Lubomír Sedlář --- diff --git a/pungi/gather_dnf.py b/pungi/gather_dnf.py index b90a708..46dcf42 100644 --- a/pungi/gather_dnf.py +++ b/pungi/gather_dnf.py @@ -550,29 +550,33 @@ class Gather(GatherBase): for pkg in self.result_binary_packages: assert pkg is not None - if self.is_noarch_package(pkg): - self.finished_add_debug_packages[pkg] = [] - continue - if pkg in self.finished_add_debug_packages: continue - debug_pkgs = [] + candidates = [] if pkg.sourcerpm: if self.is_native_package(pkg): - debug_pkgs = self.native_debug_packages_cache.get(pkg.sourcerpm) + candidates = self.native_debug_packages_cache.get(pkg.sourcerpm) else: - debug_pkgs = self.multilib_debug_packages_cache.get(pkg.sourcerpm) + candidates = self.multilib_debug_packages_cache.get(pkg.sourcerpm) - if not debug_pkgs: + if not candidates: continue + debug_pkgs = [] lookaside = self._has_flag(pkg, PkgFlag.lookaside) - for i in debug_pkgs: + for i in candidates: + if pkg.arch == 'noarch' and i.arch != 'noarch': + # If the package is noarch, we will only pull debuginfo if + # it's noarch as well. This covers mingw use case, but + # means we don't for example pull debuginfo just because of + # -doc subpackage. + continue if lookaside: self._set_flag(i, PkgFlag.lookaside) if i not in self.result_debug_packages: added.add(i) + debug_pkgs.append(i) self.finished_add_debug_packages[pkg] = debug_pkgs self.result_debug_packages.update(debug_pkgs) diff --git a/tests/test_gather.py b/tests/test_gather.py index 4de2c96..5906978 100644 --- a/tests/test_gather.py +++ b/tests/test_gather.py @@ -1699,14 +1699,6 @@ class DNFDepsolvingTestCase(DepsolvingBase, unittest.TestCase): self.get_langpacks = True super(DNFDepsolvingTestCase, self).test_langpacks() - @unittest.skip('Not implemented yet') - def test_noarch_debuginfo(self): - """ - Noarch packages do not pull in any debuginfo. Removing the check breaks - test_bash_multilib, because dummy-bash-doc.noarch ultimately drags in - dummy-bash-debuginfo.x86_64 as well. - """ - @unittest.skip('DNF code does not support NVR as input') def test_bash_older(self): pass