Hykilpikonna 2022-08-20 20:10:53 -04:00
parent 8f8ecb7b94
commit 206fa8d726

View file

@ -1130,14 +1130,8 @@ get_distro() {
elif [[ -d /system/app/ && -d /system/priv-app ]]; then elif [[ -d /system/app/ && -d /system/priv-app ]]; then
distro="Android $(getprop ro.build.version.release)" distro="Android $(getprop ro.build.version.release)"
# Chrome OS doesn't conform to the /etc/*-release standard.
# While the file is a series of variables they can't be sourced
# by the shell since the values aren't quoted.
elif [[ -f /etc/lsb-release && $(< /etc/lsb-release) == *CHROMEOS* ]]; then
distro='Chrome OS'
elif [[ -f /etc/vzlinux-release ]]; then elif [[ -f /etc/vzlinux-release ]]; then
distro='VzLinux' distro='VzLinux'
elif type -p guix >/dev/null; then elif type -p guix >/dev/null; then
@ -1200,14 +1194,19 @@ get_distro() {
*) distro+=" on Windows $windows_version" ;; *) distro+=" on Windows $windows_version" ;;
esac esac
# Chrome OS doesn't conform to the /etc/*-release standard.
# While the file is a series of variables they can't be sourced
# by the shell since the values aren't quoted.
elif [[ -f /etc/lsb-release && $(< /etc/lsb-release) == *CHROMEOS* ]]; then
distro='Chrome OS'
elif [[ $(< /proc/version) == *chrome-bot* || -f /dev/cros_ec ]]; then elif [[ $(< /proc/version) == *chrome-bot* || -f /dev/cros_ec ]]; then
[[ $distro != *Chrome* ]] && [[ $distro != *Chrome* ]] &&
case $distro_shorthand in case $distro_shorthand in
on) distro+=" [Chrome OS]" ;; on) distro="Chrome OS $distro" ;;
tiny) distro="Chrome OS" ;; tiny) distro="Chrome OS" ;;
*) distro+=" on Chrome OS" ;; *) distro="Chrome OS $distro" ;;
esac esac
distro=${distro## on }
fi fi
distro=$(trim_quotes "$distro") distro=$(trim_quotes "$distro")