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

View File

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