These currently block us from using an arbitrary python version, as they are available only for the default RHEL python version.
Turns out getting rid of the dependencies might not be that hard:
lib/util/old_content.py - _available_ssg_versions() uses it just as a one-shot comparison of RPM versions, something that can easily be done via subprocess:
as rpm --eval "%{lua:print(rpm.vercmp('1.2-1', '2.0-1'))}" natively, or
rpmdev-vercmp 1.12 1.13 from rpmdevtools, or
/usr/libexec/platform-python -c "..." one-shot call of the RHEL-default python interpreter, just like old Bash Contest
lib/versions.py - this is really just a left-over from us wanting to compare SSG RPM versions in waivers; the logic is currently used only for RHEL version comparisons that could easily be turned to simple int() comparisons, incl. floating points
technically, there's the ability to compare openscap-scanner RPM version, but we never do that - we just use versions.rhel to work around a specific openscap version
lib/dnf.py - this is actually a valid complex use case of querying something not available outside python API, however we could easily have a separate tool in lib, like we do for pseudotty, that would run under the default python interpreter and have some trivial CLI interface to extract the needed repo URLs from the DNF API
These currently block us from using an arbitrary python version, as they are available only for the default RHEL python version.
Turns out getting rid of the dependencies might not be that hard:
lib/util/old_content.py
-_available_ssg_versions()
uses it just as a one-shot comparison of RPM versions, something that can easily be done viasubprocess
:rpm --eval "%{lua:print(rpm.vercmp('1.2-1', '2.0-1'))}"
natively, orrpmdev-vercmp 1.12 1.13
fromrpmdevtools
, or/usr/libexec/platform-python -c "..."
one-shot call of the RHEL-default python interpreter, just like old Bash Contestlib/versions.py
- this is really just a left-over from us wanting to compare SSG RPM versions in waivers; the logic is currently used only for RHEL version comparisons that could easily be turned to simpleint()
comparisons, incl. floating pointsopenscap-scanner
RPM version, but we never do that - we just useversions.rhel
to work around a specific openscap versionlib/dnf.py
- this is actually a valid complex use case of querying something not available outside python API, however we could easily have a separate tool inlib
, like we do forpseudotty
, that would run under the default python interpreter and have some trivial CLI interface to extract the needed repo URLs from the DNF API