]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUILD] fix snapshot date extraction with negative timezones
authorWilly Tarreau <w@1wt.eu>
Sun, 25 Jan 2009 13:10:48 +0000 (14:10 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 25 Jan 2009 13:10:48 +0000 (14:10 +0100)
Building with a last commit having a negative time offset would make
"date" complain.

Makefile

index 89f1b61c6ef859d0fc3db04c2dce730c6bf138f3..2619a653d6c04a1a7d05c9681dc069932d5678c5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -259,7 +259,7 @@ VERSION := $(shell [ -d .git/. ] && ref=`(git-describe --tags) 2>/dev/null` && r
 ifneq ($(VERSION),)
 # OK git is there and works.
 SUBVERS := $(shell comms=`git-log --no-merges v$(VERSION).. 2>/dev/null |grep -c ^commit `; [ $$comms -gt 0 ] && echo "-$$comms" )
-VERDATE := $(shell date +%Y/%m/%d -d "`git-log HEAD^.. 2>/dev/null | grep -m 1 ^Date: | cut -f2- -d: | cut -f1 -d+`" )
+VERDATE := $(shell date +%Y/%m/%d -d "`git-log HEAD^.. 2>/dev/null | sed -ne '/^Date:/{s/\(^[^ ]*:\)\|\( [-+].*\)//gp;q}'`" )
 endif
 endif