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

Commit

Permalink
Merge pull request #6759 from EOSIO/noninteractive_build_scripts_16x
Browse files Browse the repository at this point in the history
add noninteractive option for build scripts - 1.6.x
  • Loading branch information
jgiszczak authored Feb 18, 2019
2 parents 23b06b7 + a8c01c8 commit 77b91a1
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
11 changes: 9 additions & 2 deletions eosio_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@

function usage()
{
printf "\\tUsage: %s \\n\\t[Build Option -o <Debug|Release|RelWithDebInfo|MinSizeRel>] \\n\\t[CodeCoverage -c] \\n\\t[Doxygen -d] \\n\\t[CoreSymbolName -s <1-7 characters>] \\n\\t[Avoid Compiling -a]\\n\\n" "$0" 1>&2
printf "\\tUsage: %s \\n\\t[Build Option -o <Debug|Release|RelWithDebInfo|MinSizeRel>] \\n\\t[CodeCoverage -c] \\n\\t[Doxygen -d] \\n\\t[CoreSymbolName -s <1-7 characters>] \\n\\t[Avoid Compiling -a]\\n\\t[Noninteractive -y]\\n\\n" "$0" 1>&2
exit 1
}

is_noninteractive() {
[[ -n "${EOSIO_BUILD_NONINTERACTIVE+1}" ]]
}

ARCH=$( uname )
if [ "${SOURCE_DIR}" == "${PWD}" ]; then
BUILD_DIR="${PWD}/build"
Expand Down Expand Up @@ -66,7 +70,7 @@
txtrst=$(tput sgr0)

if [ $# -ne 0 ]; then
while getopts ":cdo:s:ah" opt; do
while getopts ":cdo:s:ahy" opt; do
case "${opt}" in
o )
options=( "Debug" "Release" "RelWithDebInfo" "MinSizeRel" )
Expand Down Expand Up @@ -100,6 +104,9 @@
usage
exit 1
;;
y)
EOSIO_BUILD_NONINTERACTIVE=1
;;
\? )
printf "\\n\\tInvalid Option: %s\\n" "-${OPTARG}" 1>&2
usage
Expand Down
1 change: 1 addition & 0 deletions scripts/eosio_build_amazon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
printf "\\n\\tThe following dependencies are required to install EOSIO.\\n"
printf "\\n\\t${DISPLAY}\\n\\n"
printf "\\tDo you wish to install these dependencies?\\n"
if is_noninteractive; then exec <<< "1"; fi
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
Expand Down
4 changes: 4 additions & 0 deletions scripts/eosio_build_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
SCL=$( rpm -qa | grep -E 'centos-release-scl-[0-9].*' )
if [ -z "${SCL}" ]; then
printf "\\t - Do you wish to install and enable this repository?\\n"
if is_noninteractive; then exec <<< "1"; fi
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
Expand All @@ -87,6 +88,7 @@
DEVTOOLSET=$( rpm -qa | grep -E 'devtoolset-7-[0-9].*' )
if [ -z "${DEVTOOLSET}" ]; then
printf "\\tDo you wish to install devtoolset-7?\\n"
if is_noninteractive; then exec <<< "1"; fi
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
Expand Down Expand Up @@ -118,6 +120,7 @@
PYTHON33=$( rpm -qa | grep -E 'python33-[0-9].*' )
if [ -z "${PYTHON33}" ]; then
printf "\\tDo you wish to install python33?\\n"
if is_noninteractive; then exec <<< "1"; fi
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
Expand Down Expand Up @@ -170,6 +173,7 @@
printf "\\tThe following dependencies are required to install EOSIO.\\n"
printf "\\t${DISPLAY}\\n\\n"
printf "\\tDo you wish to install these dependencies?\\n"
if is_noninteractive; then exec <<< "1"; fi
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
Expand Down
3 changes: 3 additions & 0 deletions scripts/eosio_build_darwin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
then
printf "\\tHomebrew must be installed to compile EOS.IO\\n\\n"
printf "\\tDo you wish to install Home Brew?\\n"
if is_noninteractive; then exec <<< "1"; fi
select yn in "Yes" "No"; do
case "${yn}" in
[Yy]* )
Expand Down Expand Up @@ -138,6 +139,7 @@
printf "\\n\\tThe following dependencies are required to install EOSIO.\\n"
printf "\\n\\t${DISPLAY}\\n\\n"
echo "Do you wish to install these packages?"
if is_noninteractive; then exec <<< "1"; fi
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
Expand Down Expand Up @@ -184,6 +186,7 @@
printf "\\tFound Boost Version %s.\\n" "${BVERSION}"
printf "\\tEOS.IO requires Boost version 1.67.\\n"
printf "\\tWould you like to uninstall version %s and install Boost version 1.67.\\n" "${BVERSION}"
if is_noninteractive; then exec <<< "1"; fi
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
Expand Down
1 change: 1 addition & 0 deletions scripts/eosio_build_fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
printf "\\n\\tThe following dependencies are required to install EOSIO.\\n"
printf "\\n\\t${DISPLAY}\\n\\n"
printf "\\tDo you wish to install these dependencies?\\n"
if is_noninteractive; then exec <<< "1"; fi
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
Expand Down
1 change: 1 addition & 0 deletions scripts/eosio_build_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
printf "\\n\\tThe following dependencies are required to install EOSIO.\\n"
printf "\\n\\t${DISPLAY}\\n\\n"
printf "\\tDo you wish to install these packages?\\n"
if is_noninteractive; then exec <<< "1"; fi
select yn in "Yes" "No"; do
case $yn in
[Yy]* )
Expand Down

0 comments on commit 77b91a1

Please sign in to comment.