#167 make $releasever return "rawhide" on Rawhide
Merged 2 months ago by humaton. Opened 2 months ago by kparal.
rpms/ kparal/fedora-release releasever  into  rawhide

file modified
+17 -3
@@ -1,10 +1,18 @@ 

  %define release_name Rawhide

+ %define is_rawhide 1


  %define dist_version 35

  %define rhel_dist_version 9

- %define bug_version rawhide


- # Change this when branching to fNN

+ %if %{is_rawhide}

+ %define bug_version rawhide

+ %define releasever rawhide

  %define doc_version rawhide

+ %else

+ %define bug_version %{dist_version}

+ %define releasever %{dist_version}

+ %define doc_version f%{dist_version}

+ %endif


  %if 0%{?eln}

  %bcond_with basic
@@ -50,7 +58,7 @@ 

  Summary:        Fedora release files

  Name:           fedora-release

  Version:        35

- Release:        0.1%{?eln:.eln%{eln}}

+ Release:        0.10%{?eln:.eln%{eln}}

  License:        MIT

  URL:            https://fedoraproject.org/

@@ -107,6 +115,12 @@ 

  Requires:   fedora-repos(%{version})

  Requires:   fedora-release-identity = %{version}-%{release}


+ %if %{is_rawhide}

+ # Make $releasever return "rawhide" on Rawhide

+ # https://pagure.io/releng/issue/7445

+ Provides:       system-release(releasever) = %{releasever}

+ %endif


  # Fedora ships a generic-release package to make the creation of Remixes

  # easier, but it cannot coexist with the fedora-release[-*] packages, so we

  # will explicitly conflict with it.

This is a fairly significant change which will make $releasever (as understood
by dnf) return "rawhide" instead of a number (e.g. 35) for Rawhide users. The
purpose is to have a constant identifier, that developers and repo owners can
rely on. This will make Rawhide a true rolling release which won't need careful
adjustments every time we branch - once on Rawhide, you'll always stay on
Rawhide. This should also significantly simplify repo management, because repos
will no longer need a separate config for Rawhide which is different from stable
releases. The same config file containing "$releasever" can be used (instead of
hardcoding "rawhide" in URL), and it will resolve correctly to a "rawhide/"
directory on the repo server.

The overall hope is that this change should help users (system maintenance),
developers (simplifying automation) and repo owners (release differentiation no
longer needed). Please read the included link for a longer discussion.

This change introduces a new variable is_rawhide, which should be set to 1
or 0, depending on whether this release is Rawhide or not. It will then set
some additional variables automatically, to simplify specfile maintenance.

This change is made possible by dnf looking at package provides, when
determining $releasever, and system-release(releasever) is the first provides
it looks at. We don't use it in stable releases, but we can set the value on
Rawhide and it will have precedence.

This change will also need an accompanying change in fedora-repos, to be
committed and built together.

Related: https://pagure.io/releng/issue/7445

This PR needs to be pushed and built together with:

There's a COPR repo you can add in order to experiment with the built packages:

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Pull-Request has been merged by humaton

2 months ago