Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jamulussoftware/jamulus
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f7e1ec8fea9bef7a3b31c9b27849fc85311ae106
Choose a base ref
..
head repository: jamulussoftware/jamulus
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ae1c5aa36d844f6a90c74b74af43d7a10c5e833b
Choose a head ref
Showing with 38 additions and 4 deletions.
  1. +38 −4 linux/setup_repo.sh
42 changes: 38 additions & 4 deletions linux/setup_repo.sh
Original file line number Diff line number Diff line change
@@ -3,8 +3,42 @@
# 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)
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
fi

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."
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
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
@@ -18,8 +52,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..."