More tweaks to the deps script to manage edge-cases.

This commit is contained in:
Gav Wood 2016-02-06 14:28:06 +01:00
parent 7f75db688d
commit 123b001312

View File

@ -137,7 +137,7 @@ function run_installer()
get_osx_dependencies get_osx_dependencies
else else
OS_TYPE="win" OS_TYPE="win"
abortInstall "${red}==>${reset} ${b}OS not supported:${reset} parity one-liner currently support OS X and Linux.\nFor instructions on installing parity on other platforms please visit ${u}${blue}http://ethcore.io/${reset}" abortInstall "${red}==>${reset} ${b}OS not supported:${reset} Parity one-liner currently support OS X and Linux.\nFor instructions on installing parity on other platforms please visit ${u}${blue}http://ethcore.io/${reset}"
fi fi
echo echo
@ -392,8 +392,8 @@ function run_installer()
find_make find_make
find_gcc find_gcc
find_sudo
find_apt find_apt
find_sudo
} }
function find_rocksdb() function find_rocksdb()
@ -478,19 +478,25 @@ function run_installer()
function find_sudo() function find_sudo()
{ {
if [[ `whoami` == "root" ]]; then depCount=$((depCount+1))
isSudo=false SUDO_PATH=`which sudo 2>/dev/null`
else
depCount=$((depCount+1))
SUDO_PATH=`which sudo 2>/dev/null`
if [[ -f $SUDO_PATH ]] if [[ -f $SUDO_PATH ]]
then then
depFound=$((depFound+1)) depFound=$((depFound+1))
check "sudo" check "sudo"
isSudo=true isSudo=true
else
uncheck "sudo is missing"
if [[ `whoami` == "root" ]]; then
if [[ $isApt == false && $isMultirust == false ]]; then
canContinue=false
errorMessages+="${red}==>${reset} ${b}Couldn't find sudo:${reset} Sudo is needed for the installation of multirust.\n"
errorMessages+=" Please ensure you have sudo installed or alternatively install multirust manually.\n"
fi
isSudo=false
else else
uncheck "sudo is missing"
canContinue=false canContinue=false
errorMessages+="${red}==>${reset} ${b}Couldn't find sudo:${reset} Root access is needed for parts of this installation.\n" errorMessages+="${red}==>${reset} ${b}Couldn't find sudo:${reset} Root access is needed for parts of this installation.\n"
errorMessages+=" Please ensure you have sudo installed or alternatively run this script as root.\n" errorMessages+=" Please ensure you have sudo installed or alternatively run this script as root.\n"
@ -605,6 +611,9 @@ function run_installer()
if [[ $isMultirust == false ]]; then if [[ $isMultirust == false ]]; then
info "Installing multirust..." info "Installing multirust..."
if [[ $isSudo == false ]]; then
apt-get install -q -y sudo
fi
curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sudo sh -s -- --yes curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sudo sh -s -- --yes
echo echo
fi fi