From dd790af1ec35ec40b4c611936ad39d4b3d46d0a8 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 13 Nov 2023 13:57:15 +0100 Subject: [PATCH 01/31] Test for Ubuntu and Ubuntu version --- linux/setup_repo.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 933f0e5af8..32162a259e 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -7,6 +7,26 @@ if [[ ${EUID} -ne 0 ]]; then exit 1 fi +# Test for Ubuntu version +ISUBUNTU=`lsb_release -is` + +if [[ $ISUBUNTU -eq "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; +fi; + REPO_FILE=/etc/apt/sources.list.d/jamulus.list KEY_FILE=/etc/apt/trusted.gpg.d/jamulus.asc GITHUB_REPOSITORY="jamulussoftware/jamulus" From 50070b0977d5359f32e82e383099a33c9e506313 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:06:54 +0100 Subject: [PATCH 02/31] Update setup_repo.sh Fix issue where lsb_release not available --- linux/setup_repo.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 32162a259e..7b4341ef8f 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -8,9 +8,14 @@ if [[ ${EUID} -ne 0 ]]; then fi # Test for Ubuntu version -ISUBUNTU=`lsb_release -is` -if [[ $ISUBUNTU -eq "Ubuntu" ]]; then +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)." +fi; + +if [[ $ISUBUNTU == "Ubuntu" ]]; then UBUNTU_VERSION=`lsb_release -sr` echo "Ubuntu version: ${UBUNTU_VERSION}" @@ -23,10 +28,11 @@ WARNING: Ubuntu versions less that 22.04 have a bug in their apt version for sig 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 + exit 1 fi; fi; + REPO_FILE=/etc/apt/sources.list.d/jamulus.list KEY_FILE=/etc/apt/trusted.gpg.d/jamulus.asc GITHUB_REPOSITORY="jamulussoftware/jamulus" From 1183f3e4a79e994816d2bfe01f27f440de539ea2 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:07:15 +0100 Subject: [PATCH 03/31] Update setup_repo.sh --- linux/setup_repo.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 7b4341ef8f..0b788a7604 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -13,6 +13,7 @@ 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; if [[ $ISUBUNTU == "Ubuntu" ]]; then From 3c5a14f246f4431cfb742b3117aed8dbb9f7ebcd Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:18:14 +0100 Subject: [PATCH 04/31] Clean up and add better testing --- linux/setup_repo.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 0b788a7604..4f62a687db 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -7,8 +7,6 @@ if [[ ${EUID} -ne 0 ]]; then exit 1 fi -# Test for Ubuntu version - if [ -x "$(command -v lsb_release)" ]; then ISUBUNTU=`lsb_release -is` else @@ -17,22 +15,26 @@ else fi; if [[ $ISUBUNTU == "Ubuntu" ]]; then - UBUNTU_VERSION=`lsb_release -sr` echo "Ubuntu version: ${UBUNTU_VERSION}" - SUBSTRING=$(echo $UBUNTU_VERSION| cut -d'.' -f 1) +else + echo "This is not Ubuntu" + # Could test for Debian here, or issue a prompt Continue at your own risk y/N? + exit 1 +fi; + - if [[ $SUBSTRING -lt 22 ]]; then +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; fi; +# We have an acceptable Ubuntu version, continuing REPO_FILE=/etc/apt/sources.list.d/jamulus.list KEY_FILE=/etc/apt/trusted.gpg.d/jamulus.asc From 4ba5a3d39073878448554b9bf2324db177a383ed Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:28:35 +0100 Subject: [PATCH 05/31] Add question for install anyway if Ubuntu not detected --- linux/setup_repo.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 4f62a687db..d7964586f1 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -11,19 +11,14 @@ 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 +# 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) -else - echo "This is not Ubuntu" - # Could test for Debian here, or issue a prompt Continue at your own risk y/N? - exit 1 -fi; - if [[ $SUBSTRING -lt 22 ]]; then cat << EOM @@ -34,6 +29,17 @@ 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 REPO_FILE=/etc/apt/sources.list.d/jamulus.list From 0532bf0a47e239fcb8ce80b9083ab1c43a85fd62 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:29:40 +0100 Subject: [PATCH 06/31] Update setup_repo.sh --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index d7964586f1..90a6c62a75 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -11,7 +11,7 @@ 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 + exit 1 fi; if [[ $ISUBUNTU == "Ubuntu" ]]; then From 772335e17ea48fef3241c89b0ad8dd73c1abcadd Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:35:19 +0100 Subject: [PATCH 07/31] Add test for apt and version >=2.4 --- linux/setup_repo.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 90a6c62a75..c5d35a9dd2 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -14,6 +14,22 @@ else exit 1 fi; +apt --version > /dev/null +if [[ $? -eq 0 ]]; then + APT_VERSION=`apt --version` + APT_MAJOR=$(echo $APT_VERSION| cut -d' ' -f 2 | cut -d'.' -f 1) + APT_MINOR=$(echo $APT_VERSION| cut -d' ' -f 2 | cut -d'.' -f 2) + echo "Apt version: ${APT_VERSION}" +else + echo "Apt is not available." + exit 1 +fi; + +if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.4" | bc -l) )); then + echo "Apt version incompatible." + exit 1 +fi; + if [[ $ISUBUNTU == "Ubuntu" ]]; then UBUNTU_VERSION=`lsb_release -sr` From cbc19433e79c714f2f0853b9dd932a1734ac532f Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:38:07 +0100 Subject: [PATCH 08/31] Update setup_repo.sh --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index c5d35a9dd2..a69644548d 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -26,7 +26,7 @@ else fi; if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.4" | bc -l) )); then - echo "Apt version incompatible." + echo "Apt version incompatible. Cannot install repository, but you can use the .deb package to manually install." exit 1 fi; 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 09/31] 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 From 043e841deb3aafdecf65ed323b6cc3f21c87c65c Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Sat, 18 Nov 2023 12:16:45 +0100 Subject: [PATCH 10/31] agree with better phrasing Co-authored-by: ann0see <20726856+ann0see@users.noreply.github.com> --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index f7697502b0..5b33e92241 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -16,7 +16,7 @@ if [[ $? -eq 0 ]]; then APT_MINOR=$(echo $APT_VERSION| cut -d' ' -f 2 | cut -d'.' -f 2) echo "Apt version: ${APT_VERSION}" else - echo "Apt is not available." + echo "This script is only compatible with Debian based distributions which have apt, but apt is not available. Please check that your OS is supported." exit 1 fi; From 2e6b7c97787472e5d609f98cef614a7d219b50fc Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Sat, 18 Nov 2023 12:17:00 +0100 Subject: [PATCH 11/31] better wording Co-authored-by: ann0see <20726856+ann0see@users.noreply.github.com> --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 5b33e92241..e8daba7d91 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -21,7 +21,7 @@ else fi; if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.4" | bc -l) )); then - echo "Apt version incompatible. Cannot install repository, but you can use the .deb package to manually install." + echo "Your apt version is incompatible. You cannot install this repository. Please update your OS or use the .deb package from the Website to manually install Jamulus." exit 1 fi; From e10a1caf3046757ef323a0d24796f0589cc156f3 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Sat, 18 Nov 2023 12:19:39 +0100 Subject: [PATCH 12/31] Fix coding style --- linux/setup_repo.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index e8daba7d91..2b12bd2bd0 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -11,9 +11,9 @@ fi apt --version > /dev/null if [[ $? -eq 0 ]]; then - APT_VERSION=`apt --version` - APT_MAJOR=$(echo $APT_VERSION| cut -d' ' -f 2 | cut -d'.' -f 1) - APT_MINOR=$(echo $APT_VERSION| cut -d' ' -f 2 | cut -d'.' -f 2) + APT_VERSION=$(apt --version) + APT_MAJOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 1) + APT_MINOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 2) echo "Apt version: ${APT_VERSION}" else echo "This script is only compatible with Debian based distributions which have apt, but apt is not available. Please check that your OS is supported." From af79d0c990ef89c63ea4b985ff6ec488d536bd59 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 20 Nov 2023 10:16:59 +0100 Subject: [PATCH 13/31] Fix bash scripting style Don't test for exit code but use an if construct with test instead --- linux/setup_repo.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 2b12bd2bd0..9a54238ee2 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -9,12 +9,9 @@ fi # Check for apt version >= 2.4.0 (if found, assuming Debian-based compatible with repo) -apt --version > /dev/null -if [[ $? -eq 0 ]]; then - APT_VERSION=$(apt --version) - APT_MAJOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 1) - APT_MINOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 2) - echo "Apt version: ${APT_VERSION}" +if APT_VERSION="$(apt --version)"; then + APT_MAJOR=$(echo $APT_VERSION| cut -d' ' -f 2 | cut -d'.' -f 1) + APT_MINOR=$(echo $APT_VERSION| cut -d' ' -f 2 | cut -d'.' -f 2) else echo "This script is only compatible with Debian based distributions which have apt, but apt is not available. Please check that your OS is supported." exit 1 From 51ab0c26858ade5e7a9c2d03068380cd5aec3f95 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 20 Nov 2023 10:25:18 +0100 Subject: [PATCH 14/31] Quote Ubuntu apt issue URL Add question to proceed anyway and quote issue URI. --- linux/setup_repo.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 9a54238ee2..dbac9eef25 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -8,6 +8,7 @@ if [[ ${EUID} -ne 0 ]]; then fi # Check for apt version >= 2.4.0 (if found, assuming Debian-based compatible with repo) +# Issue: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095 if APT_VERSION="$(apt --version)"; then APT_MAJOR=$(echo $APT_VERSION| cut -d' ' -f 2 | cut -d'.' -f 1) @@ -18,8 +19,16 @@ else fi; if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.4" | bc -l) )); then - echo "Your apt version is incompatible. You cannot install this repository. Please update your OS or use the .deb package from the Website to manually install Jamulus." - exit 1 + echo "Your apt version is incompatible. You may not be able install this repository. " + echo "See issue: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" + echo "Please update your OS or use the .deb package from the Website to manually install Jamulus." + echo "Do you wish to install anyway?" + select yn in "Yes" "No"; do + case $yn in + Yes ) echo "Proceeding with override"; break;; + No ) exit 1;; + esac + done fi; # We have an acceptable Apt version, continuing From 1f48583a24ebd9c1d093378586f13e26a3ac94ad Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 20 Nov 2023 10:42:54 +0100 Subject: [PATCH 15/31] Change apt version detected to be at least 2.2.x The commit for fixing the issue was included in apt 2.2 (indeed apt >=2.1.15 contains the commit but testing for at least the 2.2.x branch seems sensible) --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index dbac9eef25..df630e965f 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -18,7 +18,7 @@ else exit 1 fi; -if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.4" | bc -l) )); then +if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l) )); then echo "Your apt version is incompatible. You may not be able install this repository. " echo "See issue: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" echo "Please update your OS or use the .deb package from the Website to manually install Jamulus." From 59eaa6f81250d63a810f60de197b891ffd958789 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 20 Nov 2023 12:37:34 +0100 Subject: [PATCH 16/31] agree with change Co-authored-by: ann0see <20726856+ann0see@users.noreply.github.com> --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index df630e965f..3ebc3d112e 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -25,7 +25,7 @@ if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l) )); then echo "Do you wish to install anyway?" select yn in "Yes" "No"; do case $yn in - Yes ) echo "Proceeding with override"; break;; + Yes ) echo "Proceeding with override. You have been warned!"; break;; No ) exit 1;; esac done From a5a08d0d3310af43f8c423aee210e3b7555d5475 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:09:44 +0100 Subject: [PATCH 17/31] Fix quoting Regression on recent update, now fixed (quoting to prevent shell globbing) --- linux/setup_repo.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 3ebc3d112e..cd7507787a 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -11,8 +11,8 @@ fi # Issue: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095 if APT_VERSION="$(apt --version)"; then - APT_MAJOR=$(echo $APT_VERSION| cut -d' ' -f 2 | cut -d'.' -f 1) - APT_MINOR=$(echo $APT_VERSION| cut -d' ' -f 2 | cut -d'.' -f 2) + APT_MAJOR=$(echo "$APT_VERSION"| cut -d' ' -f 2 | cut -d'.' -f 1) + APT_MINOR=$(echo "$APT_VERSION"| cut -d' ' -f 2 | cut -d'.' -f 2) else echo "This script is only compatible with Debian based distributions which have apt, but apt is not available. Please check that your OS is supported." exit 1 From 5a837746a7943efdad4d568726d5220e9f55898a Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:43:13 +0100 Subject: [PATCH 18/31] Change select/case statement Attempting to adhere to scripting guidelines --- linux/setup_repo.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index cd7507787a..4c231a8a3d 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -25,14 +25,18 @@ if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l) )); then echo "Do you wish to install anyway?" select yn in "Yes" "No"; do case $yn in - Yes ) echo "Proceeding with override. You have been warned!"; break;; - No ) exit 1;; + Yes ) + echo "Proceeding with override. You have been warned!" + break + ;; + No ) + echo "Exiting." + exit 1 + ;; esac done fi; -# 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 GITHUB_REPOSITORY="jamulussoftware/jamulus" From 0ebf5de89d6a6a9fe63a8279e7a92c3bd6b3cb41 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:46:20 +0100 Subject: [PATCH 19/31] Add link to jamulus github issue --- linux/setup_repo.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 4c231a8a3d..0c8683be71 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -20,9 +20,10 @@ fi; if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l) )); then echo "Your apt version is incompatible. You may not be able install this repository. " - echo "See issue: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" + echo "See: https://github.com/orgs/jamulussoftware/discussions/3180" + echo "Also of interest: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" echo "Please update your OS or use the .deb package from the Website to manually install Jamulus." - echo "Do you wish to install anyway?" + echo "Do you wish to attempt to install the repository anyway?" select yn in "Yes" "No"; do case $yn in Yes ) From 3dbb2a5bca542fa3b64acc0f6cbffbd4b9cb0ca1 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Thu, 23 Nov 2023 15:48:46 +0100 Subject: [PATCH 20/31] Clarify continue anyway statement --- linux/setup_repo.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 0c8683be71..2c66d6b782 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -24,6 +24,7 @@ if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l) )); then echo "Also of interest: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" echo "Please update your OS or use the .deb package from the Website to manually install Jamulus." echo "Do you wish to attempt to install the repository anyway?" + echo "(not recommended, as you might need to fix your apt configuration)" select yn in "Yes" "No"; do case $yn in Yes ) From 92e28090acfae55ecb83da49482c28426b559126 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Thu, 23 Nov 2023 16:06:10 +0100 Subject: [PATCH 21/31] Another attempt at fixing coding style I think I have it. A user controlled exit, responding to a question should exit with code 0 and not code 1. Perhaps. --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 2c66d6b782..a5ef33f189 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -33,7 +33,7 @@ if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l) )); then ;; No ) echo "Exiting." - exit 1 + exit 0 ;; esac done From 3762abb60098a42174046b3ba9135fd3e9f3a70a Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Thu, 23 Nov 2023 16:08:20 +0100 Subject: [PATCH 22/31] Update setup_repo.sh --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index a5ef33f189..01531d6dc4 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -7,7 +7,7 @@ if [[ ${EUID} -ne 0 ]]; then exit 1 fi -# Check for apt version >= 2.4.0 (if found, assuming Debian-based compatible with repo) +# Check for apt version >= 2.2.0 (if found, assuming Debian-based compatible with repo) # Issue: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095 if APT_VERSION="$(apt --version)"; then From 5536538f4e380cc36b572f5fba8404fb8916bd29 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:00:14 +0100 Subject: [PATCH 23/31] Minor text change (add line break) and use shfmt I have literally run this through shfmt to clean code inconsistencies All it did was change a couple indentations and get rid of some semicolons after if/fi; blocks, but they worked before. Maybe this will pass now? If it doesn't, I'm stumped, or I'm triggering a minor bug in GitHub actions. --- linux/setup_repo.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 01531d6dc4..aa283329bb 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -3,22 +3,23 @@ # This script installs a Jamulus repository to Debian based systems if [[ ${EUID} -ne 0 ]]; then - echo "Error: This script must be run as root." - exit 1 + echo "Error: This script must be run as root." + exit 1 fi # Check for apt version >= 2.2.0 (if found, assuming Debian-based compatible with repo) # Issue: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095 if APT_VERSION="$(apt --version)"; then - APT_MAJOR=$(echo "$APT_VERSION"| cut -d' ' -f 2 | cut -d'.' -f 1) - APT_MINOR=$(echo "$APT_VERSION"| cut -d' ' -f 2 | cut -d'.' -f 2) + APT_MAJOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 1) + APT_MINOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 2) else - echo "This script is only compatible with Debian based distributions which have apt, but apt is not available. Please check that your OS is supported." + echo "This script is only compatible with Debian based distributions which have apt." + echo "It seems apt is not available. Please check that your OS is supported." exit 1 -fi; +fi -if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l) )); then +if (($(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l))); then echo "Your apt version is incompatible. You may not be able install this repository. " echo "See: https://github.com/orgs/jamulussoftware/discussions/3180" echo "Also of interest: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" @@ -27,31 +28,31 @@ if (( $(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l) )); then echo "(not recommended, as you might need to fix your apt configuration)" select yn in "Yes" "No"; do case $yn in - Yes ) + Yes) echo "Proceeding with override. You have been warned!" break ;; - No ) + No) echo "Exiting." exit 0 ;; esac done -fi; +fi REPO_FILE=/etc/apt/sources.list.d/jamulus.list KEY_FILE=/etc/apt/trusted.gpg.d/jamulus.asc GITHUB_REPOSITORY="jamulussoftware/jamulus" echo "Setting up Jamulus repo at ${REPO_FILE}..." -echo "deb https://github.com/${GITHUB_REPOSITORY}/releases/latest/download/ ./" > ${REPO_FILE} +echo "deb https://github.com/${GITHUB_REPOSITORY}/releases/latest/download/ ./" >${REPO_FILE} echo "Installing Jamulus GPG key at ${KEY_FILE}..." curl --fail --show-error -sLo "${KEY_FILE}" https://github.com/${GITHUB_REPOSITORY}/releases/latest/download/key.asc CURL_EXITCODE=$? if [[ ${CURL_EXITCODE} -ne 0 ]]; then - echo "Error: Download of gpg key failed. Please try again later." - exit ${CURL_EXITCODE} + echo "Error: Download of gpg key failed. Please try again later." + exit ${CURL_EXITCODE} fi echo "Running apt update..." From 8a3ed252f725cc6a1d6b1a59fe2d80609358c6a9 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:04:30 +0100 Subject: [PATCH 24/31] Change indentation to shfmt default Yes, tabs not spaces... --- linux/setup_repo.sh | 53 ++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index aa283329bb..e2767cdb11 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -3,41 +3,40 @@ # This script installs a Jamulus repository to Debian based systems if [[ ${EUID} -ne 0 ]]; then - echo "Error: This script must be run as root." - exit 1 + echo "Error: This script must be run as root." + exit 1 fi # Check for apt version >= 2.2.0 (if found, assuming Debian-based compatible with repo) # Issue: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095 if APT_VERSION="$(apt --version)"; then - APT_MAJOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 1) - APT_MINOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 2) + APT_MAJOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 1) + APT_MINOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 2) else - echo "This script is only compatible with Debian based distributions which have apt." - echo "It seems apt is not available. Please check that your OS is supported." - exit 1 + echo "This script is only compatible with Debian based distributions which have apt, but apt is not available. Please check that your OS is supported." + exit 1 fi if (($(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l))); then - echo "Your apt version is incompatible. You may not be able install this repository. " - echo "See: https://github.com/orgs/jamulussoftware/discussions/3180" - echo "Also of interest: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" - echo "Please update your OS or use the .deb package from the Website to manually install Jamulus." - echo "Do you wish to attempt to install the repository anyway?" - echo "(not recommended, as you might need to fix your apt configuration)" - select yn in "Yes" "No"; do - case $yn in - Yes) - echo "Proceeding with override. You have been warned!" - break - ;; - No) - echo "Exiting." - exit 0 - ;; - esac - done + echo "Your apt version is incompatible. You may not be able install this repository. " + echo "See: https://github.com/orgs/jamulussoftware/discussions/3180" + echo "Also of interest: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" + echo "Please update your OS or use the .deb package from the Website to manually install Jamulus." + echo "Do you wish to attempt to install the repository anyway?" + echo "(not recommended, as you might need to fix your apt configuration)" + select yn in "Yes" "No"; do + case $yn in + Yes) + echo "Proceeding with override. You have been warned!" + break + ;; + No) + echo "Exiting." + exit 0 + ;; + esac + done fi REPO_FILE=/etc/apt/sources.list.d/jamulus.list @@ -51,8 +50,8 @@ curl --fail --show-error -sLo "${KEY_FILE}" https://github.com/${GITHUB_REPOSITO CURL_EXITCODE=$? if [[ ${CURL_EXITCODE} -ne 0 ]]; then - echo "Error: Download of gpg key failed. Please try again later." - exit ${CURL_EXITCODE} + echo "Error: Download of gpg key failed. Please try again later." + exit ${CURL_EXITCODE} fi echo "Running apt update..." From 211b69a216829e74742c0272c2f81293ae6c1931 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:44:04 +0100 Subject: [PATCH 25/31] Set indents to 4 spaces, if this fails I give up --- linux/setup_repo.sh | 52 ++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index e2767cdb11..09a425b17f 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -3,40 +3,40 @@ # This script installs a Jamulus repository to Debian based systems if [[ ${EUID} -ne 0 ]]; then - echo "Error: This script must be run as root." - exit 1 + echo "Error: This script must be run as root." + exit 1 fi # Check for apt version >= 2.2.0 (if found, assuming Debian-based compatible with repo) # Issue: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095 if APT_VERSION="$(apt --version)"; then - APT_MAJOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 1) - APT_MINOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 2) + APT_MAJOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 1) + APT_MINOR=$(echo "$APT_VERSION" | cut -d' ' -f 2 | cut -d'.' -f 2) else - echo "This script is only compatible with Debian based distributions which have apt, but apt is not available. Please check that your OS is supported." - exit 1 + echo "This script is only compatible with Debian based distributions which have apt, but apt is not available. Please check that your OS is supported." + exit 1 fi if (($(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l))); then - echo "Your apt version is incompatible. You may not be able install this repository. " - echo "See: https://github.com/orgs/jamulussoftware/discussions/3180" - echo "Also of interest: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" - echo "Please update your OS or use the .deb package from the Website to manually install Jamulus." - echo "Do you wish to attempt to install the repository anyway?" - echo "(not recommended, as you might need to fix your apt configuration)" - select yn in "Yes" "No"; do - case $yn in - Yes) - echo "Proceeding with override. You have been warned!" - break - ;; - No) - echo "Exiting." - exit 0 - ;; - esac - done + echo "Your apt version is incompatible. You may not be able install this repository. " + echo "See: https://github.com/orgs/jamulussoftware/discussions/3180" + echo "Also of interest: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" + echo "Please update your OS or use the .deb package from the Website to manually install Jamulus." + echo "Do you wish to attempt to install the repository anyway?" + echo "(not recommended, as you might need to fix your apt configuration)" + select yn in "Yes" "No"; do + case $yn in + Yes) + echo "Proceeding with override. You have been warned!" + break + ;; + No) + echo "Exiting." + exit 0 + ;; + esac + done fi REPO_FILE=/etc/apt/sources.list.d/jamulus.list @@ -50,8 +50,8 @@ curl --fail --show-error -sLo "${KEY_FILE}" https://github.com/${GITHUB_REPOSITO CURL_EXITCODE=$? if [[ ${CURL_EXITCODE} -ne 0 ]]; then - echo "Error: Download of gpg key failed. Please try again later." - exit ${CURL_EXITCODE} + echo "Error: Download of gpg key failed. Please try again later." + exit ${CURL_EXITCODE} fi echo "Running apt update..." From 086680b6be705babeac7ee4ffcb6ddb879895732 Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:49:20 +0100 Subject: [PATCH 26/31] Update setup_repo.sh --- linux/setup_repo.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 09a425b17f..8000ddfcba 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -27,14 +27,14 @@ if (($(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l))); then echo "(not recommended, as you might need to fix your apt configuration)" select yn in "Yes" "No"; do case $yn in - Yes) - echo "Proceeding with override. You have been warned!" - break - ;; - No) - echo "Exiting." - exit 0 - ;; + Yes) + echo "Proceeding with override. You have been warned!" + break + ;; + No) + echo "Exiting." + exit 0 + ;; esac done fi From 5a49e76a1d20c7412a922c4e71434f13ad883c0c Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:51:12 +0100 Subject: [PATCH 27/31] Fix styling --- linux/setup_repo.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 8000ddfcba..81ec9723ce 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -27,14 +27,14 @@ if (($(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l))); then echo "(not recommended, as you might need to fix your apt configuration)" select yn in "Yes" "No"; do case $yn in - Yes) - echo "Proceeding with override. You have been warned!" - break - ;; + Yes) + echo "Proceeding with override. You have been warned!" + break + ;; No) - echo "Exiting." - exit 0 - ;; + echo "Exiting." + exit 0 + ;; esac done fi From 3cd11400753bbeccb4da669978294b23ee57f43d Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Thu, 23 Nov 2023 21:52:49 +0100 Subject: [PATCH 28/31] Fix another styling issue --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 81ec9723ce..6a486f7f7f 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -44,7 +44,7 @@ KEY_FILE=/etc/apt/trusted.gpg.d/jamulus.asc GITHUB_REPOSITORY="jamulussoftware/jamulus" echo "Setting up Jamulus repo at ${REPO_FILE}..." -echo "deb https://github.com/${GITHUB_REPOSITORY}/releases/latest/download/ ./" >${REPO_FILE} +echo "deb https://github.com/${GITHUB_REPOSITORY}/releases/latest/download/ ./" > ${REPO_FILE} echo "Installing Jamulus GPG key at ${KEY_FILE}..." curl --fail --show-error -sLo "${KEY_FILE}" https://github.com/${GITHUB_REPOSITORY}/releases/latest/download/key.asc From 13eb306cb59709fe39cd271edcc1480795665a60 Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Tue, 28 Nov 2023 23:37:39 +0100 Subject: [PATCH 29/31] Include separate compare for MAJOR and MINOR as it should be Co-authored-by: Peter L Jones --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 6a486f7f7f..f701f19656 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -18,7 +18,7 @@ else exit 1 fi -if (($(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l))); then +if [[ ${APT_MAJOR} -lt 2 || ( ${APT_MAJOR} -eq 2 && ${APT_MINOR} -lt 2 ) ]]; then echo "Your apt version is incompatible. You may not be able install this repository. " echo "See: https://github.com/orgs/jamulussoftware/discussions/3180" echo "Also of interest: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" From ef5208ebd7a4110b31720a67056237760603370d Mon Sep 17 00:00:00 2001 From: Simon White <69164084+houbsta@users.noreply.github.com> Date: Fri, 1 Dec 2023 20:10:28 +0100 Subject: [PATCH 30/31] Correct wording As per suggestion --- linux/setup_repo.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index f701f19656..5ed40a37a9 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -19,10 +19,12 @@ else fi if [[ ${APT_MAJOR} -lt 2 || ( ${APT_MAJOR} -eq 2 && ${APT_MINOR} -lt 2 ) ]]; then - echo "Your apt version is incompatible. You may not be able install this repository. " - echo "See: https://github.com/orgs/jamulussoftware/discussions/3180" + echo "This repository is not compatible with your apt version." + echo "You can install Jamulus manually using the .deb package from " + echo "https://github.com/jamulussoftware/jamulus/releases or update your OS." + echo "For more information see: https://github.com/orgs/jamulussoftware/discussions/3180" echo "Also of interest: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1950095" - echo "Please update your OS or use the .deb package from the Website to manually install Jamulus." + echo echo "Do you wish to attempt to install the repository anyway?" echo "(not recommended, as you might need to fix your apt configuration)" select yn in "Yes" "No"; do From dccc6454b3043fb18cedae4e8427849e10f7911f Mon Sep 17 00:00:00 2001 From: ann0see <20726856+ann0see@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:05:53 +0100 Subject: [PATCH 31/31] Fix code style --- linux/setup_repo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/setup_repo.sh b/linux/setup_repo.sh index 5ed40a37a9..a6cd9e5ee8 100755 --- a/linux/setup_repo.sh +++ b/linux/setup_repo.sh @@ -18,7 +18,7 @@ else exit 1 fi -if [[ ${APT_MAJOR} -lt 2 || ( ${APT_MAJOR} -eq 2 && ${APT_MINOR} -lt 2 ) ]]; then +if [[ ${APT_MAJOR} -lt 2 || (${APT_MAJOR} -eq 2 && ${APT_MINOR} -lt 2) ]]; then echo "This repository is not compatible with your apt version." echo "You can install Jamulus manually using the .deb package from " echo "https://github.com/jamulussoftware/jamulus/releases or update your OS."