Skip to content

Commit

Permalink
install_prereq.sh: Differentiate between Debian and Ubuntu.
Browse files Browse the repository at this point in the history
The Debian-based distro version check assumed it was Debian,
which would in a shell error something like this at the
beginning of any builds on Ubuntu:

./scripts/install_prereq.sh: 179: [: Illegal number: 22.04

The direct cause of the error is because Ubuntu releases are
decimal instead of purely integer. However, the versioning
scheme is different, so this check is only appropriate for
Debian and is now targeted as such.
  • Loading branch information
InterLinked1 committed Jan 23, 2025
1 parent 62ef09d commit 9415ffd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/install_prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,16 @@ if [ -f /etc/fedora-release ] || [ -f /etc/redhat-release ]; then
fi

if [ -f /etc/debian_version ]; then
DEBIAN_VERSION=$( lsb_release -a | grep "Release:" | xargs | cut -d' ' -f2 )
if [ $DEBIAN_VERSION -ge 11 ]; then
DISTRO_TYPE=$( lsb_release -a | grep "Distributor ID:" | xargs | cut -d' ' -f3 )
OLD_DEBIAN_DISTRO=0
if [ "$DISTRO_TYPE" = "Debian" ]; then
DEBIAN_VERSION=$( lsb_release -a | grep "Release:" | xargs | cut -d' ' -f2 )
if [ $DEBIAN_VERSION -le 10 ]; then
# Some packages aren't available with Debian 10
OLD_DEBIAN_DISTRO=1
fi
fi
if [ $OLD_DEBIAN_DISTRO -eq 0 ]; then
# Not available in Debian 10
PACKAGES_DEBIAN="$PACKAGES_DEBIAN libcrypt-dev" # crypt_r
# used for cal (included in menus.conf sample)
Expand Down

0 comments on commit 9415ffd

Please sign in to comment.