[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10085: Only replace micro-revision.i if it changes. (in tor/trunk: . src/or)



Author: nickm
Date: 2007-05-01 09:48:49 -0400 (Tue, 01 May 2007)
New Revision: 10085

Modified:
   tor/trunk/
   tor/trunk/src/or/
   tor/trunk/src/or/Makefile.am
Log:
 r12615@catbus:  nickm | 2007-05-01 09:48:45 -0400
 Only replace micro-revision.i if it changes.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r12615] on 8246c3cf-6607-4228-993b-4d95d33730f1


Property changes on: tor/trunk/src/or
___________________________________________________________________
Name: svn:ignore
   - Makefile
Makefile.in
micro-revision.i
tor
test
.deps
*.gcov
*.gcno
*.gcda

   + Makefile
Makefile.in
micro-revision.*
tor
test
.deps
*.gcov
*.gcno
*.gcda


Modified: tor/trunk/src/or/Makefile.am
===================================================================
--- tor/trunk/src/or/Makefile.am	2007-05-01 10:36:43 UTC (rev 10084)
+++ tor/trunk/src/or/Makefile.am	2007-05-01 13:48:49 UTC (rev 10085)
@@ -41,7 +41,7 @@
 micro-revision.i: FORCE
 	@if test -d ../../.svn -a x`which svn` != x ; then	\
 	  svn info ../.. |              			\
-	  sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' > micro-revision.i \
+	  sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' > micro-revision.tmp \
 	     || true;                                           \
 	else                                                    \
 	if test x`which svk` != x -a -d ~/.svk; then            \
@@ -64,12 +64,16 @@
             fi;                                                 \
           done;                                                 \
           if test x$$rev != x; then                             \
-            echo \"$$rev\" > micro-revision.i;                  \
+            echo \"$$rev\" > micro-revision.tmp;                \
           fi;                                                   \
         fi;                                                     \
 	fi;                                                     \
-	if test ! -f micro-revision.i; then			\
-	  echo '""' > micro-revision.i;				\
+	if test ! -f micro-revision.tmp; then			\
+	  echo '""' > micro-revision.tmp;			\
+	fi;                                                     \
+	if test "`cat micro-revision.tmp`" != "`cat micro-revision.i`"; then \
+	  mv micro-revision.tmp micro-revision.i;               \
 	fi
 
+#Dummy target to ensure that micro-revision.i _always_ gets built.
 FORCE: