[PR] #191 from BKasin/debian-version

[F] Use /etc/debian_version to get .x on Debian
This commit is contained in:
Azalea 2023-09-26 07:46:06 -07:00 committed by GitHub
commit 54d82ff557
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1169,12 +1169,22 @@ get_distro() {
fi
elif type -p lsb_release >/dev/null; then
# Debian does not include .x versions in /etc/os-version, but does in debian_version
if [[ -f /etc/debian_version ]]; then
. /etc/os-release
case $distro_shorthand in
on) distro="${NAME}" ;;
tiny) distro="$(lsb_release -si)" ;;
*) distro="${NAME} $(< /etc/debian_version) (${VERSION_CODENAME})" ;;
esac
else
case $distro_shorthand in
on) lsb_flags=-si ;;
tiny) lsb_flags=-si ;;
*) lsb_flags=-sd ;;
esac
distro=$(lsb_release "$lsb_flags")
fi
elif [[ -f /etc/os-release || \
-f /usr/lib/os-release || \