From 75c5cecb20a67101eddc189f373efefcd431b71c Mon Sep 17 00:00:00 2001 From: Michael Adams Date: Sat, 30 Jul 2022 13:29:10 -0700 Subject: [PATCH] Modified the sysinfo script to better detect various OSes. --- build/sysinfo | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/build/sysinfo b/build/sysinfo index d758b333..2de15d7a 100755 --- a/build/sysinfo +++ b/build/sysinfo @@ -38,25 +38,31 @@ if [ "${#keys[@]}" -eq 0 ]; then exit 0 fi -release="$(uname -r)" || panic -kernel="$(uname)" || panic +release="$(uname -r)" || panic "cannot get release name" +kernel="$(uname)" || panic "cannot get kernel name" +kernel_lc="$(tr '[:upper:]' '[:lower:]' <<< "$kernel")" || \ + panic "cannot convert to lowercase" if [ "$verbose" -ge 1 ]; then - eecho "uname $name" - eecho "uname -r $release" + eecho "system name: $name" + eecho "release name: $release" fi os= -case "$release" in -*[Mm]icrosoft*) - os=windows;; -esac +#case "$release" in +#*[Mm]icrosoft*) +# os=windows;; +#esac if [ -z "$os" ]; then - case "$kernel" in - *[Ll]inux*) + case "$kernel_lc" in + linux*) os=linux;; + ming*) + os=windows;; + darwin*) + os=macos;; esac fi