summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2015-03-02 15:08:37 +0100
committerPavel Raiskup <praiskup@redhat.com>2015-03-02 15:08:37 +0100
commitf6c4b5674f9ea68634fa13197405a89fde64985f (patch)
treeb4996e7766e3092deff7dc12d005c95e9621999d
parent1b17292099daea774c2b335a85f8afebf7c99569 (diff)
downloadpostgresql-setup-f6c4b5674f9ea68634fa13197405a89fde64985f.tar.gz
postgresql-setup-f6c4b5674f9ea68634fa13197405a89fde64985f.tar.xz
postgresql-setup-f6c4b5674f9ea68634fa13197405a89fde64985f.zip
postgresql-setup: better work with @SCLS@
* configure.ac (SCL_SOURCE): New variable sourcing needed scls. * postgresql-setup.in (initdb): Use @SCL_SOURCE@ instead of runtime generated $scls_initdb_hacks. (upgrade): Use @SCL_SOURCE@. For this we don't need to specify default "current" SCL when upgrading from other SCL in upgrade-configuration 'scls' option.
-rw-r--r--configure.ac2
-rw-r--r--postgresql-setup.in11
2 files changed, 4 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 8527a5f..aa82982 100644
--- a/configure.ac
+++ b/configure.ac
@@ -174,8 +174,10 @@ SCL_SHELL_WRAPPER=
if test -n "$SCLS"
then
SCL_SHELL_WRAPPER="$SCL_BINDIR/$SCL_BINARY enable $SCLS -- "
+ SCL_SOURCE="source scl_source enable $SCLS ;"
fi
add_sed_subst_var(SCL_SHELL_WRAPPER)
+add_sed_subst_var(SCL_SOURCE)
NAME_BINARYBASE="$NAME_BIN_PFX""postgresql$NAME_BIN_SFX"
NAME_PACKAGE="$NAME_PKG_PFX""postgresql$NAME_PKG_SFX"
diff --git a/postgresql-setup.in b/postgresql-setup.in
index 8267c06..af248a4 100644
--- a/postgresql-setup.in
+++ b/postgresql-setup.in
@@ -26,9 +26,6 @@ PGPORT_DEF=5432
# We upgrade by default from system's default PostgreSQL installation
option_upgradefrom="@NAME_DEFAULT_PREV_SERVICE@"
-# Space separated list of SCLS to be enabled during upgrade
-initdb_scls="@SCLS@"
-
USAGE_STRING=$"\
Usage: $0 MODE_OPTION [--unit=UNIT_NAME] [OPTION...]
@@ -112,12 +109,8 @@ perform_initdb()
[ -x /sbin/restorecon ] && /sbin/restorecon "$initdb_log"
fi
- local scls_initdb_hacks=
- test -n "$initdb_scls" \
- && scls_initdb_hacks="source scl_source enable $initdb_scls ; "
-
# Initialize the database
- initdbcmd="$scls_initdb_hacks"
+ initdbcmd="@SCL_SOURCE@"
initdbcmd+=" $PGENGINE/initdb --pgdata='$pgdata' --auth='ident'"
initdbcmd+=" $PGSETUP_INITDB_OPTIONS"
@@ -242,7 +235,7 @@ upgrade()
if perform_initdb; then
# Do the upgrade
$SU_POSTGRES -c "\
- $scls_upgrade_hacks \
+ @SCL_SOURCE@ $scls_upgrade_hacks \
$socket_hacks \
$PGENGINE/pg_upgrade \
'--old-bindir=$upgradefrom_engine' \