summaryrefslogtreecommitdiff
path: root/src/or/Makefile.am
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-06-12 13:38:37 -0400
committerNick Mathewson <nickm@torproject.org>2009-08-21 12:31:13 -0400
commitdaa0326aaaa85a760be94ee2360cfa61a9fb5be2 (patch)
treedb6484f8eb65fd7cfc02af66f681b21f9cff41b4 /src/or/Makefile.am
parent978571587a85bebb37ec3cb9c2ea1fde1cecd6d7 (diff)
downloadtor-daa0326aaaa85a760be94ee2360cfa61a9fb5be2.tar.gz
tor-daa0326aaaa85a760be94ee2360cfa61a9fb5be2.zip
Add the first 8 bytes of the git commit digest to our versions.
Note that unlike subversion revision numbers, it isn't meaningful to compare these for anything but equality. We define a sort-order anyway, in case one of these accidentally slips into a recommended-versions list.
Diffstat (limited to 'src/or/Makefile.am')
-rw-r--r--src/or/Makefile.am56
1 files changed, 11 insertions, 45 deletions
diff --git a/src/or/Makefile.am b/src/or/Makefile.am
index c967a8846f..7d6c9eb0b9 100644
--- a/src/or/Makefile.am
+++ b/src/or/Makefile.am
@@ -57,52 +57,18 @@ config_codedigest.o: or_sha1.i
tor_main.o: micro-revision.i
micro-revision.i: FORCE
- @svkdir=$$SVKROOT; \
- if test "x$$svkdir" = x ; then \
- svkdir=$$HOME/.svk; \
- fi; \
- if test -d ../../.git && test -x "`which git 2>&1;true`" ; then \
- if test -d ../../.git/svn && test -x "`which git-svn 2>&1;true`" ; then \
- git-svn info ../../README | \
- sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' \
- > micro-revision.tmp \
- || true; \
- fi; \
- elif test -d ../../.svn && test -x "`which svn 2>&1;true`" ; then \
- svn info ../.. | \
- sed -n 's/^Revision: \([0-9][0-9]*\).*/"\1"/p' > micro-revision.tmp \
- || true; \
- elif test -x "`which svk 2>&1;true`" && test -d $$svkdir/local; then \
- location=../..; \
- rev=x; \
- while test x$$rev = xx; do \
- x=`svk info $$location | \
- sed -n 's/^Mirrored From:.*, Rev\. \([0-9][0-9]*\)/\1/p'`; \
- if test x$$x != x; then \
- rev=$$x; \
- break; \
- else \
- loc=`svk info $$location | \
- sed -n 's/^Copied From: \(.*\), Rev\. [0-9][0-9]*/\1/p' | \
- head -1`; \
- if test x$$loc = x; then \
- break; \
- else \
- location=/$$loc; \
- fi; \
- fi; \
- done; \
- if test x$$rev != xx; then \
- echo \"$$rev\" > micro-revision.tmp; \
- fi; \
- fi; \
- if test ! -f micro-revision.tmp ; then \
- if test ! -f micro-revision.i ; then \
- echo '""' > micro-revision.i; \
- fi; \
- elif test ! -f micro-revision.i || \
+ @rm -f micro-revision.tmp; \
+ if test -d ../../.git && test -x "`which git 2>&1;true`"; then \
+ HASH="`git rev-parse --short=16 HEAD`"; \
+ echo \"$$HASH\" > micro-revision.tmp; \
+ fi; \
+ if test ! -f micro-revision.tmp ; then \
+ if test ! -f micro-revision.i ; then \
+ echo '""' > micro-revision.i; \
+ fi; \
+ elif test ! -f micro-revision.i || \
test x"`cat micro-revision.tmp`" != x"`cat micro-revision.i`"; then \
- mv micro-revision.tmp micro-revision.i; \
+ mv micro-revision.tmp micro-revision.i; \
fi; true
or_sha1.i: $(tor_SOURCES) test_data.c test.c