#122 Add "Prerelease" notation to PRETTY_NAME and VERSION in os-release
Merged 3 years ago by sgallagh. Opened 4 years ago by sgallagh.
rpms/ sgallagh/fedora-release prerelease  into  master

file modified
+16 -3
@@ -14,7 +14,7 @@ 

  Summary:        Fedora release files

  Name:           fedora-release

  Version:        33

- Release:        0.5

+ Release:        0.6

  License:        MIT

  URL:            https://fedoraproject.org/

  
@@ -324,14 +324,24 @@ 

  ln -s fedora-release %{buildroot}%{_sysconfdir}/system-release

  

  # Create the common os-release file

+ %{lua:

+   function starts_with(str, start)

+    return str:sub(1, #start) == start

+   end

+ }

+ %define starts_with(str,prefix) (%{expand:%%{lua:print(starts_with(%1, %2) and "1" or "0")}})

+ %if %{starts_with "a%{release}" "a0"}

+   %global prerelease \ Prerelease

+ %endif

+ 

  cat << EOF >>%{buildroot}%{_prefix}/lib/os-release

  NAME=Fedora

- VERSION="%{dist_version} (%{release_name})"

+ VERSION="%{dist_version} (%{release_name}%{?prerelease})"

  ID=fedora

  VERSION_ID=%{dist_version}

  VERSION_CODENAME=""

  PLATFORM_ID="platform:f%{dist_version}"

- PRETTY_NAME="Fedora %{dist_version} (%{release_name})"

+ PRETTY_NAME="Fedora %{dist_version} (%{release_name}%{?prerelease})"

  ANSI_COLOR="0;38;2;60;110;180"

  LOGO=fedora-logo-icon

  CPE_NAME="cpe:/o:fedoraproject:fedora:%{dist_version}"
@@ -636,6 +646,9 @@ 

  

  

  %changelog

+ * Mon Apr 20 2020 Stephen Gallagher <sgallagh@redhat.com> - 33-0.6

+ - Add "Prerelease" notation to PRETTY_NAME and VERSION in os-release

+ 

  * Sun Apr 12 2020 Kevin Fenzi <kevin@scrye.com> - 33-0.5

  - Update color to Fedora blue. Fixes bug #1823099

  

If the release field of fedora-release starts with 0, it is a pre-release. Including this in PRETTY_NAME and VERSION will make it easier to identify in other applications whether this is a stable or in-development release.

One such application would be to have gnome-shell-extension-background-logo display it so it is obvious to the user when they are running a pre-release version of Fedora.

Signed-off-by: Stephen Gallagher sgallagh@redhat.com

attn: @mattdm @fmuellner

rebased onto 0abde3dd7eb779b8f700d6998c15fad4831ec43e

4 years ago

Was there a bug report/issue requesting this some where to provide context/back ground?

Was there a bug report/issue requesting this some where to provide context/back ground?

It was spawned from this conversation: https://lists.fedoraproject.org/archives/list/test@lists.fedoraproject.org/message/TPMZWL2YXBOPUJZ5F6WGG4UPVK4CWKR6/

Does this really belong in the VERSION field? That feels questionable to me.

(note openqa has a test for os-release contents, so I am going to need to change that if this lands.)

'A string identifying the operating system version, excluding any OS name information, possibly including a release code name, and suitable for presentation to the user. This field is optional. Example: "VERSION=17" or "VERSION="17 (Beefy Miracle)".'

I think this is a valid use of that field (the portion within the parentheses is meant to be printed explicitly and not parsed). That said, it could potentially reveal cases where code is assuming otherwise. I'm not sure whether that's a negative or a positive, though.

I mean, to me, a "pre release" tag isn't really "identifying the operating system version" or a "release code name". But I accept you could have a different opinion there. :)

edit: actually it occurs to me that this change would make my life much easier for another specific bit of openQA testing, so I won't be sad if you ignore my opinion and go ahead and do it anyway, honestly...:P

@adamwill Just to be clear, you're also fine with the PRETTY_NAME?

@zbyszek Could I get your opinion on the VERSION field here?

The definition of VERSION= permits both uses. It's a free-form field, and the question whether to include the pre-release status in there is up to the distro. I think we should do whatever works for everyone involved including users and QA.

It's not unheard of to do this either, Mageia does this in mageia-release by indicating "(Cauldron)" until we update Release: to %mkrel 1 and the %am_i_cauldron flag to 0, which switches it to the standard name.

That's why I had the idea in the first place. :smile:

This is LGTM and I think it is useful for users and qa.

OK, I'm going to merge this as-is. It's simple to revert if we encounter problems.

rebased onto a0105c7

3 years ago

Pull-Request has been merged by sgallagh

3 years ago

Hum, this led to an interesting result in openQA:

https://openqa.fedoraproject.org/tests/590638#step/os_release/29

it didn't so much get "added" as it "replaced" something else. That's openQA testing os-release contents after a stock Server DVD install. openQA expects the file to have VERSION="33 (Server Edition)" and PRETTY_NAME="Fedora 33 (Server Edition)" - and that's what it was getting up until this change landed, in 20200430.n.1 - but now those are "33 (Rawhide Prerelease)" and "Fedora 33 (Rawhide Prerelease)".

Did we really mean to wipe edition tags with this change?

Hum, this led to an interesting result in openQA:
https://openqa.fedoraproject.org/tests/590638#step/os_release/29
it didn't so much get "added" as it "replaced" something else. That's openQA testing os-release contents after a stock Server DVD install. openQA expects the file to have VERSION="33 (Server Edition)" and PRETTY_NAME="Fedora 33 (Server Edition)" - and that's what it was getting up until this change landed, in 20200430.n.1 - but now those are "33 (Rawhide Prerelease)" and "Fedora 33 (Rawhide Prerelease)".
Did we really mean to wipe edition tags with this change?

Nope, that's a bug. I'll get it fixed up soon.

@adamwill Can you confirm that the issue with clobbering the edition name has been fixed?