From 02bb7c3193a2cb8644a37d1095195a7df99d9346 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Fri, 17 Nov 2023 09:27:07 +0100 Subject: [PATCH] Simplify to a simple apt version check Removed checks for lsb_release (to get distro name) and Ubuntu version. Assuming apt from at least the 2.4 branch will suffice. --- linux/setup_repo.sh | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index a69644548d..f7697502b0 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -7,12 +7,7 @@ if [[ ${EUID} -ne 0 ]]; then exit 1 fi -if [ -x "$(command -v lsb_release)" ]; then - ISUBUNTU=`lsb_release -is` -else - echo "lsb_release not found. Cannot determine Linux distribution (or this is not Linux)." - exit 1 -fi; +# Check for apt version >= 2.4.0 (if found, assuming Debian-based compatible with repo) apt --version > /dev/null if [[ $? -eq 0 ]]; then @@ -30,33 +25,7 @@ if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.4" | bc -l) )); then exit 1 fi; -if [[ $ISUBUNTU == "Ubuntu" ]]; then - - UBUNTU_VERSION=`lsb_release -sr` - echo "Ubuntu version: ${UBUNTU_VERSION}" - SUBSTRING=$(echo $UBUNTU_VERSION| cut -d'.' -f 1) - -if [[ $SUBSTRING -lt 22 ]]; then -cat << EOM -WARNING: Ubuntu versions less that 22.04 have a bug in their apt version for signed repositories. -Not adding jamulus repo. Either install the deb file manually [see https://jamulus.io/wiki/Installation-for-Linux] -or update your system to at least Ubuntu 22.04 -EOM - exit 1 -fi; - -else - echo "This is not Ubuntu, it is ${ISUBUNTU}" - echo "Do you wish to install anyway?" -select yn in "Yes" "No"; do - case $yn in - Yes ) break;; - No ) exit 1;; - esac -done -fi; - -# We have an acceptable Ubuntu version, continuing +# We have an acceptable Apt version, continuing REPO_FILE=/etc/apt/sources.list.d/jamulus.list KEY_FILE=/etc/apt/trusted.gpg.d/jamulus.asc