Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for Ubuntu and Ubuntu version #3199

Merged
merged 31 commits into from
Dec 8, 2023
Merged
Changes from 28 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
dd790af
Test for Ubuntu and Ubuntu version
houbsta Nov 13, 2023
50070b0
Update setup_repo.sh
houbsta Nov 13, 2023
1183f3e
Update setup_repo.sh
houbsta Nov 13, 2023
3c5a14f
Clean up and add better testing
houbsta Nov 13, 2023
4ba5a3d
Add question for install anyway if Ubuntu not detected
houbsta Nov 13, 2023
0532bf0
Update setup_repo.sh
houbsta Nov 13, 2023
772335e
Add test for apt and version >=2.4
houbsta Nov 16, 2023
cbc1943
Update setup_repo.sh
houbsta Nov 16, 2023
02bb7c3
Simplify to a simple apt version check
houbsta Nov 17, 2023
043e841
agree with better phrasing
houbsta Nov 18, 2023
2e6b7c9
better wording
houbsta Nov 18, 2023
e10a1ca
Fix coding style
houbsta Nov 18, 2023
af79d0c
Fix bash scripting style
houbsta Nov 20, 2023
51ab0c2
Quote Ubuntu apt issue URL
houbsta Nov 20, 2023
1f48583
Change apt version detected to be at least 2.2.x
houbsta Nov 20, 2023
59eaa6f
agree with change
houbsta Nov 20, 2023
a5a08d0
Fix quoting
houbsta Nov 20, 2023
5a83774
Change select/case statement
houbsta Nov 23, 2023
0ebf5de
Add link to jamulus github issue
houbsta Nov 23, 2023
3dbb2a5
Clarify continue anyway statement
houbsta Nov 23, 2023
92e2809
Another attempt at fixing coding style
houbsta Nov 23, 2023
3762abb
Update setup_repo.sh
houbsta Nov 23, 2023
5536538
Minor text change (add line break) and use shfmt
houbsta Nov 23, 2023
8a3ed25
Change indentation to shfmt default
houbsta Nov 23, 2023
211b69a
Set indents to 4 spaces, if this fails I give up
houbsta Nov 23, 2023
086680b
Update setup_repo.sh
ann0see Nov 23, 2023
5a49e76
Fix styling
ann0see Nov 23, 2023
3cd1140
Fix another styling issue
ann0see Nov 23, 2023
13eb306
Include separate compare for MAJOR and MINOR
houbsta Nov 28, 2023
ef5208e
Correct wording
houbsta Dec 1, 2023
dccc645
Fix code style
ann0see Dec 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 36 additions & 4 deletions linux/setup_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +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)
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 (($(echo "${APT_MAJOR}.${APT_MINOR} < 2.2" | bc -l))); then
houbsta marked this conversation as resolved.
Show resolved Hide resolved
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
Expand All @@ -18,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..."
Expand Down