diff --git a/dev-db/postgresql/postgresql-9.5.5.ebuild b/dev-db/postgresql/postgresql-9.5.5.ebuild index b352149ac96d8..56cafc185c77b 100644 --- a/dev-db/postgresql/postgresql-9.5.5.ebuild +++ b/dev-db/postgresql/postgresql-9.5.5.ebuild @@ -350,17 +350,22 @@ pkg_config() { einfo "The database cluster will be created in:" einfo " ${DATA_DIR}" einfo - while [ "$correct" != "true" ] ; do - einfo "Are you ready to continue? (y/n)" - read answer - if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then - correct="true" - elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then - die "Aborting initialization." - else - echo "Answer not recognized" - fi - done + + if [ -z "$PG_AUTOCONFIG" ] ; then + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (y/n)" + read answer + if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + else + einfo "PG_AUTOCONFIG set, not prompting" + fi if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then eerror "The given directory, '${DATA_DIR}', is not empty." diff --git a/dev-db/postgresql/postgresql-9.5.6.ebuild b/dev-db/postgresql/postgresql-9.5.6.ebuild index 8e8412b1fc7a9..eb493f3f39291 100644 --- a/dev-db/postgresql/postgresql-9.5.6.ebuild +++ b/dev-db/postgresql/postgresql-9.5.6.ebuild @@ -350,17 +350,21 @@ pkg_config() { einfo "The database cluster will be created in:" einfo " ${DATA_DIR}" einfo - while [ "$correct" != "true" ] ; do - einfo "Are you ready to continue? (y/n)" - read answer - if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then - correct="true" - elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then - die "Aborting initialization." - else - echo "Answer not recognized" - fi - done + if [ -z "$PG_AUTOCONFIG" ] ; then + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (y/n)" + read answer + if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + else + einfo "PG_AUTOCONFIG set, not prompting" + fi if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then eerror "The given directory, '${DATA_DIR}', is not empty." diff --git a/dev-db/postgresql/postgresql-9.6.1-r1.ebuild b/dev-db/postgresql/postgresql-9.6.1-r1.ebuild index 0c0ba8278ade2..0e4412b472c26 100644 --- a/dev-db/postgresql/postgresql-9.6.1-r1.ebuild +++ b/dev-db/postgresql/postgresql-9.6.1-r1.ebuild @@ -347,17 +347,21 @@ pkg_config() { einfo "The database cluster will be created in:" einfo " ${DATA_DIR}" einfo - while [ "$correct" != "true" ] ; do - einfo "Are you ready to continue? (y/n)" - read answer - if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then - correct="true" - elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then - die "Aborting initialization." - else - echo "Answer not recognized" - fi - done + if [ -z "$PG_AUTOCONFIG" ] ; then + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (y/n)" + read answer + if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + else + einfo "PG_AUTOCONFIG set, not prompting" + fi if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then eerror "The given directory, '${DATA_DIR}', is not empty." diff --git a/dev-db/postgresql/postgresql-9.6.2.ebuild b/dev-db/postgresql/postgresql-9.6.2.ebuild index 0c0ba8278ade2..0e4412b472c26 100644 --- a/dev-db/postgresql/postgresql-9.6.2.ebuild +++ b/dev-db/postgresql/postgresql-9.6.2.ebuild @@ -347,17 +347,21 @@ pkg_config() { einfo "The database cluster will be created in:" einfo " ${DATA_DIR}" einfo - while [ "$correct" != "true" ] ; do - einfo "Are you ready to continue? (y/n)" - read answer - if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then - correct="true" - elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then - die "Aborting initialization." - else - echo "Answer not recognized" - fi - done + if [ -z "$PG_AUTOCONFIG" ] ; then + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (y/n)" + read answer + if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + else + einfo "PG_AUTOCONFIG set, not prompting" + fi if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then eerror "The given directory, '${DATA_DIR}', is not empty." diff --git a/dev-db/postgresql/postgresql-9999.ebuild b/dev-db/postgresql/postgresql-9999.ebuild index b1d337683362b..6a995c154baa3 100644 --- a/dev-db/postgresql/postgresql-9999.ebuild +++ b/dev-db/postgresql/postgresql-9999.ebuild @@ -297,17 +297,21 @@ pkg_config() { einfo "The database cluster will be created in:" einfo " ${DATA_DIR}" einfo - while [ "$correct" != "true" ] ; do - einfo "Are you ready to continue? (y/n)" - read answer - if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then - correct="true" - elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then - die "Aborting initialization." - else - echo "Answer not recognized" - fi - done + if [ -z "$PG_AUTOCONFIG" ] ; then + while [ "$correct" != "true" ] ; do + einfo "Are you ready to continue? (y/n)" + read answer + if [[ $answer =~ ^[Yy]([Ee][Ss])?$ ]] ; then + correct="true" + elif [[ $answer =~ ^[Nn]([Oo])?$ ]] ; then + die "Aborting initialization." + else + echo "Answer not recognized" + fi + done + else + einfo "PG_AUTOCONFIG set, not prompting" + fi if [ -n "$(ls -A ${DATA_DIR} 2> /dev/null)" ] ; then eerror "The given directory, '${DATA_DIR}', is not empty."