Skip to content

Commit

Permalink
installonlypkgs: do not reinstall local pkgs. BZ 1689025
Browse files Browse the repository at this point in the history
This commit fixes the following scenario:

$ rpm -q kernel
kernel-1
kernel-2
kernel-3
$ yum install /path/to/kernel-2.rpm
[...]
Reinstalling:
 kernel
[...]

The root case was that we would put the new kernel in the updatepkgs
list if there was an older kernel in the rpmdb, resulting in a reinstall
action.  To fix this, let's make sure we put it in installpkgs where it
belongs.  This makes yum just skip the installed kernel when doing a
local install, just like the regular install.

Note:  Ideally, we would simply move the other allowedMultipleInstalls()
stub in front of the loop to fix this.  We can't do that, however, since
exactarchlist would no longer be honored, causing a regression (even
though that would actually be correct and consistent with the regular
install command).
  • Loading branch information
dmnks committed Feb 12, 2020
1 parent 17dc522 commit c06a5ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yum/__init__.py
Expand Up @@ -5607,6 +5607,8 @@ def installLocal(self, pkg, po=None, updateonly=False):
if (installed_pkg.name in self.conf.exactarchlist
and po.arch != installed_pkg.arch):
donothingpkgs.append(po)
elif self.allowedMultipleInstalls(po):
installpkgs.append(po)
else:
updatepkgs.append((po, installed_pkg))
elif po.verEQ(installed_pkg):
Expand Down

0 comments on commit c06a5ce

Please sign in to comment.