Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ff8f9b2

Browse files
author
Bailey Kasin
committedSep 26, 2023
[F] Use /etc/debian_version to get .x on Debian
/etc/os-release on Debian only reports the major version, so use mix os-release and debian_version to build PRETTY_NAME. Signed-off-by: Bailey Kasin <baileykasin@gmail.com>
1 parent 74d1bb5 commit ff8f9b2

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed
 

‎neofetch

+16-6
Original file line numberDiff line numberDiff line change
@@ -1159,12 +1159,22 @@ get_distro() {
11591159
fi
11601160

11611161
elif type -p lsb_release >/dev/null; then
1162-
case $distro_shorthand in
1163-
on) lsb_flags=-si ;;
1164-
tiny) lsb_flags=-si ;;
1165-
*) lsb_flags=-sd ;;
1166-
esac
1167-
distro=$(lsb_release "$lsb_flags")
1162+
# Debian does not include .x versions in /etc/os-version, but does in debian_version
1163+
if [[ -f /etc/debian_version ]]; then
1164+
. /etc/os-release
1165+
case $distro_shorthand in
1166+
on) distro="${NAME}" ;;
1167+
tiny) distro="$(lsb_release -si)" ;;
1168+
*) distro="${NAME} $(< /etc/debian_version) (${VERSION_CODENAME})" ;;
1169+
esac
1170+
else
1171+
case $distro_shorthand in
1172+
on) lsb_flags=-si ;;
1173+
tiny) lsb_flags=-si ;;
1174+
*) lsb_flags=-sd ;;
1175+
esac
1176+
distro=$(lsb_release "$lsb_flags")
1177+
fi
11681178

11691179
elif [[ -f /etc/os-release || \
11701180
-f /usr/lib/os-release || \

0 commit comments

Comments
 (0)
Please sign in to comment.