Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

added sudo -E to installs for Ben on automation + zlib if fix #7297

Merged
merged 3 commits into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/eosio_build_amazon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ printf "Yum installation found at ${YUM}.\\n"
if [ $ANSWER != 1 ]; then read -p "Do you wish to update YUM repositories? (y/n) " ANSWER; fi
case $ANSWER in
1 | [Yy]* )
if ! sudo $YUM -y update; then
if ! $( [[ $(whoami) == "root" ]] || echo /usr/bin/sudo -E ) $YUM -y update; then
printf " - YUM update failed.\\n"
exit 1;
else
Expand Down Expand Up @@ -76,7 +76,7 @@ if [ "${COUNT}" -gt 1 ]; then
if [ $ANSWER != 1 ]; then read -p "Do you wish to install these dependencies? (y/n) " ANSWER; fi
case $ANSWER in
1 | [Yy]* )
if ! sudo $YUM -y install ${DEP}; then
if ! $( [[ $(whoami) == "root" ]] || echo /usr/bin/sudo -E ) $YUM -y install ${DEP}; then
printf " - YUM dependency installation failed!\\n"
exit 1;
else
Expand Down
10 changes: 5 additions & 5 deletions scripts/eosio_build_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ printf " - Yum installation found at %s.\\n" "${YUM}"
if [ $ANSWER != 1 ]; then read -p "Do you wish to update YUM repositories? (y/n) " ANSWER; fi
case $ANSWER in
1 | [Yy]* )
if ! "${YUM}" -y update; then
if ! $( [[ $(whoami) == "root" ]] || echo /usr/bin/sudo -E ) $YUM -y update; then # Must set full path to sudo as `sudo -E throws a "command not found"`
printf " - YUM update failed.\\n"
exit 1;
else
Expand All @@ -78,7 +78,7 @@ if [ -z "${SCL}" ]; then
case $ANSWER in
1 | [Yy]* )
printf "Installing SCL...\\n"
if ! "${YUM}" -y --enablerepo=extras install centos-release-scl 2>/dev/null; then
if ! $( [[ $(whoami) == "root" ]] || echo /usr/bin/sudo -E ) $YUM -y --enablerepo=extras install centos-release-scl 2>/dev/null; then
printf "!! Centos Software Collections Repository installation failed !!\\n"
printf "Exiting now.\\n\\n"
exit 1;
Expand All @@ -100,7 +100,7 @@ if [ -z "${DEVTOOLSET}" ]; then
case $ANSWER in
1 | [Yy]* )
printf "Installing devtoolset-7...\\n"
if ! "${YUM}" install -y devtoolset-7; then
if ! $( [[ $(whoami) == "root" ]] || echo /usr/bin/sudo -E ) $YUM install -y devtoolset-7; then
printf "!! Centos devtoolset-7 installation failed !!\\n"
printf "Exiting now.\\n"
exit 1;
Expand All @@ -126,7 +126,7 @@ DEP_ARRAY=(
git autoconf automake libtool make bzip2 doxygen graphviz \
bzip2-devel openssl-devel gmp-devel \
ocaml libicu-devel python python-devel rh-python36 \
gettext-devel file sudo libusbx-devel libcurl-devel
gettext-devel file libusbx-devel libcurl-devel
)
COUNT=1
DISPLAY=""
Expand All @@ -150,7 +150,7 @@ if [ "${COUNT}" -gt 1 ]; then
if [ $ANSWER != 1 ]; then read -p "Do you wish to install these dependencies? (y/n) " ANSWER; fi
case $ANSWER in
1 | [Yy]* )
if ! "${YUM}" -y install ${DEP}; then
if ! $( [[ $(whoami) == "root" ]] || echo /usr/bin/sudo -E ) "${YUM}" -y install ${DEP}; then
printf " - YUM dependency installation failed!\\n"
exit 1;
else
Expand Down
8 changes: 4 additions & 4 deletions scripts/eosio_build_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fi
DEP_ARRAY=(
git make automake libbz2-dev libssl-dev doxygen graphviz \
libgmp3-dev autotools-dev build-essential libicu-dev python2.7 python2.7-dev python3 python3-dev \
autoconf libtool curl zlib1g-dev sudo ruby libusb-1.0-0-dev libcurl4-gnutls-dev pkg-config
autoconf libtool curl zlib1g-dev ruby libusb-1.0-0-dev libcurl4-gnutls-dev pkg-config
)

# llvm-4.0 is installed into /usr/lib/llvm-4.0
Expand All @@ -81,7 +81,7 @@ fi
if [ $ANSWER != 1 ]; then read -p "Do you wish to update repositories with apt-get update? (y/n) " ANSWER; fi
case $ANSWER in
1 | [Yy]* )
if ! sudo apt-get update; then
if ! $( [[ $(whoami) == "root" ]] || echo /usr/bin/sudo -E ) apt-get update; then
printf " - APT update failed.\\n"
exit 1;
else
Expand Down Expand Up @@ -111,7 +111,7 @@ if [ "${COUNT}" -gt 1 ]; then
if [ $ANSWER != 1 ]; then read -p "Do you wish to install these packages? (y/n) " ANSWER; fi
case $ANSWER in
1 | [Yy]* )
if ! sudo apt-get -y install ${DEP}; then
if ! $( [[ $(whoami) == "root" ]] || echo /usr/bin/sudo -E ) apt-get -y install ${DEP}; then
printf " - APT dependency failed.\\n"
exit 1
else
Expand Down Expand Up @@ -219,7 +219,7 @@ if [ "$BUILD_CLANG8" = "true" ]; then

cd $SRC_LOCATION
printf "Checking zlib library installation...\\n"
if [ ! -d $OPT_LOCATION/zlib || $FORCE_BUILD ]; then
if [ ! -d $OPT_LOCATION/zlib ] || [ $FORCE_BUILD ]; then
printf "Installing zlib...\\n"
curl -LO https://www.zlib.net/zlib-1.2.11.tar.gz && tar -xf zlib-1.2.11.tar.gz \
&& cd zlib-1.2.11 && mkdir build && cd build \
Expand Down