oschaaf closed pull request #1552: Honor assume yes when installing dependencies URL: https://github.com/apache/incubator-pagespeed-ngx/pull/1552
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/scripts/build_ngx_pagespeed.sh b/scripts/build_ngx_pagespeed.sh index c305d93d3..36b0f2224 100755 --- a/scripts/build_ngx_pagespeed.sh +++ b/scripts/build_ngx_pagespeed.sh @@ -484,10 +484,16 @@ add support for dynamic modules in a way compatible with ngx_pagespeed until extra_flags=() # Now make sure our dependencies are installed. if "$DO_DEPS_CHECK"; then + INSTALL_FLAGS="" + + if "$ASSUME_YES"; then + INSTALL_FLAGS="-y" + fi + if [ -f /etc/debian_version ]; then status "Detected debian-based distro." - install_dependencies "apt-get install" debian_is_installed \ + install_dependencies "apt-get install ${INSTALL_FLAGS}" debian_is_installed \ build-essential zlib1g-dev libpcre3 libpcre3-dev unzip uuid-dev if gcc_too_old; then @@ -495,7 +501,7 @@ add support for dynamic modules in a way compatible with ngx_pagespeed until status "Detected that gcc is older than 4.8. Installing gcc-mozilla" status "which installs gcc-4.8 into /usr/lib/gcc-mozilla/ and doesn't" status "affect your global gcc installation." - run sudo apt-get install gcc-mozilla + run sudo apt-get install ${INSTALL_FLAGS} gcc-mozilla fi 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 elif [ -f /etc/redhat-release ]; then status "Detected redhat-based distro." - install_dependencies "yum install" redhat_is_installed \ + install_dependencies "yum install ${INSTALL_FLAGS}" redhat_is_installed \ gcc-c++ pcre-devel zlib-devel make unzip wget libuuid-devel if gcc_too_old; then if [ ! -e /opt/rh/devtoolset-2/root/usr/bin/gcc ]; then @@ -539,7 +545,7 @@ $(cat /etc/redhat-release) Expected 5 or 6." repo_url+="/docs/repository/cern/devtoolset/" repo_url+="slc${slc_version}-devtoolset.repo" run sudo wget -O "$repo_fname" "$repo_url" - run sudo yum install devtoolset-2-gcc-c++ devtoolset-2-binutils + run sudo yum install ${INSTALL_FLAGS} devtoolset-2-gcc-c++ devtoolset-2-binutils fi extra_flags=("--with-cc=/opt/rh/devtoolset-2/root/usr/bin/gcc") fi ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services