question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQUEST] Include accurate package version comparison for RHEL7

See original GitHub issue

Is your feature request related to a problem? Please describe.

The pkg.version_cmp module using Salt’s built-in comparison is not always accurate on RedHat-derived machines; there is a helpful warning message to this effect when using the CLI. However, when using external UI-driven products that depend on pkg.version_cmp, inaccurate version comparions can cause unexpected failures. Since, on RHEL7, the accurate comparison depends on the python3-rpm package from EPEL, users may not have this out of the box, and adding EPEL may have obstacles depending on their environment.

One comparison example (from libxml2 versions):

[root@rhel7 vagrant]# salt-call pkg.version_cmp '2.9.1-6.el7_2.3' '2.9.1-6.el7.4'
[WARNING ] Please install a package that provides rpm.labelCompare for more accurate version comparisons.
[WARNING ] Falling back on salt.utils.versions.version_cmp() for version comparisons
local:
    1
[root@rhel7 vagrant]# yum -y -q install python3-rpm
[root@rhel7 vagrant]# salt-call pkg.version_cmp '2.9.1-6.el7_2.3' '2.9.1-6.el7.4'
local:
    -1

Describe the solution you’d like

I spoke at length with @dmurphy18 on Slack, and doing the comparison by shelling out to rpmdev-vercmp, which is part of the base OS’s rpmdevtools, would be the preferred solution. I believe the implication is that the installation of salt packages should depend on rpmdevtools.

Describe alternatives you’ve considered

  • Adding python3-rpm to Saltstack’s repo and making it a dependency.
  • No change. External tools using pkg.version_cmp responsible for documenting installation of python3-rpm from EPEL to obtain working functionality.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:23 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
frogundercommented, Oct 15, 2020

This is also seems to work correctly for me on RHEL7 and CentOS7 for the 3002rc1 package.

1reaction
frogundercommented, Oct 13, 2020

This seems to be working correctly on Amazon Linux 2 using the 3002rc1 package.

There is no RHEL 7 package for 3002rc1, so will check again once RHEL 7 for 3002 is built.

Read more comments on GitHub >

github_iconTop Results From Across the Web

After an upstream project has released a newer version of a ...
When looking at capabilities of RHEL packages compared to later upstream versions, it is incorrect to focus on version number, ...
Read more >
Compiling and Installing - Apache HTTP Server Version 2.4
This document covers compilation and installation of the Apache HTTP Server on Unix and Unix-like systems only. For compiling and installation on Windows, ......
Read more >
How patch baseline rules work on Linux-based systems
Use the native package manager to install patches approved by the patch ... patch candidate versions are limited to patches included in the...
Read more >
Operating system details - Compute Engine - Google Cloud
Compute Engine recommends using Ubuntu LTS images unless you require features or software packages that are not yet included in an LTS release....
Read more >
Basic Usage — Spack 0.20.0.dev0 documentation
To do this, just add @ after the package name, followed by a version: $ spack install mpich@3.0.4 ... A package installed upon...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found