]> granicus.if.org Git - postgis/commitdiff
Generalize upgrade paths extension installs
authorSandro Santilli <strk@kbt.io>
Wed, 10 Jan 2018 11:35:22 +0000 (11:35 +0000)
committerSandro Santilli <strk@kbt.io>
Wed, 10 Jan 2018 11:35:22 +0000 (11:35 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@16247 b70326c6-7e19-0410-871a-916f4a2858ee

extensions/postgis/Makefile.in
extensions/postgis_topology/Makefile.in
extensions/upgrade-paths-rules.mk [new file with mode: 0644]

index 6fb1456a2054e6a6f1bec9b4e9a8d3074006c03f..1b17880103fb1b08921dff09f5d3c71e46507173 100644 (file)
@@ -135,30 +135,7 @@ sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS) | sql
        printf '\\echo Use "CREATE EXTENSION $(EXTENSION)" to load this file. \\quit\n' > $@
        cat $^ >> $@
 
-EXTDIR=$(DESTDIR)$(datadir)/$(datamoduledir)
-
-install: install-upgrade-paths
-
-# The "next" lines are a cludge to allow upgrading between different
-# revisions of the same version
-install-upgrade-paths:
-       tpl='$(EXTENSION)--ANY--$(EXTVERSION).sql'; \
-       $(INSTALL_DATA) sql/$${tpl} "$(EXTDIR)/$${tpl}"; \
-       ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql; \
-       ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql; \
-       for OLD_VERSION in $(UPGRADEABLE_VERSIONS); do \
-               ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$$OLD_VERSION--$(EXTVERSION).sql; \
-       done
-
-uninstall: uninstall-upgrade-paths
-
-INSTALLED_UPGRADE_SCRIPTS = \
-       $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
-       $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
-       $(NULL)
-
-uninstall-upgrade-paths:
-       rm -f $(INSTALLED_UPGRADE_SCRIPTS)
+include ../upgrade-paths-rules.mk
 
 distclean: clean
        rm -f Makefile
index 3e1e1dc89de8788deb10dad1d7b02cc8f9d96b1c..2c666da26d5cebb9b83b59dd103a00867eb8c238 100644 (file)
@@ -81,33 +81,7 @@ sql/topology_upgrade.sql:  ../../topology/topology_upgrade.sql
 sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS)
        cat $(EXTENSION_UPGRADE_SCRIPTS) > $@
 
-EXTDIR=$(DESTDIR)$(datadir)/$(datamoduledir)
-
-install: install-upgrade-paths
-
-# The "next" lines are a cludge to allow upgrading between different
-# revisions of the same version
-install-upgrade-paths:
-       tpl='$(EXTENSION)--ANY--$(EXTVERSION).sql'; \
-       $(INSTALL_DATA) sql/$${tpl} "$(EXTDIR)/$${tpl}"; \
-       ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql; \
-       ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql; \
-       for OLD_VERSION in $(UPGRADEABLE_VERSIONS); do \
-               ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$$OLD_VERSION--$(EXTVERSION).sql; \
-       done
-
-uninstall: uninstall-upgrade-paths
-
-INSTALLED_UPGRADE_SCRIPTS = \
-       $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
-       $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
-       $(NULL)
-
-uninstall-upgrade-paths:
-       rm -f $(INSTALLED_UPGRADE_SCRIPTS)
-
-DATA = $(wildcard sql/*--*.sql)
-EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql
+include ../upgrade-paths-rules.mk
 
 distclean: clean
        rm Makefile
diff --git a/extensions/upgrade-paths-rules.mk b/extensions/upgrade-paths-rules.mk
new file mode 100644 (file)
index 0000000..27dff04
--- /dev/null
@@ -0,0 +1,24 @@
+EXTDIR=$(DESTDIR)$(datadir)/$(datamoduledir)
+
+install: install-upgrade-paths
+
+# The "next" lines are a cludge to allow upgrading between different
+# revisions of the same version
+install-upgrade-paths:
+       tpl='$(EXTENSION)--ANY--$(EXTVERSION).sql'; \
+       $(INSTALL_DATA) sql/$${tpl} "$(EXTDIR)/$${tpl}"; \
+       ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql; \
+       ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql; \
+       for OLD_VERSION in $(UPGRADEABLE_VERSIONS); do \
+               ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$$OLD_VERSION--$(EXTVERSION).sql; \
+       done
+
+uninstall: uninstall-upgrade-paths
+
+INSTALLED_UPGRADE_SCRIPTS = \
+       $(wildcard $(EXTDIR)/*$(EXTVERSION).sql) \
+       $(wildcard $(EXTDIR)/*$(EXTVERSION)next.sql) \
+       $(NULL)
+
+uninstall-upgrade-paths:
+       rm -f $(INSTALLED_UPGRADE_SCRIPTS)