mirror of
https://pagure.io/fedora-qa/os-autoinst-distri-fedora.git
synced 2024-11-24 23:03:08 +00:00
os_release: fix ISO parsing for 'Fedora-IoT' composes
Also comment this better. We need to index from the end of the string here, not the start, because going from the start breaks when the compose shortname has a dash in it. Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
parent
2c236ef16a
commit
1d4557126a
@ -34,10 +34,19 @@ sub run {
|
|||||||
# correct variables to compare the system data with.
|
# correct variables to compare the system data with.
|
||||||
# First, we know the basic stuff
|
# First, we know the basic stuff
|
||||||
my $id = get_var("DISTRI"); # Should be "fedora"
|
my $id = get_var("DISTRI"); # Should be "fedora"
|
||||||
my $isovar = get_var("ISO"); # Takes the build string for canned variants.
|
# extract expected version components from ISO name for canned variants,
|
||||||
# Split the ISO variable at "-" and read fields 4 (release version)
|
# which have their os-release rewritten by rpm-ostree, see:
|
||||||
# and 5 (the build number).
|
# https://github.com/projectatomic/rpm-ostree/blob/master/docs/manual/treefile.md
|
||||||
my ($cannedver, $cannednum) = (split /-/, $isovar)[4, 5];
|
# we use the ISO name because rpm-ostree uses elements from the compose
|
||||||
|
# ID for nightlies, but from the label for candidate composes; BUILD
|
||||||
|
# always gives us the compose ID, but the ISO name contains the compose
|
||||||
|
# ID for nightlies but the label for candidate composes, so it works for
|
||||||
|
# our purposes here.
|
||||||
|
my $isovar = get_var("ISO");
|
||||||
|
# Split the ISO variable at "-" and read second-to-last (release
|
||||||
|
# number) and last (compose ID: date and respin, label: major and
|
||||||
|
# minor) fields.
|
||||||
|
my ($cannedver, $cannednum) = (split /-/, $isovar)[-2, -1];
|
||||||
# Get rid of the ".iso" part of the tag.
|
# Get rid of the ".iso" part of the tag.
|
||||||
$cannednum =~ s/\.iso//g;
|
$cannednum =~ s/\.iso//g;
|
||||||
# Now, we merge the fields into one expression to create the correct canned tag
|
# Now, we merge the fields into one expression to create the correct canned tag
|
||||||
@ -77,10 +86,8 @@ sub run {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $version = "$version_id ($varstr)";
|
my $version = "$version_id ($varstr)";
|
||||||
# Version looks different when the build is canned (because
|
# for canned variants, we need to form a different string here by using
|
||||||
# rpm-ostree fiddles around with it, documented at
|
# the above created cannedtag. See earlier comment
|
||||||
# https://github.com/projectatomic/rpm-ostree/blob/master/docs/manual/treefile.md )
|
|
||||||
# We need to form a different string here by using the above created cannedtag.
|
|
||||||
if (get_var("CANNED")) {
|
if (get_var("CANNED")) {
|
||||||
$version = "$cannedtag ($varstr)";
|
$version = "$cannedtag ($varstr)";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user