]> granicus.if.org Git - postgis/commitdiff
Fixed for better path handling
authorBborie Park <bkpark at ucdavis.edu>
Fri, 23 Dec 2011 16:22:34 +0000 (16:22 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Fri, 23 Dec 2011 16:22:34 +0000 (16:22 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@8529 b70326c6-7e19-0410-871a-916f4a2858ee

utils/uninstall_script

index 8b44f814dd572f36cbd1c92ad3966fa1b0f7fd70..8a2d5332f4a0fe57867cb6bc76f6ff6b82df1fb8 100755 (executable)
@@ -1,12 +1,5 @@
 #!/bin/bash
-
 # this script assumes that it is located in utils
-SOURCE="${BASH_SOURCE[0]}"
-while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
-DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
-
-# use utils as our working directory
-cd $DIR
 
 DB=postgis_uninstall
 
@@ -32,9 +25,16 @@ cleanup () {
 
 # get reference uninstall of postgis.sql only
 if [ "$1" == "raster" ]; then
-       ${DIR}$0
+       $0
 fi
 
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
+DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+# use utils as our working directory
+cd $DIR
+
 # create database
 createdb $DB
 
@@ -75,7 +75,7 @@ if [ "raster" == "$1" ]; then
        OIFS=$IFS
        IFS=$'\n'
 
-       echo -n '' > $OUTFILE
+       echo -n '' > ${RTPATH}$OUTFILE
 
        # see if line found in uninstall_postgis.sql
        for x in `cat $OUTFILE.$RAND`; do