[GRASS-SVN] r47677 - grass/branches/releasebranch_6_4/tools

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Aug 16 10:14:18 EDT 2011


Author: neteler
Date: 2011-08-16 07:14:18 -0700 (Tue, 16 Aug 2011)
New Revision: 47677

Modified:
   grass/branches/releasebranch_6_4/tools/grass_indent.sh
Log:
restore original file with timestamp if indent did not change anything

Modified: grass/branches/releasebranch_6_4/tools/grass_indent.sh
===================================================================
--- grass/branches/releasebranch_6_4/tools/grass_indent.sh	2011-08-16 14:13:52 UTC (rev 47676)
+++ grass/branches/releasebranch_6_4/tools/grass_indent.sh	2011-08-16 14:14:18 UTC (rev 47677)
@@ -14,4 +14,6 @@
  grep -l '\<_$' "$@" | \
      while read file ; do sed -i -e '/[( \t]_$/{;N;s/\n[ \t]*//;}' $file ; done
 
+ # restore original file with timestamp if indent did not change anything
+ cmp "$@"~ "$@" > /dev/null && mv -f "$@"~ "$@"
 fi



More information about the grass-commit mailing list