summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2015-02-24 13:37:52 +0100
committerPavel Raiskup <praiskup@redhat.com>2015-02-25 13:26:07 +0100
commit243dcab83ed93c3afd9867b3e5d014efdd0f840f (patch)
tree64186eb94b62cc4f9e071e7dbd439d7c923ab1da /configure.ac
parentcc56924c20a4081880f86165c03e03323522cacd (diff)
downloadpostgresql-setup-243dcab83ed93c3afd9867b3e5d014efdd0f840f.tar.gz
postgresql-setup-243dcab83ed93c3afd9867b3e5d014efdd0f840f.tar.xz
postgresql-setup-243dcab83ed93c3afd9867b3e5d014efdd0f840f.zip
postgresql-setup: multi-upgrade configuration
Turns out we need to support upgrade from more than one previous database versions. The plan is to make this as general as easily possible, "run-time" configurable without need to recompile. * postgresql-setup.in: Add options --upgrade-from and --upgrade-ids. Require root access (as late as possible). ($USAGE_STRING): Adjust help output accordingly. ($PGMAJORVERSION, $PREVMAJORVERSION) ($PREVPGENGINE): Remove newly useless globals. ($option_upgradefrom): New option default. (set_var, root_prereq): New helper functions. (parse_upgrade_setup): Helper function to parse upgrade configuration. (print_version): Don't print PREVMAJORVERSION as it is (with configuration) useless. (upgrade): Create new $inplace local to handle in-place and copy-like migrations differently. Use the variable set generated by parse_upgrade_setup() function. Small err message fixes. (handle_service_env, handle_pgconf): Remove the MODE argument. (parse_configuration): Generalize operations which needed to be done on two places. * upgrade_config.template: Example of ./configure time config file. Based on files like this the run-time is generated. * share/postgresql-setup/.gitignore: New file. * share/postgresql-setup/Makefile.inc: New file. * build-helpers/build-config: New file, generator of configuration files. * build-helpers/Makefile.inc: New file. * Makefile.am: Distribute upgrade_config.template. Start the conversion to flat Makefile and include two new Makefile.inc snippets. * configure.ac: New --with-upgrade-config option. Propagate the rawpkgdatadir and UPGRADE_CONFIG_LIST variables into Makefile. (INSTANTIATE): Enhance to create the leading path also. (INSTANTIATE_CONV): Convenience helper for leading path of target creation. * auxdir/install_local: New (just-for-git) installation helper. * .gitignore: Don't hide share/postgresql-setup. * TODO: Mention that KDE folks would like to migrate somehow.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index a793a07..d6476f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,15 @@ AC_ARG_WITH([sysvinit],
[WANT_SYSVINIT=0]
)
+AC_ARG_WITH([upgrade-config],
+ AS_HELP_STRING([--with-upgrade-config=/file/path,/path2],
+ [List of files to be used as an upgrade configuration]),
+ [UPGRADE_CONFIG_LIST="$withval"],
+ [UPGRADE_CONFIG_LIST="upgrade_config.template"]
+)
+
+AC_SUBST([UPGRADE_CONFIG_LIST])
+
AM_CONDITIONAL([WANT_SYSVINIT], [test "$WANT_SYSVINIT" -eq 1])
# Instatiating generated files by sed instead of config.status.
@@ -54,23 +63,28 @@ sed_subst_var_pattern(pkgname)
sed_subst_var_pattern(POSTGRES_HOMEDIR)
sed_subst_var_pattern(PREVMAJORVERSION)
sed_subst_var_pattern(PREVPGENGINE)
+sed_subst_var_pattern(rawpkgdatadir)
sed_subst_var_pattern(README_DIST)
sed_subst_var_pattern(SU_POSTGRES)
sed_subst_var_pattern(systemdunitsdir)
sed_subst_var_pattern(userunitsdir)
sed_subst_var_pattern(TEST_GEN_FILES_LIST)
sed_subst_var_pattern(VERSION)
+sed_subst_var_pattern(UPGRADE_CONFIG_LIST)
-e 's|@__FILE__[[@]]|\$@|g'"
SED_CALL="\$(SED) \$(SED_RULES)"
m4_pattern_allow(AM_V_GEN)
-INSTANTIATE="\$(AM_V_GEN)\$(SED_CALL) \$< > \$@"
+
+INSTANTIATE_CONV="\$(AM_V_GEN)rm -rf \$@; \$(MKDIR_P) \$(@D)"
+INSTANTIATE="\$(INSTANTIATE_CONV) && \$(SED_CALL) \$< > \$@ && chmod -w \$@"
INSTANTIATE_SCRIPT="\$(INSTANTIATE) && chmod +x \$@"
c_s='$(top_builddir)/config.status'
AC_SUBST([SED_RULES])
AC_SUBST([SED_CALL])
AC_SUBST([INSTANTIATE])
+AC_SUBST([INSTANTIATE_CONV])
AC_SUBST([INSTANTIATE_SCRIPT])
AC_SUBST([c_s])