improve the svn rev lookup process

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1633 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Mike Frysinger 16 years ago
parent 7b9c9550e3
commit 09e4be3761

@ -1,3 +1,8 @@
2009-05-28 Mike Frysinger <vapier@gentoo.org>
* configure.ac: improve svn rev look up by ignoring errors, unifying
duplicated code, and support git-svn tree
2009-05-24 Rutger Hofman <rfhh>
* src/bus/avr32.c: fix uninitialized warning (Florian Fainelli)

@ -35,19 +35,21 @@ AC_MSG_CHECKING([code revision])
SVN=`which svn`
SVN_REVISION=0
if test -n "$SVN" -a -x "$SVN"; then
SVN_REVISION=`LC_ALL=C svn info -R "$srcdir" | awk 'BEGIN { x=0 } /^Revision: / { if($2>x) x=$2; } END { printf "%d\n",x }'`
if test "$SVN_REVISION" -ne "0" ; then
AC_MSG_RESULT([from svn info: $SVN_REVISION])
fi
SVN_REVISION=`LC_ALL=C svn info -R "$srcdir" 2>/dev/null | awk 'BEGIN { x=0 } /^Revision: / { if($2>x) x=$2; } END { printf "%d\n",x }'`
SVN_FROM="svn info"
fi
if test "$SVN_REVISION" -eq 0 -a -e "$srcdir/ChangeLog"; then
SVN_REVISION=`awk 'BEGIN { x=0 } /Revision: / { if($2>x) x=$2; } END { printf "%d\n",x }' "$srcdir/ChangeLog"`
if test "$SVN_REVISION" -ne "0" ; then
AC_MSG_RESULT([from ChangeLog: $SVN_REVISION])
fi
SVN_FROM="ChangeLog"
fi
if test "$SVN_REVISION" -eq 0; then
SVN_REVISION=`git log -n1 --pretty=format:%b 2>/dev/null | sed -n '/^git-svn-id:/{s:.*@::;s: .*::;p}'`
SVN_FROM="git-svn log"
fi
if test "$SVN_REVISION" -eq "0" ; then
AC_MSG_RESULT([unknown, using 0])
else
AC_MSG_RESULT([from $SVN_FROM: $SVN_REVISION])
fi
AC_DEFINE_UNQUOTED([SVN_REVISION], "$SVN_REVISION", [subversion revision number])
AC_SUBST([SVN_REVISION])

Loading…
Cancel
Save