salt icon indicating copy to clipboard operation
salt copied to clipboard

Use rpmdev-vercmp to determine correct version of rpms in CentOS5

Open mgresser opened this issue 10 years ago • 7 comments

It appears the fixes from PR 25603 were not included in the 2015.8 and 2016.3 releases.

mgresser avatar Jun 30 '16 16:06 mgresser

I am seeing this manifested on 2015.8 and 2016.3. If I use salt to install a package, 'foo-1.1-1' it works. If I then use salt to upgrade to a test build, 'foo-1.testbuild-1' that also works. If I then try to revert back to 'foo-1.1-1' it fails. In this case yum and salt appear to disagree as to whether this is an upgrade or downgrade. Salt should be deferring to yum but doesn't appear to.

mgresser avatar Jun 30 '16 16:06 mgresser

ping @terminalmage looks like you wanted to be notified of this issue from here #21912

Looks like your latest comment on that issue leads me to believe this will be possible to fix for centos5 using rpmdev-vercmp Not sure if you guys want to move the conversation to this issue. Thanks

Ch3LL avatar Jun 30 '16 18:06 Ch3LL

The fixes described in that issue work just fine in 2015.8 and 2016.3.

CentOS 5 was never included in the fix because it doesn't have access the rpm or rpmUtils modules directly due to the fact that Cent5 has a system Python of 2.4.3 while Salt runs on Python 2.6.

terminalmage avatar Jun 30 '16 19:06 terminalmage

I'll modify this issue title to be more clear about the issue in light of @terminalmage's feedback.

mgresser avatar Jun 30 '16 19:06 mgresser

Fixed in https://github.com/saltstack/salt/pull/34401.

terminalmage avatar Jun 30 '16 20:06 terminalmage

[root@erik-cent5 salt]# chmod -x /usr/bin/rpmdev-vercmp
[root@erik-cent5 salt]# salt-call --local pkg.version_cmp '0.2-001' '0.2.0.1-002'
[WARNING ] rpmdevtools is not installed, please install it for more accurate version comparisons
local:
    1
[root@erik-cent5 salt]# chmod +x /usr/bin/rpmdev-vercmp
[root@erik-cent5 salt]# salt-call --local pkg.version_cmp '0.2-001' '0.2.0.1-002'
local:
    -1

terminalmage avatar Jun 30 '16 20:06 terminalmage

Thanks!

mgresser avatar Jun 30 '16 20:06 mgresser