summaryrefslogtreecommitdiff
path: root/dev-db/postgresql/postgresql-9999.ebuild
diff options
context:
space:
mode:
authorAustin English <wizardedit@gentoo.org>2017-04-03 15:51:52 -0500
committerAustin English <wizardedit@gentoo.org>2017-04-03 15:56:56 -0500
commit315323499fa5e267317d413318481e7cfec8d7c9 (patch)
tree2984dc5baaffb643bbee14c38db1afc161eb9cd7 /dev-db/postgresql/postgresql-9999.ebuild
parent7bb54c579bb0a67bd3b5ea74fb676a74bed29f32 (diff)
downloadgentoo-315323499fa5e267317d413318481e7cfec8d7c9.tar.gz
gentoo-315323499fa5e267317d413318481e7cfec8d7c9.tar.bz2
gentoo-315323499fa5e267317d413318481e7cfec8d7c9.zip
dev-db/postgresql: respect PG_AUTOCONFIG env variable
This allows configuring postgresql without further input from the input (i.e., makes it scriptable). Gentoo-Bug: https://bugs.gentoo.org/610418
Diffstat (limited to 'dev-db/postgresql/postgresql-9999.ebuild')
-rw-r--r--dev-db/postgresql/postgresql-9999.ebuild26
1 files changed, 15 insertions, 11 deletions
diff --git a/dev-db/postgresql/postgresql-9999.ebuild b/dev-db/postgresql/postgresql-9999.ebuild
index b1d337683362..6a995c154baa 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."