[postgis-tickets] r17686 - Add upgrade install paths for address_standardizer

Regina Obe lr at pcorp.us
Sat Aug 10 06:44:24 PDT 2019


Author: robe
Date: 2019-08-10 18:44:24 -0700 (Sat, 10 Aug 2019)
New Revision: 17686

Added:
   branches/2.4/extensions/upgrade-paths-rules.mk
Modified:
   branches/2.4/NEWS
   branches/2.4/extensions/address_standardizer/Makefile.in
Log:
Add upgrade install paths for address_standardizer
references #4420 for PostGIS 2.4

Modified: branches/2.4/NEWS
===================================================================
--- branches/2.4/NEWS	2019-08-10 20:01:07 UTC (rev 17685)
+++ branches/2.4/NEWS	2019-08-11 01:44:24 UTC (rev 17686)
@@ -1,5 +1,5 @@
 PostGIS 2.4.8
-2019/XX/XX
+2019/08/1X
 
   * Bug Fixes and Enhancements *
 
@@ -16,6 +16,7 @@
   - #4437, Handle POINT EMPTY in shape loader/dumper (Paul Ramsey)
   - #4461, ST_AsTWKB doesn't always remove duplicate points (Nik Aven)
   - #4470, ST_GeomFromGeoJSON crash on empty rings (Darafei Praliaskouski)
+  - #4420, update path does not exists for address_standardizer extension (Regina Obe)
 
 
 PostGIS 2.4.7

Modified: branches/2.4/extensions/address_standardizer/Makefile.in
===================================================================
--- branches/2.4/extensions/address_standardizer/Makefile.in	2019-08-10 20:01:07 UTC (rev 17685)
+++ branches/2.4/extensions/address_standardizer/Makefile.in	2019-08-11 01:44:24 UTC (rev 17686)
@@ -1,3 +1,4 @@
+include ../upgradeable_versions.mk
 OBJS = \
     address_parser.o \
     address_standardizer.o \
@@ -32,11 +33,16 @@
 PERL=@PERL@
 EXTVERSION    = @POSTGIS_LIB_VERSION@
 MINORVERSION  = @POSTGIS_MAJOR_VERSION at .@POSTGIS_MINOR_VERSION@
-MODULE_big = address_standardizer- at POSTGIS_MAJOR_VERSION@. at POSTGIS_MINOR_VERSION@
+MODULE_big = address_standardizer
 EXTENSION = address_standardizer
-DATA = address_standardizer_data_us.control sql/$(EXTENSION).sql sql/$(EXTENSION)_data_us.sql
+DATA = sql/$(EXTENSION).sql sql/$(EXTENSION)_data_us.sql
 
-all:  sql/address_standardizer.sql sql/address_standardizer--1.0--$(EXTVERSION).sql sql/address_standardizer--$(EXTVERSION).sql sql/address_standardizer--$(EXTVERSION)--$(EXTVERSION)next.sql sql/address_standardizer--$(EXTVERSION)next--$(EXTVERSION).sql \
+DATA_built = \
+	$(EXTENSION).control \
+	$(EXTENSION)_data_us.control \
+	$(NULL)
+
+all:  sql/address_standardizer.sql sql/address_standardizer--1.0--$(EXTVERSION).sql sql/address_standardizer--$(EXTVERSION).sql sql/$(EXTENSION)--ANY--$(EXTVERSION).sql \
  sql/$(EXTENSION)_data_us.sql sql/address_standardizer-- at POSTGIS_LIB_VERSION@.sql sql/$(EXTENSION)_data_us-- at POSTGIS_LIB_VERSION@.sql  sql/$(EXTENSION)_data_us--$(EXTVERSION)--$(EXTVERSION)next.sql \
 sql/$(EXTENSION)_data_us--$(EXTVERSION)next--$(EXTVERSION).sql \
 sql/test-init-extensions.sql sql/test-parseaddress.sql sql/test-standardize_address_1.sql sql/test-standardize_address_2.sql
@@ -43,10 +49,8 @@
 
 EXTRA_CLEAN += sql/*.sql
 
-
-
 DOCS = README.address_standardizer
-PG_CPPFLAGS = @CPPFLAGS@ -g -O0
+PG_CPPFLAGS = @CFLAGS@ @CPPFLAGS@
 
 SHLIB_LINK = @SHLIB_LINK@ -lpcre
 EXTRA_CLEAN = usps-st-city-name.txt mk-st-regexp mk-city-regex test_main
@@ -66,8 +70,13 @@
 sql/%.sql: %.sql.in
 	mkdir -p sql
 	$(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
-	$(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/${EXTENSION}-${MINORVERSION}'g" > $@
+	$(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/${EXTENSION}'g" > $@
 
+%.control: %.control.in Makefile
+	cat $< \
+		| sed -e 's|@EXTVERSION@|$(EXTVERSION)|g' \
+		> $@
+
 sql/address_standardizer-- at POSTGIS_LIB_VERSION@.sql: sql/address_standardizer_types.sql \
     sql/address_standardizer_functions.sql
 	mkdir -p sql
@@ -82,16 +91,17 @@
 	mkdir -p sql
 	cat $^ > $@
 
-# upgrade logic for us data extension (to go to next cludge for dev upgrading)
-sql/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql: sql/address_standardizer_functions.sql
-	mkdir -p sql
-	cat $^ > $@
+# Scripts making up the extension minor upgrade file
+# NOTE: order matters
+EXTENSION_UPGRADE_SCRIPTS = \
+	sql/address_standardizer_functions.sql
 
-# upgrade logic for us data extension (to go to original round-robin yoyo cludge for dev upgrading)
-sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql: sql/address_standardizer_functions.sql
-	mkdir -p sql
-	cat $^ > $@
 
+sql/$(EXTENSION)--ANY--$(EXTVERSION).sql: $(EXTENSION_UPGRADE_SCRIPTS)
+	cat $(EXTENSION_UPGRADE_SCRIPTS) > $@
+
+include ../upgrade-paths-rules.mk
+
 # build us data extension
 sql/$(EXTENSION)_data_us--$(EXTVERSION).sql: us_lex.sql us_gaz.sql us_rules.sql sql_bits/address_standardizer_data_us_mark_editable_objects.sql.in
 	mkdir -p sql
@@ -176,6 +186,9 @@
 EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql
 EXTRA_CLEAN += sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql *.a *.so *.dll
 
+distclean: clean
+	rm Makefile
+
 PGXS := @PGXS@
 include $(PGXS)
 PERL = @PERL@

Added: branches/2.4/extensions/upgrade-paths-rules.mk
===================================================================
--- branches/2.4/extensions/upgrade-paths-rules.mk	                        (rev 0)
+++ branches/2.4/extensions/upgrade-paths-rules.mk	2019-08-11 01:44:24 UTC (rev 17686)
@@ -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)



More information about the postgis-tickets mailing list