Simplify add_multilib_package method

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-01-20 09:07:12 +01:00
parent cd80d6ef5a
commit a9415eb0e5

View File

@ -688,30 +688,29 @@ class Gather(GatherBase):
added = set() added = set()
for pkg in sorted(self.result_binary_packages): for pkg in sorted(self.result_binary_packages):
try: if pkg in self.finished_add_multilib_packages:
self.finished_add_multilib_packages[pkg] continue
except KeyError:
if pkg.arch in ("noarch", "src", "nosrc"): if pkg.arch in ("noarch", "src", "nosrc"):
self.finished_add_multilib_packages[pkg] = None self.finished_add_multilib_packages[pkg] = None
continue continue
if pkg.arch in self.dnf.arch_wrapper.multilib_arches: if pkg.arch in self.dnf.arch_wrapper.multilib_arches:
self.finished_add_multilib_packages[pkg] = None self.finished_add_multilib_packages[pkg] = None
continue continue
pkgs = self.q_multilib_binary_packages_cache.get(pkg.name, pkg.version, pkg.release) pkgs = self.q_multilib_binary_packages_cache.get(pkg.name, pkg.version, pkg.release)
pkgs = self._get_best_package(pkgs) pkgs = self._get_best_package(pkgs)
multilib_pkgs = [] multilib_pkgs = []
for i in pkgs: for i in pkgs:
is_multilib = self._multilib.is_multilib(i) is_multilib = self._multilib.is_multilib(i)
if is_multilib: if is_multilib:
multilib_pkgs.append(i) multilib_pkgs.append(i)
added.add(i) added.add(i)
self._set_flag(i, PkgFlag.multilib) self._set_flag(i, PkgFlag.multilib)
self._add_packages([i]) self._add_packages([i])
self.finished_add_multilib_packages[pkg] = i self.finished_add_multilib_packages[pkg] = i
# TODO: ^^^ may get multiple results; i686, i586, etc. # TODO: ^^^ may get multiple results; i686, i586, etc.
return added return added