From 23548f09b7bff999b0b346a5511b2a316ec798b4 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Fri, 25 Mar 2022 23:02:13 +0000 Subject: Kitware's cmake is not available for non-LTS Ubuntu versions Don't try to install it for non-LTS Ubuntu versions --- scripts/build/p-klee-linux-ubuntu.inc | 38 ++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'scripts/build/p-klee-linux-ubuntu.inc') diff --git a/scripts/build/p-klee-linux-ubuntu.inc b/scripts/build/p-klee-linux-ubuntu.inc index e7c8e92e..5e7f8135 100644 --- a/scripts/build/p-klee-linux-ubuntu.inc +++ b/scripts/build/p-klee-linux-ubuntu.inc @@ -1,23 +1,29 @@ install_build_dependencies_klee() { source "${DIR}/common-functions" - # Add Kitware's certificate for CMake - dependencies=( - apt-transport-https - ca-certificates - gnupg - lsb-release - software-properties-common - wget - ) - - apt -y --no-install-recommends install "${dependencies[@]}" - wget -O - "https://apt.kitware.com/keys/kitware-archive-latest.asc" 2> /dev/null \ - | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null + # Check if the Ubuntu version is an LTS version - otherwise no cmake version available + if [[ $(grep -q LTS /etc/os-release) ]]; then + with_sudo apt update -y + # Add Kitware's certificate for CMake + dependencies=( + apt-transport-https + ca-certificates + gnupg + lsb-release + software-properties-common + wget + ) + + with_sudo apt -y --no-install-recommends install "${dependencies[@]}" + wget -O - "https://apt.kitware.com/keys/kitware-archive-latest.asc" 2> /dev/null \ + | gpg --dearmor - | with_sudo tee /etc/apt/trusted.gpg.d/kitware.gpg > /dev/null + + # Add CMake repository + codename="$(lsb_release --codename --short)" + with_sudo apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ ${codename} main" + fi - # Add CMake repository - codename="$(lsb_release --codename --short)" - apt-add-repository "deb https://apt.kitware.com/ubuntu/ ${codename} main" + with_sudo apt update -y # Install KLEE's dependencies dependencies=( -- cgit 1.4.1