diff options
author | rain <rainbeam@riseup.net> | 2016-08-17 02:31:52 +0800 |
---|---|---|
committer | rain <rainbeam@riseup.net> | 2016-08-17 02:37:51 +0800 |
commit | 14c15e815458b97f0148a443d5ac5de8a7379123 (patch) | |
tree | b01efad32441cf68751706f62e24f6e7cdf58447 /scripts/install_deps.sh | |
parent | f1ee87664482ec816d544d226c1f96072ccc8fb2 (diff) | |
download | dexon-solidity-14c15e815458b97f0148a443d5ac5de8a7379123.tar.gz dexon-solidity-14c15e815458b97f0148a443d5ac5de8a7379123.tar.zst dexon-solidity-14c15e815458b97f0148a443d5ac5de8a7379123.zip |
fall back to os-release if lsb_release not present
Diffstat (limited to 'scripts/install_deps.sh')
-rwxr-xr-x | scripts/install_deps.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/install_deps.sh b/scripts/install_deps.sh index 3884cb12..2ae17737 100755 --- a/scripts/install_deps.sh +++ b/scripts/install_deps.sh @@ -56,7 +56,14 @@ uname -v > /dev/null 2>&1 || { echo >&2 "ERROR - solidity requires 'uname' to identify the platform."; exit 1; } detect_linux_distro() { - DISTRO=$(lsb_release -is) + if [ $(command -v lsb_release) ]; then + DISTRO=$(lsb_release -is) + elif [ -f /etc/os-release ]; then + # extract 'foo' from NAME=foo, only on the line with NAME=foo + DISTRO=$(sed -n -e 's/^NAME="\(.*\)\"/\1/p' /etc/os-release) + else + DISTRO='' + fi echo $DISTRO } |