Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 343851a

Browse files
dsanders11oschaaf
authored andcommitted
Honor assume yes when installing dependencies (#1552)
1 parent 2e202e5 commit 343851a

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

scripts/build_ngx_pagespeed.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -484,18 +484,24 @@ add support for dynamic modules in a way compatible with ngx_pagespeed until
484484
extra_flags=()
485485
# Now make sure our dependencies are installed.
486486
if "$DO_DEPS_CHECK"; then
487+
INSTALL_FLAGS=""
488+
489+
if "$ASSUME_YES"; then
490+
INSTALL_FLAGS="-y"
491+
fi
492+
487493
if [ -f /etc/debian_version ]; then
488494
status "Detected debian-based distro."
489495

490-
install_dependencies "apt-get install" debian_is_installed \
496+
install_dependencies "apt-get install ${INSTALL_FLAGS}" debian_is_installed \
491497
build-essential zlib1g-dev libpcre3 libpcre3-dev unzip uuid-dev
492498

493499
if gcc_too_old; then
494500
if [ ! -e /usr/lib/gcc-mozilla/bin/gcc ]; then
495501
status "Detected that gcc is older than 4.8. Installing gcc-mozilla"
496502
status "which installs gcc-4.8 into /usr/lib/gcc-mozilla/ and doesn't"
497503
status "affect your global gcc installation."
498-
run sudo apt-get install gcc-mozilla
504+
run sudo apt-get install ${INSTALL_FLAGS} gcc-mozilla
499505
fi
500506

501507
extra_flags=("--with-cc=/usr/lib/gcc-mozilla/bin/gcc" \
@@ -505,7 +511,7 @@ add support for dynamic modules in a way compatible with ngx_pagespeed until
505511
elif [ -f /etc/redhat-release ]; then
506512
status "Detected redhat-based distro."
507513

508-
install_dependencies "yum install" redhat_is_installed \
514+
install_dependencies "yum install ${INSTALL_FLAGS}" redhat_is_installed \
509515
gcc-c++ pcre-devel zlib-devel make unzip wget libuuid-devel
510516
if gcc_too_old; then
511517
if [ ! -e /opt/rh/devtoolset-2/root/usr/bin/gcc ]; then
@@ -539,7 +545,7 @@ $(cat /etc/redhat-release) Expected 5 or 6."
539545
repo_url+="/docs/repository/cern/devtoolset/"
540546
repo_url+="slc${slc_version}-devtoolset.repo"
541547
run sudo wget -O "$repo_fname" "$repo_url"
542-
run sudo yum install devtoolset-2-gcc-c++ devtoolset-2-binutils
548+
run sudo yum install ${INSTALL_FLAGS} devtoolset-2-gcc-c++ devtoolset-2-binutils
543549
fi
544550
extra_flags=("--with-cc=/opt/rh/devtoolset-2/root/usr/bin/gcc")
545551
fi

0 commit comments

Comments
 (0)