summaryrefslogtreecommitdiff
path: root/Makefile.src.in
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2008-09-06 12:54:11 +0000
committertruebrain <truebrain@openttd.org>2008-09-06 12:54:11 +0000
commit72f86fe801c5a03e3a7d95cf0f7d0ae999ed6931 (patch)
treebdf592eabc60c980585025e538c5c73a5f49831b /Makefile.src.in
parentdb58c25af214e02315b2428b6d6a4e797a50659d (diff)
downloadopenttd-72f86fe801c5a03e3a7d95cf0f7d0ae999ed6931.tar.xz
(svn r14255) -Fix [configure]: remove the requirement to have a recent enough 'grep' which understands -m. Instead, use 'head -n 1' which is more common available
Diffstat (limited to 'Makefile.src.in')
-rw-r--r--Makefile.src.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile.src.in b/Makefile.src.in
index 585a4cd45..5202809e2 100644
--- a/Makefile.src.in
+++ b/Makefile.src.in
@@ -129,13 +129,13 @@ else
ifeq ($(shell if test -d $(SRC_DIR)/../.git; then echo 1; fi), 1)
# 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)$(REV_MODIFIED)$(shell git branch|grep '[*]' | sed 's/\* /-/;s/^-master$$//')
-REV_NR := $(shell LC_ALL=C cd "$(SRC_DIR)/.." && git log --pretty=format:%s src | grep -m 1 "^(svn r[0-9]*)" | sed "s/.*(svn r\([0-9]*\)).*/\1/" )
+REV_NR := $(shell LC_ALL=C cd "$(SRC_DIR)/.." && git log --pretty=format:%s src | grep "^(svn r[0-9]*)" | head -n 1 | sed "s/.*(svn r\([0-9]*\)).*/\1/" )
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 -d: -f3 | cut -c1-8; fi)$(REV_MODIFIED)$(shell hg branch | sed 's/^/-/;s/^-default$$//')
-REV_NR := $(shell LC_ALL=C hg log -k "svn" -l 1 --template "{desc}\n" $(SRC_DIR) | grep -m 1 "^(svn r[0-9]*)" | sed "s/.*(svn r\([0-9]*\)).*/\1/" )
+REV_NR := $(shell LC_ALL=C hg log -k "svn" -l 1 --template "{desc}\n" $(SRC_DIR) | grep "^(svn r[0-9]*)" | head -n 1 | sed "s/.*(svn r\([0-9]*\)).*/\1/" )
endif
endif
endif