os_release: adjust for Fedora CoreOS

...which just has to be another special flower.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2020-09-02 16:22:20 -07:00
parent 478b7eff9e
commit e99a3fbdf9
1 changed files with 10 additions and 0 deletions

View File

@ -52,6 +52,12 @@ sub run {
# Now, we merge the fields into one expression to create the correct canned tag
# that will contain both the version number and the build number.
my $cannedtag = "$cannedver.$cannednum";
# If this is a CoreOS build, though, throw all that away and
# just use the build version
my $build = get_var("BUILD");
if ($build =~ /^Fedora-CoreOS/) {
$cannedtag = (split /-/, $build)[-1];
}
my $name = ucfirst($id);
my $rawrel = get_var("RAWREL", '');
my $version_id = get_var("VERSION"); # Should be the version number or Rawhide.
@ -113,6 +119,10 @@ sub run {
# Same problem is when testing the PRETTY_NAME.
if (get_var("CANNED")) {
$pretty = "$name $cannedtag ($varstr)";
# ...and FCOS uses a different format, sigh
if ($build =~ /^Fedora-CoreOS/) {
$pretty = "Fedora CoreOS $cannedtag";
}
}
#Now. we can start testing the real values from the installed system.