[GRASS-SVN] r56230 - grass/branches/develbranch_6/scripts/r.in.wms
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon May 13 01:47:54 PDT 2013
Author: hamish
Date: 2013-05-13 01:47:53 -0700 (Mon, 13 May 2013)
New Revision: 56230
Modified:
grass/branches/develbranch_6/scripts/r.in.wms/r.in.gdalwarp
Log:
space-proof basename, quote some variables
Modified: grass/branches/develbranch_6/scripts/r.in.wms/r.in.gdalwarp
===================================================================
--- grass/branches/develbranch_6/scripts/r.in.wms/r.in.gdalwarp 2013-05-12 20:53:29 UTC (rev 56229)
+++ grass/branches/develbranch_6/scripts/r.in.wms/r.in.gdalwarp 2013-05-13 08:47:53 UTC (rev 56230)
@@ -82,6 +82,8 @@
g.message -d "[r.in.gdalwarp]"
+PROG=`basename "$0"`
+
#### setup temporary file
TEMPFILE="`g.tempfile pid=$$`"
if [ $? -ne 0 ] || [ -z "$TEMPFILE" ] ; then
@@ -128,7 +130,7 @@
"$FILE" "$WARPFILE" $GIS_OPT_WARPOPTIONS $METHOD
if [ $? -ne 0 ] ; then
- g.message -e message="`basename $0`: gdalwarp failure."
+ g.message -e message="$PROG: gdalwarp failure."
rm -f "${TEMPFILE}"*
exit 1
fi
@@ -136,7 +138,7 @@
#Import it into a temporary map:
r.in.gdal $FLAGS input="$WARPFILE" output="$TMPMAPNAME" --quiet
if [ $? -ne 0 ] ; then
- g.message -e message="`basename $0`: r.in.gdal failure."
+ g.message -e message="$PROG: r.in.gdal failure."
rm -f "${TEMPFILE}"*
exit 1
fi
@@ -161,17 +163,17 @@
SUFFIXES=`echo "$SUFFIXES
$CHANNEL_SUFFIXES" | sort -u`
- IFS=$defaultIFS
+ IFS="$defaultIFS"
for SUFFIX in $CHANNEL_SUFFIXES ; do
eval "$SUFFIX"
- LAST_SUFFIX=$sfx
+ LAST_SUFFIX="$sfx"
done
# Find the alpha layer
if [ $GIS_FLAG_K -eq 1 ] ; then
- ALPHALAYER=${TMPMAPNAME}${LAST_SUFFIX}
+ ALPHALAYER="${TMPMAPNAME}${LAST_SUFFIX}"
else
- ALPHALAYER=${TMPMAPNAME}.alpha
+ ALPHALAYER="${TMPMAPNAME}.alpha"
fi
# test to see if the alpha map exists
g.findfile element=cell file="$ALPHALAYER" > /dev/null
@@ -204,7 +206,7 @@
fi
# Copy the color tables:
- r.colors map=${MAP}${sfx} rast=${TMPMAPNAME}${sfx} --quiet
+ r.colors map="${MAP}${sfx}" rast="${TMPMAPNAME}${sfx}" --quiet
# Make patch lists:
sfx2=`echo $sfx | sed "s/\./_/"`
@@ -236,7 +238,7 @@
r.in.gdal -o $FLAGS input="$FILE" output="$MAP" --quiet
if [ $? -ne 0 ] ; then
- g.message -e message="`basename $0`: r.in.gdal failure."
+ g.message -e message="$PROG: r.in.gdal failure."
rm -f "${TEMPFILE}"*
exit 1
fi
More information about the grass-commit
mailing list