summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2006-06-09 14:40:30 +0000
committerpeter1138 <peter1138@openttd.org>2006-06-09 14:40:30 +0000
commit825eb1cccb2680bbb943c01ddbe22e7f3641263d (patch)
tree629eecf2279cf485fdb4eb1ee4f69730de1b04a3
parent23c672edb8a000b5439d97e4d1692b780d241510 (diff)
downloadopenttd-825eb1cccb2680bbb943c01ddbe22e7f3641263d.tar.xz
(svn r5197) - Use svn info to automatically find the last modified revision number and get branch information and place it in the revision string. Increase NETWORK_REVISION_LENGTH to accommodate the branch tag.
-rw-r--r--Makefile5
-rw-r--r--network.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 2e847214f..bff2d5dfc 100644
--- a/Makefile
+++ b/Makefile
@@ -258,7 +258,10 @@ UNITTEST=unit_test$(EXE)
ifdef RELEASE
REV:=$(RELEASE)
else
-REV := $(shell if test -d .svn; then svnversion . | awk '{ print "r"$$0 }'; fi)
+ifeq ($(shell if test -d .svn; then echo 1; fi), 1)
+REV_MODIFIED := $(shell svnversion . | grep -o M)
+REV := $(shell LC_ALL=C svn info | awk '/^URL:.*branch/ { BRANCH="-"a[split($$2, a, "/")] } /^Last Changed Rev:/ { REV="r"$$4"$(REV_MODIFIED)" } END { print REV BRANCH }')
+endif
endif
# define flag to use for -lrt (some OSes overwrites this later for compatibility)
diff --git a/network.h b/network.h
index a8456ddb1..9e86459aa 100644
--- a/network.h
+++ b/network.h
@@ -48,7 +48,7 @@
enum {
NETWORK_NAME_LENGTH = 80,
NETWORK_HOSTNAME_LENGTH = 80,
- NETWORK_REVISION_LENGTH = 10,
+ NETWORK_REVISION_LENGTH = 15,
NETWORK_PASSWORD_LENGTH = 20,
NETWORK_PLAYERS_LENGTH = 200,
NETWORK_CLIENT_NAME_LENGTH = 25,