yum: case for multilib when installing from a file (#32236)

This commit is contained in:
Martin Krizek 2017-11-09 12:04:53 +01:00 committed by ansibot
parent 38444bb76c
commit 356901b72d
2 changed files with 112 additions and 0 deletions

View file

@ -749,6 +749,18 @@ def install(module, items, repoq, yum_basecmd, conf_file, en_repos, dis_repos, i
(name, ver, rel, epoch, arch) = splitFilename(envra)
installed_pkgs = is_installed(module, repoq, name, conf_file, en_repos=en_repos, dis_repos=dis_repos, installroot=installroot)
# case for two same envr but differrent archs like x86_64 and i686
if len(installed_pkgs) == 2:
(cur_name0, cur_ver0, cur_rel0, cur_epoch0, cur_arch0) = splitFilename(installed_pkgs[0])
(cur_name1, cur_ver1, cur_rel1, cur_epoch1, cur_arch1) = splitFilename(installed_pkgs[1])
cur_epoch0 = cur_epoch0 or '0'
cur_epoch1 = cur_epoch1 or '0'
compare = compareEVR((cur_epoch0, cur_ver0, cur_rel0), (cur_epoch1, cur_ver1, cur_rel1))
if compare == 0 and cur_arch0 != cur_arch1:
for installed_pkg in installed_pkgs:
if installed_pkg.endswith(arch):
installed_pkgs = [installed_pkg]
if len(installed_pkgs) == 1:
installed_pkg = installed_pkgs[0]
(cur_name, cur_ver, cur_rel, cur_epoch, cur_arch) = splitFilename(installed_pkg)