]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
r12615@catbus: nickm | 2007-05-01 09:48:45 -0400
authorNick Mathewson <nickm@torproject.org>
Tue, 1 May 2007 13:48:49 +0000 (13:48 +0000)
committerNick Mathewson <nickm@torproject.org>
Tue, 1 May 2007 13:48:49 +0000 (13:48 +0000)
 Only replace micro-revision.i if it changes.

svn:r10085

src/or/Makefile.am

index 411c062faf72da612e91ec398c045a17dff4644b..00939cf13124d0a40b5f3c1a5fcb6652e4a7ce0e 100644 (file)
@@ -41,7 +41,7 @@ tor_main.o: micro-revision.i
 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 @@ micro-revision.i: FORCE
             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: