Merge pull request #592 from GabyCT/topic/portyq

[forward port]: osbuilder: Update yq
This commit is contained in:
GabyCT 2020-08-28 09:41:21 -05:00 committed by GitHub
commit bc9c8ddf8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 9 deletions

View File

@ -56,12 +56,14 @@ function install_yq() {
die "Please install curl"
fi
local yq_version=2.3.0
local yq_version=3.1.0
local yq_url="https://${yq_pkg}/releases/download/${yq_version}/yq_${goos}_${goarch}"
curl -o "${yq_path}" -LSsf ${yq_url}
## NOTE: ${var,,} => gives lowercase value of var
local yq_url="https://${yq_pkg}/releases/download/${yq_version}/yq_${goos,,}_${goarch}"
curl -o "${yq_path}" -LSsf "${yq_url}"
[ $? -ne 0 ] && die "Download ${yq_url} failed"
chmod +x ${yq_path}
chmod +x "${yq_path}"
echo "Installed $(${yq_path} --version)"
if ! command -v "${yq_path}" >/dev/null; then
die "Cannot not get ${yq_path} executable"

View File

@ -375,13 +375,13 @@ RUN ln -sf /usr/bin/g++ /bin/musl-g++
detect_go_version()
{
info "Detecting go version"
typeset -r yq=$(command -v yq || command -v "${GOPATH}/bin/yq" || echo "${GOPATH}/bin/yq")
typeset yq=$(command -v yq || command -v ${GOPATH}/bin/yq || echo "${GOPATH}/bin/yq")
if [ ! -f "$yq" ]; then
source "$yq_file"
fi
info "Get Go version from ${kata_versions_file}"
GO_VERSION="$(cat "${kata_versions_file}" | $yq r - "languages.golang.meta.newest-version")"
GO_VERSION="$(cat "${kata_versions_file}" | $yq r -X - "languages.golang.meta.newest-version")"
[ "$?" == "0" ] && [ "$GO_VERSION" != "null" ]
}
@ -395,7 +395,7 @@ detect_rust_version()
fi
info "Get rust version from ${kata_versions_file}"
RUST_VERSION="$(cat "${kata_versions_file}" | $yq r - "languages.rust.meta.newest-version")"
RUST_VERSION="$(cat "${kata_versions_file}" | $yq r -X - "languages.rust.meta.newest-version")"
[ "$?" == "0" ] && [ "$RUST_VERSION" != "null" ]
}
@ -409,7 +409,7 @@ detect_cmake_version()
fi
info "Get cmake version from ${kata_versions_file}"
CMAKE_VERSION="$(cat "${kata_versions_file}" | $yq r - "externals.cmake.version")"
CMAKE_VERSION="$(cat "${kata_versions_file}" | $yq r -X - "externals.cmake.version")"
[ "$?" == "0" ] && [ "$CMAKE_VERSION" != "null" ]
}
@ -423,7 +423,7 @@ detect_musl_version()
fi
info "Get musl version from ${kata_versions_file}"
MUSL_VERSION="$(cat "${kata_versions_file}" | $yq r - "externals.musl.version")"
MUSL_VERSION="$(cat "${kata_versions_file}" | $yq r -X - "externals.musl.version")"
[ "$?" == "0" ] && [ "$MUSL_VERSION" != "null" ]
}