From 66a4655cb9663ed0c52a0969812ef29211b20a7a Mon Sep 17 00:00:00 2001 From: Jordan Carlin Date: Mon, 9 Dec 2024 09:07:35 -0800 Subject: [PATCH] Initial attempt at Ubuntu derivative distro support, focusing on Linux Mint --- bin/wally-distro-check.sh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/bin/wally-distro-check.sh b/bin/wally-distro-check.sh index 7a519478a..2f24c3daf 100755 --- a/bin/wally-distro-check.sh +++ b/bin/wally-distro-check.sh @@ -76,10 +76,28 @@ if [[ "$ID" == rhel || "$ID_LIKE" == *rhel* ]]; then elif [[ "$ID" == ubuntu || "$ID_LIKE" == *ubuntu* ]]; then export FAMILY=ubuntu if [ "$ID" != ubuntu ]; then - printf "${WARNING_COLOR}%s%s\n${ENDC}" "For Ubuntu family distros, the Wally installation script has only been tested on standard Ubuntu. Your distro " \ + printf "${WARNING_COLOR}%s%s\n${ENDC}" "For Ubuntu family distros, the Wally installation script is only tested on standard Ubuntu. Your distro " \ "is $PRETTY_NAME. The regular Ubuntu install will be attempted, but there may be issues." + # Ubuntu derivates may use different version numbers. Attempt to derive version from Ubuntu codename + case "$UBUNTU_CODENAME" in + noble) + export UBUNTU_VERSION=24 + ;; + jammy) + export UBUNTU_VERSION=22 + ;; + focal) + export UBUNTU_VERSION=20 + ;; + *) + printf "${FAIL_COLOR}%s\n${ENDC}" "Unable to determine which base Ubuntu version you are using." + exit 1 + ;; + esac + echo "Detected Ubuntu derivative baesd on Ubuntu $UBUNTU_VERSION.04." + else + export UBUNTU_VERSION="${VERSION_ID:0:2}" fi - export UBUNTU_VERSION="${VERSION_ID:0:2}" if (( UBUNTU_VERSION < 20 )); then printf "${FAIL_COLOR}%s\n${ENDC}" "The Wally installation script has only been tested with Ubuntu versions 20.04 LTS, 22.04 LTS, and 24.04 LTS. You have version $VERSION." exit 1