Skip to content
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

Document releasever_{major,minor} and parameter expansion #2004

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Document $releasever_major and $releasever_minor
=changelog=
msg: Automatically derive $releasever_major and $releasever_minor from $releasever
type: enhancement
resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1789346
  • Loading branch information
evan-goode committed Oct 16, 2023
commit 3d0b30c5c0e5cfafb1c6170f94435bbaa64fe072
15 changes: 15 additions & 0 deletions doc/conf_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@ configuration file by your distribution to override the DNF defaults.
:ref:`string <string-label>`

Used for substitution of ``$releasever`` in the repository configuration.

The ``$releasever_major`` and ``$releasever_minor`` variables will be automatically derived from ``$releasever`` by splitting it on the first ``.``. For example, if ``$releasever`` is set to ``1.23``, then ``$releasever_major`` will be ``1`` and ``$releasever_minor`` will be ``23``.

See also :ref:`repo variables <repo-variables-label>`.

.. _reposdir-label:
Expand Down Expand Up @@ -774,6 +777,18 @@ Right side of every repo option can be enriched by the following variables:

Refers to the release version of operating system which DNF derives from information available in RPMDB.

.. _variable-releasever_major-label:

``$releasever_major``

Major version of ``$releasever``, i.e. the component of ``$releasever`` occurring before the first ``.``.

.. _variable-releasever_minor-label:

``$releasever_minor``

Minor version of ``$releasever``, i.e. the component of ``$releasever`` occurring after the first ``.``.

.. _variable-user-defined-label:

In addition to these hard coded variables, user-defined ones can also be used. They can be defined either via :ref:`variable files <varfiles-label>`, or by using special environmental variables. The names of these variables must be prefixed with DNF_VAR\_ and they can only consist of alphanumeric characters and underscores::
Expand Down