Closed julienlavergne closed 1 year ago
This appears to happen when there's multiple installed versions of a package already which then lists them all under repoquery --whatprovides
which gets expanded into a list of (package, [version])
tuples. What should happen (I think) is we end up with (package, [version1, version2, ...])
.
This should finally be fixed as of v2.4 (https://github.com/Fizzadar/pyinfra/commit/27188a445db583dc0bf785102410506de3e64a64) if you wouldn't mind testing this to confirm @julienlavergne.
Describe the bug
yum.packages
sometimes does reinstall a package even when it is already installed.I tracked does the behavior to he function
_has_package
inpyinfra/operations/util/packaging.py
.In my case, the variable
packages
contains'gcc-c++': {'4.8.5-44.el7'}
and the variablepackages_to_check
is[['gcc-c++', '4.8.3-9.el7'], ['gcc-c++', '4.8.5-16.el7_4.2'], ['gcc-c++', '4.8.5-28.el7_5.1'], ['gcc-c++', '4.8.5-44.el7'], ['gcc-c++', '4.8.5-36.el7_6.1'], ['gcc-c++', '4.8.5-36.el7'], ['gcc-c++', '4.8.5-36.el7_6.2'], ['gcc-c++', '4.8.5-11.el7'], ['gcc-c++', '4.8.2-16.2.el7_0'], ['gcc-c++', '4.8.5-16.el7'], ['gcc-c++', '4.8.2-16.el7'], ['gcc-c++', '4.8.5-4.el7'], ['gcc-c++', '4.8.5-39.el7'], ['gcc-c++', '4.8.5-16.el7_4.1'], ['gcc-c++', '4.8.5-28.el7']]
The function does check that all packages to check are installed, but in my example, only one is required.
To Reproduce
Expected behavior
The package is not reinstalled
Meta
v2.2
-vvv --debug