Some verbose context
It's seems to be common that third-party products with DNF repositories content just per major version of RHEL, instead of per minor version (this includes also EPEL repositories). Some definitions of repositories have then
- hardcoded major version in URL,
- some are using $releasever variable and people need to set releasever to `7`, `8`, `9`, ... major version on RHEL systems to keep it working - that has been brought to me several times in last years, not sure how common this one is. But e.g. here:
[couchdb] name=couchdb baseurl=https://apache.jfrog.io/artifactory/couchdb-rpm/el$releasever/$basearch/ gpgkey=https://couchdb.apache.org/repo/keys.asc https://couchdb.apache.org/repo/rpm-package-key.asc gpgcheck=1 repo_gpgcheck=1 enabled=1
If you check https://apache.jfrog.io/ui/native/couchdb-rpm/ you see that $releasever is expected to be either X (7, 8, 9) os "Xserver".
This brings problems for in-place upgrades between major versions of RHEL systems as customer have to manually
- create new repository definition for the upgrade process to access repository with content for the target system
- replace the $releasever variable by expected string
- change the repoid
- after the upgrade replace original repository definition by the new one to keep consuming up-to-date content
Presenting $releasever_major (eventually also $releasever_minor) variables, containing just major or minor OS release version would be step forward to improve the experience in future for IPU RHEL 9 -> 10 and newer. This change is already present in current Fedora, so I hope it's also part of RHEL 10 already (I haven't checked that; if not, please clone the ticket for el10 also).
Discussing it with our PO (rhn-support-mkluson) and PM (rhandlin@redhat.com) they like the idea. We know it will take a time to propagate the change widely to other third party repositories, but better to start now than later.
Goal
As a user or a vendor, I want to be able to create repository definition in a way it works across RHEL systems. As a product is delivered just per major version of RHEL, I do not care about minor releases and require to use just major version number in the baseURL. At this point, I need DNF to provide $releasever_major variable which e.g. for releasever "9.6" contains "9". A $releasever_minor can be provided eventually too.
Acceptance criteria
- for $releasever set to "X.Y", var $releasever_major contains "X" ; (if $releasever_minor is provided, it contains "Y")
- for $releasever set to "X", variable $releasever_major contains "X" ; (if $releasever_minor is provided, it contains "Y" empty string)
- this could cover also situation when $releasever is set to "9Server", in such a case, $releasever_major should probably contain "9Server" as well