* Applied patch by Andreas to unify SVN version detection with GIT, also fixing

bug #2860.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31333 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-06-30 15:20:54 +00:00
parent b6fffec7e1
commit a1c6f0fde1

View File

@ -315,14 +315,19 @@ rule CopySetHaikuRevision target : source
actions CopySetHaikuRevision1
{
$(HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR)
revision=`LC_ALL=C LANG=C svn info $(HAIKU_TOP) 2> /dev/null |
grep Revision | awk '{printf $2}'`
# Try svn or git-svn
# Extract from "Revision: 12345" line
revision=`(LC_ALL=C LANG=C svn info $(HAIKU_TOP) ||
(cd $(HAIKU_TOP) && LC_ALL=C LANG=C git svn info)) 2> /dev/null |
grep Revision | awk '{printf $2}'`
if [ "$revision" = 0 -o "$revision" = "" ]; then
revision=`(cd $(HAIKU_TOP) && LC_ALL=C LANG=C git svn info)
2> /dev/null ||
(git log --max-count=1 --grep="git-svn-id:" 2> /dev/null |
grep git-svn-id: | cut -d '@' -f 2 |
awk '{printf $1}') 2> /dev/null`
# git-svn not present or not configured for this repository
# Try searching git logs for last git-svn commit
# Extract from " git-svn-id: .../haiku/trunk@12345 ..." line
revision=`cd $(HAIKU_TOP) &&
git log --max-count=1 --grep="git-svn-id:" 2> /dev/null |
grep "git-svn-id:" | cut -d '@' -f 2 |
awk '{printf $1}'`
fi
if [ "$revision" = "" ]; then
revision=0