Skip to content

Commit

Permalink
Fix upgrade from file to noarch pkg (RhBug:2006018)
Browse files Browse the repository at this point in the history
= changelog =
msg: Fix upgrade pkg from file when installed pkg is noarch and upgrades
to a different arch
type: bugfix
resolves: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=2006018
  • Loading branch information
inknos authored and m-blaha committed Aug 15, 2022
1 parent 5b319fa commit 7b52f20
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dnf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,11 @@ def package_upgrade(self, pkg):
sltr.set(pkg=[pkg])
self._goal.upgrade(select=sltr)
return 1
q = installed.filter(name=pkg.name, arch=[pkg.arch, "noarch"])
# do not filter by arch if the package is noarch
if pkg.arch == "noarch":
q = installed.filter(name=pkg.name)
else:
q = installed.filter(name=pkg.name, arch=[pkg.arch, "noarch"])
if not q:
msg = _("Package %s not installed, cannot update it.")
logger.warning(msg, pkg.name)
Expand Down

0 comments on commit 7b52f20

Please sign in to comment.