gather: Use arch packages in nodeps method

We already filtered a list of packages compatible with the architecture.
There's no need to do that again (with bugs). Instead of using the
global package set we should just restrict the code to an arch package
set.

This should not break anything. If a package is included such that it's
in global but not arch package set, the compose would crash as linking
packages takes paths from the arch package set.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-11-13 10:21:43 +01:00
parent f4c3d2423d
commit 68a1370036
1 changed files with 7 additions and 11 deletions

View File

@ -35,7 +35,7 @@ class GatherMethodNodeps(pungi.phases.gather.method.GatherMethodBase):
def worker(self, log, arch, variant, pkgs, groups, filter_packages,
multilib_whitelist, multilib_blacklist, package_sets,
path_prefix=None, fulltree_excludes=None, prepopulate=None):
global_pkgset = package_sets["global"]
pkgset = package_sets[arch]
result = {
"rpm": [],
"srpm": [],
@ -55,12 +55,10 @@ class GatherMethodNodeps(pungi.phases.gather.method.GatherMethodBase):
compatible_arches[i] = pungi.arch.get_compatible_arches(i)
log.write('\nGathering rpms\n')
for i in global_pkgset:
pkg = global_pkgset[i]
for i in pkgset:
pkg = pkgset[i]
if not pkg_is_rpm(pkg):
continue
if pkg.arch not in valid_arches:
continue
for gathered_pkg, pkg_arch in packages:
if isinstance(gathered_pkg, six.string_types) and pkg.name != gathered_pkg:
continue
@ -79,8 +77,8 @@ class GatherMethodNodeps(pungi.phases.gather.method.GatherMethodBase):
% (pkg, gathered_pkg, pkg_arch, pkg.sourcerpm))
log.write('\nGathering source rpms\n')
for i in global_pkgset:
pkg = global_pkgset[i]
for i in pkgset:
pkg = pkgset[i]
if not pkg_is_srpm(pkg):
continue
if pkg.file_name in seen_srpms:
@ -91,10 +89,8 @@ class GatherMethodNodeps(pungi.phases.gather.method.GatherMethodBase):
log.write('Adding %s\n' % pkg)
log.write('\nGathering debuginfo packages\n')
for i in global_pkgset:
pkg = global_pkgset[i]
if pkg.arch not in valid_arches:
continue
for i in pkgset:
pkg = pkgset[i]
if not pkg_is_debug(pkg):
continue
if pkg.sourcerpm not in seen_srpms: