diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2016-07-20 15:42:41 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2016-07-20 15:42:41 -0400 |
commit | de413e7ae293f2b919e2e75369c1ecb8a0c83975 (patch) | |
tree | 143ea097ea9e740c48b62335d468e9b0543be7b3 /include/sysinfo.sh | |
download | astroconda-control-de413e7ae293f2b919e2e75369c1ecb8a0c83975.tar.gz |
Initial commit
Diffstat (limited to 'include/sysinfo.sh')
-rw-r--r-- | include/sysinfo.sh | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/include/sysinfo.sh b/include/sysinfo.sh new file mode 100644 index 0000000..76dbca8 --- /dev/null +++ b/include/sysinfo.sh @@ -0,0 +1,70 @@ +function check_which +{ + path="$1" + which $path &>/dev/null + status=$? + echo "$status" +} + +# For conda INSTALLERS +sysinfo_platform=`uname` +case $sysinfo_platform in + Darwin) + sysinfo_platform="MacOSX" + ;; + *) ;; +esac + +sysinfo_arch=`uname -m` +case $sysinfo_arch in + i*86) + sysinfo_arch="x86" + ;; + *) ;; +esac + +case $sysinfo_platform in + Linux) + sysinfo_fetch="wget" + sysinfo_fetch_args="-q" + ;; + *) + sysinfo_fetch="curl" + sysinfo_fetch_args="-s -L -O" + ;; +esac + +# For conda BUILDS +function conda_arch +{ + local platform= + local arch= + + case `uname` in + Linux) + platform="linux" + ;; + Darwin) + platform="osx" + ;; + *) + echo "Unsupported platform." + exit 1 + ;; + esac + + case `uname -m` in + i*86) + arch=32 + ;; + x86_64) + arch=64 + ;; + *) + echo "Unsupported architecture." + exit 1 + ;; + esac + + echo "${platform}-${arch}" +} |