[GRASS-SVN] r47679 - grass/trunk/tools

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


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

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

Modified: grass/trunk/tools/grass_indent.sh
===================================================================
--- grass/trunk/tools/grass_indent.sh	2011-08-16 14:14:24 UTC (rev 47678)
+++ grass/trunk/tools/grass_indent.sh	2011-08-16 14:14:35 UTC (rev 47679)
@@ -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