From: Sandro Santilli Date: Wed, 6 Nov 2013 17:16:02 +0000 (+0000) Subject: Autogenerate the extension unpackaged script for topology (#2531) X-Git-Tag: 2.2.0rc1~1298 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=615208a9a591e41f187b9d65becf5cb8306c1c28;p=postgis Autogenerate the extension unpackaged script for topology (#2531) Required a change in create_unpackaged.pl to NOT add schemas git-svn-id: http://svn.osgeo.org/postgis/trunk@12105 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/extensions/postgis_topology/Makefile.in b/extensions/postgis_topology/Makefile.in index fe5c1dc5d..934d7f892 100644 --- a/extensions/postgis_topology/Makefile.in +++ b/extensions/postgis_topology/Makefile.in @@ -29,6 +29,7 @@ EXTRA_CLEAN += sql/*.sql ${SQL_BITS} ifeq ($(PG91),yes) + all: sql/$(EXTENSION)--$(EXTVERSION).sql sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql sql/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql sql_minor_upgrade sql/$(EXTENSION)--$(EXTVERSION).sql: sql/$(EXTENSION).sql @@ -57,25 +58,9 @@ sql_bits/topology.sql: ../../topology/topology.sql sql_bits/topology_comments.sql: ../../doc/topology_comments.sql cp $< $@ -#grep all lines that start with CREATE OR REPLACE FUNCTION, TRIGGER... -#then replace CREATE OR REPLACE .. with ALTER EXTENSION..; -#then remove default values and extra junk -# sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: ../../topology/topology.sql -# sed -e '/^CREATE \(OR REPLACE\|TYPE\|TABLE\|VIEW\|CAST\)/!d;' \ -# -e 's/OR REPLACE//g' \ -# -e 's/CREATE\(.*\)/ALTER EXTENSION $(EXTENSION) ADD\1;/' \ -# -e 's/DEFAULT [\.0-9a-zA-Z]\+//g' \ -# -e 's/\(BEFORE\|WITH FUNCTION\)\(.*\)/;/' \ -# -e 's/[ \t]+;/;/' \ -# -e 's/(;/;/' \ -# -e 's/\\(;/;/' \ -# -e 's/;;/;/g' $< > $@ - -#hardcode for now using -#the extensions/make_unpackaged.sql script form an install -sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql_bits/topology--unpackaged.sql.in +sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: ../../topology/topology.sql ../../utils/create_unpackaged.pl mkdir -p sql - cp $< $@ + cat $< | ../../utils/create_unpackaged.pl postgis_topology > $@ #upgrade script should have everything but table, schema, type creation/alter #NOTE: we assume all object definitions end in ; diff --git a/extensions/postgis_topology/sql_bits/topology--unpackaged.sql.in b/extensions/postgis_topology/sql_bits/topology--unpackaged.sql.in deleted file mode 100644 index 356f34457..000000000 --- a/extensions/postgis_topology/sql_bits/topology--unpackaged.sql.in +++ /dev/null @@ -1,94 +0,0 @@ -ALTER EXTENSION postgis_topology ADD cast(topogeometry as geometry); -ALTER EXTENSION postgis_topology ADD function _asgmledge(integer,integer,integer,geometry,regclass,text,integer,integer,text,integer); -ALTER EXTENSION postgis_topology ADD function _asgmlface(text,integer,regclass,text,integer,integer,text,integer); -ALTER EXTENSION postgis_topology ADD function _asgmlnode(integer,geometry,text,integer,integer,text,integer); -ALTER EXTENSION postgis_topology ADD function _st_addfacesplit(character varying,integer,integer,boolean); -ALTER EXTENSION postgis_topology ADD function _st_adjacentedges(character varying,integer,integer); -ALTER EXTENSION postgis_topology ADD function _st_mintolerance(character varying,geometry); -ALTER EXTENSION postgis_topology ADD function _st_mintolerance(geometry); -ALTER EXTENSION postgis_topology ADD function _st_remedgecheck(character varying,integer,integer,integer,integer); -ALTER EXTENSION postgis_topology ADD function addedge(character varying,geometry); -ALTER EXTENSION postgis_topology ADD function addface(character varying,geometry,boolean); -ALTER EXTENSION postgis_topology ADD function addnode(character varying,geometry); -ALTER EXTENSION postgis_topology ADD function addnode(character varying,geometry,boolean,boolean); -ALTER EXTENSION postgis_topology ADD function addtopogeometrycolumn(character varying,character varying,character varying,character varying,character varying); -ALTER EXTENSION postgis_topology ADD function addtopogeometrycolumn(character varying,character varying,character varying,character varying,character varying,integer); -ALTER EXTENSION postgis_topology ADD function addtosearchpath(character varying); -ALTER EXTENSION postgis_topology ADD function asgml(topogeometry); -ALTER EXTENSION postgis_topology ADD function asgml(topogeometry,regclass); -ALTER EXTENSION postgis_topology ADD function asgml(topogeometry,regclass,text); -ALTER EXTENSION postgis_topology ADD function asgml(topogeometry,text); -ALTER EXTENSION postgis_topology ADD function asgml(topogeometry,text,integer,integer); -ALTER EXTENSION postgis_topology ADD function asgml(topogeometry,text,integer,integer,regclass); -ALTER EXTENSION postgis_topology ADD function asgml(topogeometry,text,integer,integer,regclass,text); -ALTER EXTENSION postgis_topology ADD function asgml(topogeometry,text,integer,integer,regclass,text,integer); -ALTER EXTENSION postgis_topology ADD function astopojson(topogeometry,regclass); -ALTER EXTENSION postgis_topology ADD function cleartopogeom(topogeometry); -ALTER EXTENSION postgis_topology ADD function copytopology(character varying,character varying); -ALTER EXTENSION postgis_topology ADD function createtopogeom(character varying,integer,integer); -ALTER EXTENSION postgis_topology ADD function createtopogeom(character varying,integer,integer,topoelementarray); -ALTER EXTENSION postgis_topology ADD function createtopology(character varying); -ALTER EXTENSION postgis_topology ADD function createtopology(character varying,integer); -ALTER EXTENSION postgis_topology ADD function createtopology(character varying,integer,double precision); -ALTER EXTENSION postgis_topology ADD function createtopology(character varying,integer,double precision,boolean); -ALTER EXTENSION postgis_topology ADD function droptopogeometrycolumn(character varying,character varying,character varying); -ALTER EXTENSION postgis_topology ADD function droptopology(character varying); -ALTER EXTENSION postgis_topology ADD function equals(topogeometry,topogeometry); -ALTER EXTENSION postgis_topology ADD function geometry(topogeometry); -ALTER EXTENSION postgis_topology ADD function geometrytype(topogeometry); -ALTER EXTENSION postgis_topology ADD function getedgebypoint(character varying,geometry,double precision); -ALTER EXTENSION postgis_topology ADD function getfacebypoint(character varying,geometry,double precision); -ALTER EXTENSION postgis_topology ADD function getnodebypoint(character varying,geometry,double precision); -ALTER EXTENSION postgis_topology ADD function getnodeedges(character varying,integer); -ALTER EXTENSION postgis_topology ADD function getringedges(character varying,integer,integer); -ALTER EXTENSION postgis_topology ADD function gettopogeomelementarray(character varying,integer,integer); -ALTER EXTENSION postgis_topology ADD function gettopogeomelementarray(topogeometry); -ALTER EXTENSION postgis_topology ADD function gettopogeomelements(character varying,integer,integer); -ALTER EXTENSION postgis_topology ADD function gettopogeomelements(topogeometry); -ALTER EXTENSION postgis_topology ADD function gettopologyid(character varying); -ALTER EXTENSION postgis_topology ADD function gettopologyname(integer); -ALTER EXTENSION postgis_topology ADD function gettopologysrid(character varying); -ALTER EXTENSION postgis_topology ADD function intersects(topogeometry,topogeometry); -ALTER EXTENSION postgis_topology ADD function layertrigger(); -ALTER EXTENSION postgis_topology ADD function polygonize(character varying); -ALTER EXTENSION postgis_topology ADD function postgis_topology_scripts_installed(); -ALTER EXTENSION postgis_topology ADD function relationtrigger(); -ALTER EXTENSION postgis_topology ADD function st_addedgemodface(character varying,integer,integer,geometry); -ALTER EXTENSION postgis_topology ADD function st_addedgenewfaces(character varying,integer,integer,geometry); -ALTER EXTENSION postgis_topology ADD function st_addisoedge(character varying,integer,integer,geometry); -ALTER EXTENSION postgis_topology ADD function st_addisonode(character varying,integer,geometry); -ALTER EXTENSION postgis_topology ADD function st_changeedgegeom(character varying,integer,geometry); -ALTER EXTENSION postgis_topology ADD function st_createtopogeo(character varying,geometry); -ALTER EXTENSION postgis_topology ADD function st_geometrytype(topogeometry); -ALTER EXTENSION postgis_topology ADD function st_getfaceedges(character varying,integer); -ALTER EXTENSION postgis_topology ADD function st_getfacegeometry(character varying,integer); -ALTER EXTENSION postgis_topology ADD function st_inittopogeo(character varying); -ALTER EXTENSION postgis_topology ADD function st_modedgeheal(character varying,integer,integer); -ALTER EXTENSION postgis_topology ADD function st_modedgesplit(character varying,integer,geometry); -ALTER EXTENSION postgis_topology ADD function st_moveisonode(character varying,integer,geometry); -ALTER EXTENSION postgis_topology ADD function st_newedgeheal(character varying,integer,integer); -ALTER EXTENSION postgis_topology ADD function st_newedgessplit(character varying,integer,geometry); -ALTER EXTENSION postgis_topology ADD function st_remedgemodface(character varying,integer); -ALTER EXTENSION postgis_topology ADD function st_remedgenewface(character varying,integer); -ALTER EXTENSION postgis_topology ADD function st_remisonode(character varying,integer); -ALTER EXTENSION postgis_topology ADD function st_removeisoedge(character varying,integer); -ALTER EXTENSION postgis_topology ADD function st_removeisonode(character varying,integer); -ALTER EXTENSION postgis_topology ADD function st_simplify(topogeometry,double precision); -ALTER EXTENSION postgis_topology ADD function topoelementarray_agg(topoelement); -ALTER EXTENSION postgis_topology ADD function topoelementarray_append(topoelementarray,topoelement); -ALTER EXTENSION postgis_topology ADD function topogeo_addgeometry(character varying,geometry,double precision); -ALTER EXTENSION postgis_topology ADD function topogeo_addlinestring(character varying,geometry,double precision); -ALTER EXTENSION postgis_topology ADD function topogeo_addpoint(character varying,geometry,double precision); -ALTER EXTENSION postgis_topology ADD function topogeo_addpolygon(character varying,geometry,double precision); -ALTER EXTENSION postgis_topology ADD function topologysummary(character varying); -ALTER EXTENSION postgis_topology ADD function totopogeom(geometry,character varying,integer,double precision); -ALTER EXTENSION postgis_topology ADD function totopogeom(geometry,topogeometry,double precision); -ALTER EXTENSION postgis_topology ADD function validatetopology(character varying); -ALTER EXTENSION postgis_topology ADD sequence topology_id_seq; -ALTER EXTENSION postgis_topology ADD table layer; -ALTER EXTENSION postgis_topology ADD table topology; -ALTER EXTENSION postgis_topology ADD type getfaceedges_returntype; -ALTER EXTENSION postgis_topology ADD type topoelement; -ALTER EXTENSION postgis_topology ADD type topoelementarray; -ALTER EXTENSION postgis_topology ADD type topogeometry; -ALTER EXTENSION postgis_topology ADD type validatetopology_returntype; diff --git a/utils/create_unpackaged.pl b/utils/create_unpackaged.pl index 19f7fefbe..ac9ed6629 100755 --- a/utils/create_unpackaged.pl +++ b/utils/create_unpackaged.pl @@ -267,14 +267,17 @@ foreach my $type (@types) } -print "-- Register all schemas.\n"; -if (@schemas) -{ - foreach my $schema (@schemas) - { - print "$addprefix SCHEMA \"$schema\";\n"; - } -} +# NOTE: cannot add schema "topology" to extension "postgis_topology" +# because the schema contains the extension +# +#print "-- Register all schemas.\n"; +#if (@schemas) +#{ +# foreach my $schema (@schemas) +# { +# print "$addprefix SCHEMA \"$schema\";\n"; +# } +#} print "\n";