1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
#!/bin/sh
#
# Creates the required tablespace for tests.
#
# Only do this when we are running under pg_virtualenv.
# Then the tablespace can be owned by the current user.
if [ "x$PG_CLUSTER_CONF_ROOT" != "x" ]; then
BASEDIR=`pwd`
TBLDIR=${BASEDIR}/osm2pgsql-test-tablespace
if [ -d "$TBLDIR" ]; then
echo "Tablespace directory already exists. Cleaning up."
if find $TBLDIR -maxdepth 1 -mindepth 1 -type d -name 'PG*'; then
rm -r $TBLDIR/PG*
fi
else
mkdir $TBLDIR
chmod 777 $TBLDIR
fi
psql -c "CREATE TABLESPACE tablespacetest LOCATION '$TBLDIR'" postgres
fi
|