[GRASS-SVN] r55161 - grass/branches/releasebranch_6_4/scripts/r.pack

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 22 00:57:37 PST 2013


Author: hamish
Date: 2013-02-22 00:57:37 -0800 (Fri, 22 Feb 2013)
New Revision: 55161

Modified:
   grass/branches/releasebranch_6_4/scripts/r.pack/description.html
   grass/branches/releasebranch_6_4/scripts/r.pack/r.pack
Log:
strip off mapset to remove fully qualified input (#1637, thanks MarkusN); for user reference, stash a copy of the PROJ_EPSG file, if it exists

Modified: grass/branches/releasebranch_6_4/scripts/r.pack/description.html
===================================================================
--- grass/branches/releasebranch_6_4/scripts/r.pack/description.html	2013-02-22 08:49:12 UTC (rev 55160)
+++ grass/branches/releasebranch_6_4/scripts/r.pack/description.html	2013-02-22 08:57:37 UTC (rev 55161)
@@ -4,6 +4,7 @@
 (color table etc) for copying to another computer as a single compressed
 file (gzip compression).
 
+
 <h2>EXAMPLE</h2>
 
 This command saves the raster map "elevation.dem" into the export
@@ -13,12 +14,15 @@
 r.pack elevation.dem
 </pre></div>
 
+
 <h2>SEE ALSO</h2>
 
 <em><a href="r.unpack.html">r.unpack</a></em>
 
+
 <h2>AUTHOR</h2>
 
 Hamish Bowman, Otago University, New Zealand
 
-<p><i>Last changed: $Date$</i>
+<p>
+<i>Last changed: $Date$</i>

Modified: grass/branches/releasebranch_6_4/scripts/r.pack/r.pack
===================================================================
--- grass/branches/releasebranch_6_4/scripts/r.pack/r.pack	2013-02-22 08:49:12 UTC (rev 55160)
+++ grass/branches/releasebranch_6_4/scripts/r.pack/r.pack	2013-02-22 08:57:37 UTC (rev 55161)
@@ -2,7 +2,7 @@
 #  r.pack   --  pack up a raster map:
 #     collect raster map elements => gzip
 #
-#   (c) 2004-2008, 2012 GRASS Development Team
+#   (c) 2004-2013 GRASS Development Team
 #   AUTHOR: Hamish Bowman, Otago University, New Zealand
 #
 #   This program is free software under the GNU General Public License
@@ -54,7 +54,7 @@
 if [ -n "$GIS_OPT_OUTPUT" ] ; then
    outfile="$GIS_OPT_OUTPUT"
 else
-   outfile="$GIS_OPT_INPUT.pack"
+   outfile="`echo $GIS_OPT_INPUT | cut -d'@' -f1`.pack"
 fi
 
 #be overly helpful
@@ -65,6 +65,9 @@
 if [ -z "$name" ] ; then
    g.message -e "Map not found"
    exit 1
+else
+   # strip off mapset to remove fully qualified input
+   name=`echo "$name" | cut -d'@' -f1`
 fi
 
 
@@ -87,14 +90,13 @@
 BASEDIR=`echo "$file" | sed -e 's+/cell/.*$++'`
 OLDDIR=`pwd`
 
-
 for ELEMENT in cats cell cellhd colr fcell grid3 hist ; do
-    if [ -e "$BASEDIR/$ELEMENT/$GIS_OPT_INPUT" ] ; then
+    if [ -e "$BASEDIR/$ELEMENT/$name" ] ; then
 	cp "$BASEDIR/$ELEMENT/$name" "$TMP_DIR/$ELEMENT"
     fi
 done
 
-if [ -d "$BASEDIR/cell_misc/$GIS_OPT_INPUT/" ] ; then
+if [ -d "$BASEDIR/cell_misc/$name/" ] ; then
     mkdir "$TMP_DIR/cell_misc/"
     cp "$BASEDIR/cell_misc/$name/"* "$TMP_DIR/cell_misc/"
 fi
@@ -109,7 +111,7 @@
 #   (would prefer to use g.proj*, but this way is 5.3 and 5.7 compat)
 eval `g.gisenv`
 
-for SUPPORT in INFO UNITS ; do
+for SUPPORT in INFO UNITS EPSG ; do
    if [ -e "$GISDBASE/$LOCATION_NAME/PERMANENT/PROJ_$SUPPORT" ] ; then
        cp "$GISDBASE/$LOCATION_NAME/PERMANENT/PROJ_$SUPPORT" "$TMP_DIR"
    fi



More information about the grass-commit mailing list