Просмотр исходного кода

r12429@catbus: nickm | 2007-04-18 15:28:41 -0400
Make svn revision number visible in version even if building from a .tar.gz. This was remarkably painless.


svn:r9988

Nick Mathewson 19 лет назад
Родитель
Сommit
addf2987c5
2 измененных файлов с 16 добавлено и 14 удалено
  1. 4 2
      ChangeLog
  2. 12 12
      src/or/Makefile.am

+ 4 - 2
ChangeLog

@@ -23,8 +23,10 @@ Changes in version 0.2.0.1-alpha - 2007-??-??
     - When warning about missing headers, tell the user to let us
     - When warning about missing headers, tell the user to let us
       know if the compile succeeds anyway, so we can downgrade the
       know if the compile succeeds anyway, so we can downgrade the
       warning.
       warning.
-    - If we're building from a subversion checkout or an SVK mirror, include
-      the current SVN revision as part of the version string.
+    - Include the current subversion revision as part of the version
+      string: either fetch it directly if we're in an SVN checkout, do
+      some magic to guess it if we're in an SVK checkout, or use
+      the last-detected version if we're building from a .tar.gz.
 
 
   o Minor features (logging):
   o Minor features (logging):
     - Always prepend "Bug: " to any log message about a bug.
     - Always prepend "Bug: " to any log message about a bug.

+ 12 - 12
src/or/Makefile.am

@@ -26,38 +26,38 @@ test_SOURCES = buffers.c circuitbuild.c circuitlist.c \
 
 
 test_LDADD = ../common/libor.a ../common/libor-crypto.a
 test_LDADD = ../common/libor.a ../common/libor-crypto.a
 
 
-noinst_HEADERS = or.h eventdns.h eventdns_tor.h
+noinst_HEADERS = or.h eventdns.h eventdns_tor.h micro-revision.i
 
 
 tor_main.o: micro-revision.i
 tor_main.o: micro-revision.i
 
 
 micro-revision.i: FORCE
 micro-revision.i: FORCE
-	rm -f micro-revision.i;					\
 	if test -d ../../.svn ; then 				\
 	if test -d ../../.svn ; then 				\
 	  svn info ../.. |              			\
 	  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.i \
-	     || true; \
+	     || true;                                           \
 	fi;							\
 	fi;							\
 	if test ! -f micro-revision.i -a x`which svk` != x; then\
 	if test ! -f micro-revision.i -a x`which svk` != x; then\
           location=../..;                                       \
           location=../..;                                       \
           rev=x;                                                \
           rev=x;                                                \
-          while test x$$rev = xx; do                             \
-            x=`svk info $$location |                             \
+          while test x$$rev = xx; do                            \
+            x=`svk info $$location |                            \
               sed -n 's/^Mirrored From:.*, Rev\. \([0-9][0-9]*\)/\1/p'`; \
               sed -n 's/^Mirrored From:.*, Rev\. \([0-9][0-9]*\)/\1/p'`; \
-            if test x$$x != x; then                              \
-              rev=$$x;                                           \
+            if test x$$x != x; then                             \
+              rev=$$x;                                          \
               break;                                            \
               break;                                            \
             else                                                \
             else                                                \
-              loc=`svk info $$location |                         \
+              loc=`svk info $$location |                        \
                 sed -n 's/^Copied From: \(.*\), Rev\. [0-9][0-9]*/\1/p'`; \
                 sed -n 's/^Copied From: \(.*\), Rev\. [0-9][0-9]*/\1/p'`; \
-              if test x$$loc == x; then                          \
-                rev="";                                         \
+              if test x$$loc = x; then                          \
                 break;                                          \
                 break;                                          \
               else                                              \
               else                                              \
-                location=/$$loc;                                 \
+                location=/$$loc;                                \
               fi;                                               \
               fi;                                               \
             fi;                                                 \
             fi;                                                 \
           done;                                                 \
           done;                                                 \
-          echo \"$$rev\" > micro-revision.i;                   \
+          if test x$$rev != x; then                             \
+            echo \"$$rev\" > micro-revision.i;                  \
+          fi;                                                   \
         fi;                                                     \
         fi;                                                     \
 	if test ! -f micro-revision.i; then			\
 	if test ! -f micro-revision.i; then			\
 	  echo '""' > micro-revision.i;				\
 	  echo '""' > micro-revision.i;				\