-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Override releasever_{major,minor} with system-release provides #2198
base: master
Are you sure you want to change the base?
Override releasever_{major,minor} with system-release provides #2198
Conversation
This allows setting a releasever_major or releasever_minor independent of releasever, which is needed by EPEL. Related: https://issues.redhat.com/browse/RHEL-68034
1a54f5b
to
4872d0a
Compare
Hi Evan and thanks for figuring this out! For me it sounds fine having new |
The releasever_major and releasever_minor substitution variables are usually derived by splitting releasever on the first `.`. However, to support EPEL 10 [1], we would like a way for distributions to override these values. Specifically, we would like RHEL 10 to have a releasever of `10` with a releasever_major of `10` and a releasever_minor of `0` (later incrementing to `1`, `2`, to correspond with the RHEL minor version). This commit adds a new API function, `detect_releasevers`, which derives releasever, releasever_major, and releasever_minor from virtual provides on the system-release package (any of `DISTROVERPKG`). The detection of releasever is unchanged. releasever_major and releasever_minor are specified by the versions of the `system-release-major` and `system-release-minor` provides, respectively. If the user specifies a `--releasever=X.Y` on the command line, the distribution settings for releasever, releasever_major, and releasever_minor will all be overridden: releasever will be set to X.Y, releasever_major will be set to X, and releasever_minor will be set to Y, same as before. If a user wants to specify a custom releasever_major and releasever_minor, they have to set all three with `--setopt=releasever=X --setopt=releasever_major=Y --setopt=releasever_minor=z`, taking care to put `releasever_major` and `releasever_minor` after `releasever` so they are not overridden. [1] https://issues.redhat.com/browse/RHEL-68034
Allows the user to override the $releasever_major and $releasever_minor variables on the command line, like --releasever.
Adds dnf.rpm.detect_releasevers to the API docs and mention it is now preferred over dnf.rpm.detect_releasever. Updates examples/install_extension.py to use detect_releasevers and set the releasever_major and releasever_minor substitution variables.
fa3f84f
to
0758ec7
Compare
ci-dnf-stack PR: rpm-software-management/ci-dnf-stack#1621 |
Cool, I've added the |
The
releasever_major
andreleasever_minor
substitution variables are usually derived by splittingreleasever
on the first.
. However, to support EPEL 10 [1], we would like a way for distributions to override these values. Specifically, we would like RHEL 10 to have a releasever of10
with a releasever_major of10
and a releasever_minor of0
(later incrementing to1
,2
, to correspond with the RHEL minor version).This commit adds a new API function,
detect_releasevers
, which derivesreleasever
,releasever_major
, andreleasever_minor
from virtual provides on the system-release package (any ofDISTROVERPKG
). The detection of releasever is unchanged.releasever_major
andreleasever_minor
are specified by the versions of thesystem-release-major
andsystem-release-minor
provides, respectively.If the user specifies a
--releasever=X.Y
on the command line, the distribution settings forreleasever
,releasever_major
, andreleasever_minor
will all be overridden:releasever
will be set to X.Y,releasever_major
will be set to X, andreleasever_minor
will be set to Y, same as before.If a user wants to specify a custom
releasever_{major,minor}
, they have to set all three with--setopt=releasever=X --setopt=releasever_major=Y --setopt=releasever_minor=z
, taking care to putreleasever_major
andreleasever_minor
afterreleasever
so they are not overridden. This is admittedly not ideal, but I can't think of another solution to this problem that preserves the following properties:releasever_{major,minor}
are derived by splittingreleasever
. This behavior was added in Split $releasever to $releasever_major and $releasever_minor #1989.--releasever
is specified on the command line,releasever_{major,minor}
should be set accordingly, even ifreleasever{major_minor}
are specified by provides in the distribution system-release package.Maybe we could add
--releasever_major=
and--releasever_minor
options that take priority over--releasever
to improve point (3).Another caveat to allowing overriding
releasever_{major,minor}
is existing API users usingdetect_releasever
. Take this snippet from ourdoc/examples/install_extension.py
:Now, in order to detect the correct
releasever_{major,minor}
, the correct code would beRequires rpm-software-management/libdnf#1689.
[1] https://issues.redhat.com/browse/RHEL-68034