[postgis-tickets] r17295 - Rename opt_out.sh to extensions_unpackage.sh, drop make_unpackaged.sql
Sandro Santilli
strk at kbt.io
Wed Mar 6 07:14:40 PST 2019
Author: strk
Date: 2019-03-06 07:14:40 -0800 (Wed, 06 Mar 2019)
New Revision: 17295
Added:
trunk/extensions/extensions_unpackage.sh
Removed:
trunk/extensions/make_unpackaged.sql
trunk/extensions/opt_out.sh
Modified:
trunk/extensions/postgis_tiger_geocoder/Makefile.in
Log:
Rename opt_out.sh to extensions_unpackage.sh, drop make_unpackaged.sql
Copied: trunk/extensions/extensions_unpackage.sh (from rev 17294, trunk/extensions/opt_out.sh)
===================================================================
--- trunk/extensions/extensions_unpackage.sh (rev 0)
+++ trunk/extensions/extensions_unpackage.sh 2019-03-06 15:14:40 UTC (rev 17295)
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+test -n "$1" || {
+ echo "Usage: $0 { <dbname> | - }"
+ exit 1
+}
+
+db="$1"
+
+EXTENSIONS="postgis_sfcgal postgis_raster postgis_topology postgis"
+
+(
+ for ext in $EXTENSIONS; do
+ cat <<EOF
+
+SELECT 'ALTER EXTENSION ' || extname || ' DROP ' ||
+ regexp_replace(
+ regexp_replace(
+ pg_catalog.pg_describe_object(d.classid, d.objid, 0),
+ E'cast from (.*) to (.*)',
+ E'cast\(\\1 as \\2\)'),
+ E'(.*) for access method (.*)',
+ E'\\1 using \\2'
+ ) || ';' AS sqladd
+FROM pg_catalog.pg_depend AS d
+INNER JOIN pg_extension AS e ON (d.refobjid = e.oid)
+WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
+AND deptype = 'e' AND e.extname = '${ext}' ORDER BY sqladd;
+
+SELECT 'DROP EXTENSION ${ext};';
+
+EOF
+ done
+) |
+if test ${db} = '-'; then
+ cat
+else
+ psql -XtA ${db}
+fi
Deleted: trunk/extensions/make_unpackaged.sql
===================================================================
--- trunk/extensions/make_unpackaged.sql 2019-03-06 15:03:02 UTC (rev 17294)
+++ trunk/extensions/make_unpackaged.sql 2019-03-06 15:14:40 UTC (rev 17295)
@@ -1,40 +0,0 @@
--- for postgis
-SELECT 'ALTER EXTENSION ' || extname || ' ADD ' || regexp_replace(
- regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0), E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
- E'(.*) for access method (.*)', E'\\1 using \\2') || ';' AS sqladd
-FROM pg_catalog.pg_depend AS d
-INNER JOIN pg_extension AS e ON (d.refobjid = e.oid)
-WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
-AND deptype = 'e' AND e.extname = 'postgis'
-ORDER BY sqladd;
-
--- for postgis_raster
-SELECT 'ALTER EXTENSION ' || extname || ' ADD ' || regexp_replace(
- regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0), E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
- E'(.*) for access method (.*)', E'\\1 using \\2') || ';' AS sqladd
-FROM pg_catalog.pg_depend AS d
-INNER JOIN pg_extension AS e ON (d.refobjid = e.oid)
-WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
-AND deptype = 'e' AND e.extname = 'postgis_raster'
-ORDER BY sqladd;
-
--- for topology
-SELECT 'ALTER EXTENSION ' || extname || ' ADD ' || regexp_replace(
- regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0), E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
- E'(.*) for access method (.*)', E'\\1 using \\2') || ';' AS sqladd
-FROM pg_catalog.pg_depend AS d
-INNER JOIN pg_extension AS e ON (d.refobjid = e.oid)
-WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
-AND deptype = 'e' AND e.extname = 'postgis_topology'
-ORDER BY sqladd;
-
--- for postgis tiger geocoder
-SELECT 'ALTER EXTENSION ' || extname || ' ADD ' || regexp_replace(
- regexp_replace(pg_catalog.pg_describe_object(d.classid, d.objid, 0), E'cast from (.*) to (.*)', E'cast\(\\1 as \\2\)'),
- E'(.*) for access method (.*)', E'\\1 using \\2') || ';' AS sqladd
-FROM pg_catalog.pg_depend AS d
-INNER JOIN pg_extension AS e ON (d.refobjid = e.oid)
-WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
-AND deptype = 'e' AND e.extname = 'postgis_tiger_geocoder'
-ORDER BY sqladd;
-
Deleted: trunk/extensions/opt_out.sh
===================================================================
--- trunk/extensions/opt_out.sh 2019-03-06 15:03:02 UTC (rev 17294)
+++ trunk/extensions/opt_out.sh 2019-03-06 15:14:40 UTC (rev 17295)
@@ -1,39 +0,0 @@
-#!/bin/sh
-
-test -n "$1" || {
- echo "Usage: $0 { <dbname> | - }"
- exit 1
-}
-
-db="$1"
-
-EXTENSIONS="postgis_sfcgal postgis_raster postgis_topology postgis"
-
-(
- for ext in $EXTENSIONS; do
- cat <<EOF
-
-SELECT 'ALTER EXTENSION ' || extname || ' DROP ' ||
- regexp_replace(
- regexp_replace(
- pg_catalog.pg_describe_object(d.classid, d.objid, 0),
- E'cast from (.*) to (.*)',
- E'cast\(\\1 as \\2\)'),
- E'(.*) for access method (.*)',
- E'\\1 using \\2'
- ) || ';' AS sqladd
-FROM pg_catalog.pg_depend AS d
-INNER JOIN pg_extension AS e ON (d.refobjid = e.oid)
-WHERE d.refclassid = 'pg_catalog.pg_extension'::pg_catalog.regclass
-AND deptype = 'e' AND e.extname = '${ext}' ORDER BY sqladd;
-
-SELECT 'DROP EXTENSION ${ext};';
-
-EOF
- done
-) |
-if test ${db} = '-'; then
- cat
-else
- psql -XtA ${db}
-fi
Modified: trunk/extensions/postgis_tiger_geocoder/Makefile.in
===================================================================
--- trunk/extensions/postgis_tiger_geocoder/Makefile.in 2019-03-06 15:03:02 UTC (rev 17294)
+++ trunk/extensions/postgis_tiger_geocoder/Makefile.in 2019-03-06 15:14:40 UTC (rev 17295)
@@ -197,8 +197,8 @@
# -e 's/\\(;/;/' \
# -e 's/;;/;/g' $< > $@
-#hardcode for now using
-#the extensions/make_unpackaged.sql script form an install
+#hardcode for now
+#TODO: generate via create_unpackaged.pl
sql/$(EXTENSION)--unpackaged--$(EXTVERSION).sql: sql_bits/tiger_geocoder--unpackaged.sql.in | sql
cp $< $@
More information about the postgis-tickets
mailing list