Changeset - r7618:dcb994a6ac6c
[Not reviewed]
master
0 2 0
rubidium - 17 years ago 2007-09-23 10:26:20
rubidium@openttd.org
(svn r11148) -Codechange: add support for getting version numbers from Mercurial/HG instead of norev000 (when using a Mercurial/HG clone that is).
2 files changed with 11 insertions and 2 deletions:
0 comments (0 inline, 0 general)
Makefile.src.in
Show inline comments
 
@@ -99,14 +99,20 @@ ifeq ($(shell if test -d $(SRC_DIR)/.svn
 
REV_MODIFIED := $(shell svnversion $(SRC_DIR) | sed -n 's/.*\(M\).*/\1/p' )
 
# Find the revision like: rXXXX-branch
 
REV := $(shell LC_ALL=C svn info $(SRC_DIR) | $(AWK) '/^URL:.*branch/ { split($$2, a, "/"); BRANCH="-"a[5] } /^Last Changed Rev:/ { REV="r"$$4"$(REV_MODIFIED)" } END { print REV BRANCH }')
 
else
 
# Are we a git dir?
 
ifeq ($(shell if test -d $(SRC_DIR)/../.git; then echo 1; fi), 1)
 
# Find the revision like: rXXXXM
 
REV := g$(shell if head=`git rev-parse --verify HEAD 2>/dev/null`; then echo "$$head" | cut -c1-8; fi)$(shell if git diff-index HEAD | read dummy; then echo M; fi)$(shell git branch|grep '[*]'|sed 's/\* /-/;s/^-master$$//')
 
# Find the revision like: gXXXXM-branch
 
REV := g$(shell if head=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`; then echo "$$head" | cut -c1-8; fi)$(shell if git diff-index HEAD | read dummy; then echo M; fi)$(shell git branch|grep '[*]' | sed 's/\* /-/;s/^-master$$//')
 
else
 
# Are we a hg (Mercurial) dir?
 
ifeq ($(shell if test -d $(SRC_DIR)/../.hg; then echo 1; fi), 1)
 
# Find the revision like: hXXXXM-branch
 
REV := h$(shell if head=`LC_ALL=C hg tip 2>/dev/null`; then echo "$$head" | head -n 1 | cut -c19-26; fi)$(shell if hg status | grep -v '^?' | read dummy; then echo M; fi)$(shell hg branch | sed 's/^/-/;s/^-default$$//')
 
endif
 
endif
 
endif
 
endif
 

	
 
# Make sure we have something in REV
 
ifeq ($(REV),)
config.lib
Show inline comments
 
@@ -699,12 +699,15 @@ check_params() {
 
		elif [ -d "$ROOT_DIR/.svn" ] && [ -n "`svn help`" ]; then
 
			revision=""
 
			log 1 "checking revision... svn detection"
 
		elif [ -d "$ROOT_DIR/.git" ] && [ -n "`git help`" ]; then
 
			revision=""
 
			log 1 "checking revision... git detection"
 
		elif [ -d "$ROOT_DIR/.hg" ] && [ -n "`hg help`" ]; then
 
			revision=""
 
			log 1 "checking revision... hg detection"
 
		else
 
			revision=""
 
			log 1 "checking revision... no detection"
 
			log 1 "WARNING: there is no means to determine the version."
 
			log 1 "WARNING: please use a subversion or git checkout of OpenTTD."
 
			log 1 "WARNING: this version is only allowed by game servers that"
0 comments (0 inline, 0 general)