From ead79f989cd38b74015f835fdaba6802bcf10771 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Thu, 12 Oct 2023 17:11:33 +0200 Subject: [PATCH] ci-automation/image-changes: Source version.txt This avoid messing with quotes. --- ci-automation/image_changes.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ci-automation/image_changes.sh b/ci-automation/image_changes.sh index e3ed950508..8fc574377e 100644 --- a/ci-automation/image_changes.sh +++ b/ci-automation/image_changes.sh @@ -488,21 +488,21 @@ function get_channel_a_and_version_a() { # -- # Gets the latest release for given channel and board. For lts channel -# gets a version of the latest LTS. -function channel_version() { +# gets a version of the latest LTS. Runs in a subshell. +function channel_version() ( local channel=${1}; shift local board=${1}; shift - curl \ - -fsSL \ - --retry-delay 1 \ - --retry 60 \ - --retry-connrefused \ - --retry-max-time 60 \ - --connect-timeout 20 \ - "https://${channel}.release.flatcar-linux.net/${board}/current/version.txt" | \ - grep -m 1 'FLATCAR_VERSION=' | cut -d = -f 2- -} + source <(curl \ + -fsSL \ + --retry-delay 1 \ + --retry 60 \ + --retry-connrefused \ + --retry-max-time 60 \ + --connect-timeout 20 \ + "https://${channel}.release.flatcar-linux.net/${board}/current/version.txt") + echo "${FLATCAR_VERSION}" +) # -- # Prints some reports using scripts from the passed path to