From a7287233bc9fbde4a30ae45374e2716730d4aa31 Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Wed, 2 Dec 2020 10:57:05 +0100 Subject: [PATCH] [Ubuntu] Always install latest CMake version (#2131) * [Ubuntu] Always install latest CMake version Should fix #2129 and succeeds #2126 Thanks to @unfor19 for [this solution](https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8#gistcomment-3459923) Please test extensively. * [Ubuntu] CMake.sh: Use jq instead of grep * [Ubuntu] cmake.sh: Extract URL directly from API output Co-authored by @al-cheb, thanks! --- images/linux/scripts/installers/cmake.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/images/linux/scripts/installers/cmake.sh b/images/linux/scripts/installers/cmake.sh index a65c645c8..893432111 100644 --- a/images/linux/scripts/installers/cmake.sh +++ b/images/linux/scripts/installers/cmake.sh @@ -9,7 +9,8 @@ echo "Checking to see if the installer script has already been run" if command -v cmake; then echo "cmake is already installed" else - curl -sL https://cmake.org/files/v3.19/cmake-3.19.1-Linux-x86_64.sh -o cmakeinstall.sh \ + url=$(curl -s https://api.github.com/repos/Kitware/CMake/releases/latest | jq -r '.assets[].browser_download_url | select(contains("Linux-x86_64.sh"))') + curl -sL ${url} -o cmakeinstall.sh \ && chmod +x cmakeinstall.sh \ && ./cmakeinstall.sh --prefix=/usr/local --exclude-subdir \ && rm cmakeinstall.sh