]> granicus.if.org Git - postgis/commitdiff
more changes to properly utilize extenions model, 1 remove create schema since extesn...
authorRegina Obe <lr@pcorp.us>
Wed, 21 Sep 2011 03:23:45 +0000 (03:23 +0000)
committerRegina Obe <lr@pcorp.us>
Wed, 21 Sep 2011 03:23:45 +0000 (03:23 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7875 b70326c6-7e19-0410-871a-916f4a2858ee

extensions/postgis_topology/Makefile
extensions/postgis_topology/postgis_topology.control

index 05f85aaee8596bc34e0ad3aa6dc04164daf4b336..81c92a8ff6da7f655ebd608400db1cd8e49d1836 100644 (file)
@@ -20,22 +20,23 @@ sql/$(EXTENSION).sql: sql_bits/topology.sql sql_bits/topology_comments.sql
        cat $^ > $@
        
 #strip BEGIN/COMMIT since these are not allowed in extensions
+#strip CREATE SCHEMA since we force extension 
+# to create schema by setting schema to topology in control
 sql_bits/topology.sql: ../../topology/topology.sql
-       sed -e 's/BEGIN;//g' -e 's/COMMIT;//g'  $< > $@
+       sed -e 's/BEGIN;//g' -e 's/COMMIT;//g' -e '/^CREATE SCHEMA/d;'  $< > $@
        
 sql_bits/topology_comments.sql: ../../doc/topology_comments.sql
        cp $< $@
        
-#grep all lines that start with CREATE OR REPLACE FUNCTION
+#grep all lines that start with CREATE OR REPLACE FUNCTION, TRIGGER...
 #then replace CREATE OR REPLACE .. with ALTER EXTENSION..;
-#then remove default values
+#then remove default values and extra junk
 sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: ../../topology/topology.sql
-       sed -e '/^CREATE \(OR REPLACE\|TRIGGER\|TYPE\|SCHEMA\|TABLE\)/!d;' \
+       sed -e '/^CREATE \(OR REPLACE\|TRIGGER\|TYPE\|TABLE\|VIEW\)/!d;' \
                -e 's/OR REPLACE//g' \
                -e 's/CREATE\(.*\)/ALTER EXTENSION $(EXTENSION) ADD\1;/' \
                -e 's/DEFAULT [a-zA-Z]\+//g' \
-               -e 's/BEFORE\(.*\)/;/' \
-               -e 's/AS\(.*\)/;/' \
+               -e 's/\(BEFORE\|AS\)\(.*\)/;/' \
                -e 's/(;/;/' \
                -e 's/\\(;/;/' \
                -e 's/;;/;/g' $< > $@
index 7cd7bf3fb1f0d17a2db7e18349b7b74d5cb53a2f..7db3ebd1a244a4781d9d62835a4fd26cb3b123aa 100644 (file)
@@ -2,3 +2,5 @@
 comment = 'postgis topology spatial types and functions'
 default_version = '2.0.0'
 relocatable = false
+schema = topology
+requires = postgis_core