- Don't output junk to stderr when cmake unavailable - Kitware PPA does not include up to date bins for all distros (e.g. Ubuntu 24 only has 3.30.2 although 3.30.4 has been out for a while) so don't try to force install a specific version. Take the best we can get.
Showing the changes to script (1 of 1 file). Show all
Unified · Split
| @@ -35,7 +35,7 @@ CMAKE_VERSION="${CMAKE_VERSION:-${1:-3.30.4}}" · 34 unmodified lines | ||
| 35 | 35 | |
| 36 | 36 | if [ "$(whoami)" = root ]; then SUDO=; else SUDO="$(command -v sudo || command -v doas || true)"; fi |
| 37 | 37 | |
| 38 | −if cmake --version | grep -q "$CMAKE_VERSION"; then | |
| 38 | +if cmake --version 2>/dev/null | grep -q "$CMAKE_VERSION"; then | |
| 39 | 39 | echo "CMake $CMAKE_VERSION is already installed." |
| 40 | 40 | exit 0 |
| 41 | 41 | elif [ -e /usr/local/bin/cmake ]; then |
| @@ -51,7 +51,7 @@ elif [ -e /etc/lsb-release ] && grep -qP 'DISTRIB_ID=Ubuntu' /etc/lsb-release; t · 9 unmodified lines | ||
| 51 | 51 | echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" \ |
| 52 | 52 | | $SUDO tee /etc/apt/sources.list.d/kitware.list >/dev/null |
| 53 | 53 | $SUDO apt-get update |
| 54 | − $SUDO apt-get install -y kitware-archive-keyring cmake==$CMAKE_VERSION | |
| 54 | + $SUDO apt-get install -y kitware-archive-keyring cmake | |
| 55 | 55 | else |
| 56 | 56 | arch="$(uname -m)" |
| 57 | 57 | if [ "$arch" != "x86_64" ] && [ "$arch" != "aarch64" ]; then |