[postgis-tickets] r15910 - Uninstall upgrade paths on `make uninstall`

Sandro Santilli strk at kbt.io
Thu Oct 5 12:56:22 PDT 2017


Author: strk
Date: 2017-10-05 12:56:22 -0700 (Thu, 05 Oct 2017)
New Revision: 15910

Modified:
   trunk/extensions/postgis/Makefile.in
Log:
Uninstall upgrade paths on `make uninstall`

Modified: trunk/extensions/postgis/Makefile.in
===================================================================
--- trunk/extensions/postgis/Makefile.in	2017-10-05 19:36:45 UTC (rev 15909)
+++ trunk/extensions/postgis/Makefile.in	2017-10-05 19:56:22 UTC (rev 15910)
@@ -93,20 +93,31 @@
 	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: sql_bits/postgis_extension_upgrade_minor.sql
-	todir='$(DESTDIR)$(datadir)/$(datamoduledir)'; \
 	tpl='$(EXTENSION)--ANY-$(EXTVERSION).sql'; \
-	ln -fs "$${tpl}" $${todir}/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql; \
-	ln -fs "$${tpl}" $${todir}/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql; \
-	$(INSTALL_DATA) $^ "$${todir}/$${tpl}"; \
+	ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql; \
+	ln -fs "$${tpl}" $(EXTDIR)/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql; \
+	$(INSTALL_DATA) $^ "$(EXTDIR)/$${tpl}"; \
 	for OLD_VERSION in $(UPGRADEABLE_VERSIONS); do \
-		ln -fs "$${tpl}" $${todir}/$(EXTENSION)--$$OLD_VERSION--$(EXTVERSION).sql; \
+		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)
+
 distclean: clean
 	rm -f Makefile
 



More information about the postgis-tickets mailing list