[GRASS-SVN] r51641 -
grass/branches/releasebranch_6_4/scripts/r.in.wms
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed May 16 18:17:46 EDT 2012
Author: hamish
Date: 2012-05-16 15:17:44 -0700 (Wed, 16 May 2012)
New Revision: 51641
Modified:
grass/branches/releasebranch_6_4/scripts/r.in.wms/r.in.wms
grass/branches/releasebranch_6_4/scripts/r.in.wms/wms.download
Log:
sync with devbr6:
- be more gui-output friendly with wget
- fix (hopefully) xml2 + sed parsing error on layer names
- use correct exit code with capabilities flag
- remove unused curly brackets, minor tweak of whitespace
Modified: grass/branches/releasebranch_6_4/scripts/r.in.wms/r.in.wms
===================================================================
--- grass/branches/releasebranch_6_4/scripts/r.in.wms/r.in.wms 2012-05-16 22:09:40 UTC (rev 51640)
+++ grass/branches/releasebranch_6_4/scripts/r.in.wms/r.in.wms 2012-05-16 22:17:44 UTC (rev 51641)
@@ -335,8 +335,8 @@
if [ "$GIS_FLAG_G" -eq 0 ] ; then
if [ "$USE_WGET" ] ; then
- wget $GIS_OPT_WGETOPTIONS --post-data="${STRING}" \
- "$GIS_OPT_MAPSERVER" -O "$CAPABILITIES_FILE";
+ wget -nv $GIS_OPT_WGETOPTIONS --post-data="$STRING" \
+ "$GIS_OPT_MAPSERVER" -O "$CAPABILITIES_FILE"
message 1 "wget $GIS_OPT_WGETOPTIONS --post-data=\"${STRING}\" \"$GIS_OPT_MAPSERVER\" -O \"$CAPABILITIES_FILE\";"
else
curl $GIS_OPT_CURLOPTIONS -o "$CAPABILITIES_FILE" \
@@ -389,9 +389,9 @@
if [ -x "`which xml2`" ] ; then
cat "$CAPABILITIES_FILE" | xml2 | \
grep "Layer/SRS=\|Layer/Name=\|Layer/Title=\|Style/Name=\|Style/Title=\|Layer/Abstract=" | \
- sed -e 's/.*Layer\\/Name=/\
+ sed -e 's|.*Layer/Name=|\
\
-LAYER: /' \
+ LAYER: |' \
-e "s/.*Layer\\/SRS=/ SRS: /" \
-e "s/.*Layer\\/Title=/ Title: /" \
-e "s/.*Layer\\/Abstract=/ |/" \
@@ -445,7 +445,7 @@
fi
fi
- exit 1;
+ exit 0
}
Modified: grass/branches/releasebranch_6_4/scripts/r.in.wms/wms.download
===================================================================
--- grass/branches/releasebranch_6_4/scripts/r.in.wms/wms.download 2012-05-16 22:09:40 UTC (rev 51640)
+++ grass/branches/releasebranch_6_4/scripts/r.in.wms/wms.download 2012-05-16 22:17:44 UTC (rev 51641)
@@ -54,7 +54,7 @@
if [ -z "$GISBASE" ] ; then
echo "You must be in GRASS GIS to run this program." 1>&2
- exit 1
+ exit 1
fi
if [ "$1" != "@ARGS_PARSED@" ] ; then
@@ -161,9 +161,10 @@
if [ "$POST_DATA_OK" -eq 1 ] ; then
#download the File from the Server
if [ "$USE_WGET" ] ; then
- wget ${WGET_OPTIONS} --post-data="${STRING}" "${SERVER}" -O "${OUTPUT_FILE}"
+ wget --progress=dot:mega $WGET_OPTIONS --post-data="$STRING" \
+ "$SERVER" -O "$OUTPUT_FILE"
else
- curl ${CURL_OPTIONS} -o "${OUTPUT_FILE}" -d "${STRING}" "${SERVER}"
+ curl $CURL_OPTIONS -o "$OUTPUT_FILE" -d "$STRING" "$SERVER"
fi
if [ $? -ne 0 ] ; then
g.message -e "Failed while downloading the data"
More information about the grass-commit
mailing list