Improve detection of lookaside packages
It is possible we only ever see a package from non-lookaside repo, but it actually is in lookaside. This patch should check for that before adding the package to result set. JIRA: RCM-71946 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
38c24b3038
commit
b8bb4f7daa
@ -291,6 +291,18 @@ class Gather(GatherBase):
|
|||||||
return [i for i in multilib_pkgs if i.sourcerpm == match.sourcerpm]
|
return [i for i in multilib_pkgs if i.sourcerpm == match.sourcerpm]
|
||||||
return [match]
|
return [match]
|
||||||
|
|
||||||
|
def is_from_lookaside(self, pkg):
|
||||||
|
if not self.opts.lookaside_repos:
|
||||||
|
return False
|
||||||
|
pkgs = self.dnf.sack.query().filter(
|
||||||
|
name=pkg.name,
|
||||||
|
version=pkg.version,
|
||||||
|
release=pkg.release,
|
||||||
|
arch=pkg.arch,
|
||||||
|
reponame=self.opts.lookaside_repos
|
||||||
|
)
|
||||||
|
return pkg in pkgs
|
||||||
|
|
||||||
def _add_packages(self, packages, pulled_by=None, req=None, reason=None, dest=None):
|
def _add_packages(self, packages, pulled_by=None, req=None, reason=None, dest=None):
|
||||||
dest = dest or self.result_binary_packages
|
dest = dest or self.result_binary_packages
|
||||||
for i in packages:
|
for i in packages:
|
||||||
@ -306,7 +318,7 @@ class Gather(GatherBase):
|
|||||||
self.logger.debug("Added package %s%s" % (i, pb))
|
self.logger.debug("Added package %s%s" % (i, pb))
|
||||||
dest.add(i)
|
dest.add(i)
|
||||||
# lookaside
|
# lookaside
|
||||||
if i.repoid in self.opts.lookaside_repos:
|
if self.is_from_lookaside(i):
|
||||||
self._set_flag(i, PkgFlag.lookaside)
|
self._set_flag(i, PkgFlag.lookaside)
|
||||||
if i.sourcerpm.rsplit('-', 2)[0] in self.opts.fulltree_excludes:
|
if i.sourcerpm.rsplit('-', 2)[0] in self.opts.fulltree_excludes:
|
||||||
self._set_flag(i, PkgFlag.fulltree_exclude)
|
self._set_flag(i, PkgFlag.fulltree_exclude)
|
||||||
|
Loading…
Reference in New Issue
Block a user