gather: Stop pulling debuginfo and source for lookaside packages

If a package is in lookaside, we don't really need a debuginfo nor
source for it. Definitely we should not pull them from the package set
even if there is some suitable package. Therefore we should include them
in the output but marked as lookaside.

Fixes: https://pagure.io/pungi/issue/915
Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2018-04-18 14:12:40 +02:00
parent 58afece033
commit c07a4d64a1

View File

@ -608,7 +608,8 @@ class Gather(GatherBase):
if not source_pkg: if not source_pkg:
continue continue
if source_pkg.repoid in self.opts.lookaside_repos: if (source_pkg.repoid in self.opts.lookaside_repos
or pkg.repoid in self.opts.lookaside_repos):
self._set_flag(source_pkg, PkgFlag.lookaside) self._set_flag(source_pkg, PkgFlag.lookaside)
if source_pkg not in self.result_source_packages: if source_pkg not in self.result_source_packages:
added.add(source_pkg) added.add(source_pkg)
@ -641,6 +642,7 @@ class Gather(GatherBase):
continue continue
debug_pkgs = [] debug_pkgs = []
pkg_in_lookaside = pkg.repoid in self.opts.lookaside_repos
for i in candidates: for i in candidates:
if pkg.arch == 'noarch' and i.arch != 'noarch': if pkg.arch == 'noarch' and i.arch != 'noarch':
# If the package is noarch, we will only pull debuginfo if # If the package is noarch, we will only pull debuginfo if
@ -648,7 +650,7 @@ class Gather(GatherBase):
# means we don't for example pull debuginfo just because of # means we don't for example pull debuginfo just because of
# -doc subpackage. # -doc subpackage.
continue continue
if i.repoid in self.opts.lookaside_repos: if i.repoid in self.opts.lookaside_repos or pkg_in_lookaside:
self._set_flag(i, PkgFlag.lookaside) self._set_flag(i, PkgFlag.lookaside)
if i not in self.result_debug_packages: if i not in self.result_debug_packages:
added.add(i) added.add(i)