diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 2f660298..4ffbc364 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,7 @@ +2007-12-13 Kolja Waschk + + * configure.ac: Run "svn info" with "-R" to get latest revision + 2007-12-12 Arnim Laeuger * data/Makefile.am (nobase_dist_pkgdata_DATA): add missing '\', fixes diff --git a/jtag/configure.ac b/jtag/configure.ac index 54281f2e..6f42de2a 100644 --- a/jtag/configure.ac +++ b/jtag/configure.ac @@ -29,15 +29,23 @@ AC_REVISION($Revision$) # Get SVN Revision - idea from xfce-power-manager (C) 2007 by B.Tarricone dnl get svn revision +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 | awk '/^Revision: / {printf "%d\n", $2}'` + SVN_REVISION=`LC_ALL=C svn info -R | 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 fi -if test -z "$SVN_REVISION" -a -e "ChangeLog"; then - SVN_REVISION=`cat ChangeLog | awk '/Revision: / {printf "%d\n", $2}'` +if test "$SVN_REVISION" -eq 0 -a -e "ChangeLog"; then + SVN_REVISION=`awk 'BEGIN { x=0 } /Revision: / { if($2>x) x=$2; } END { printf "%d\n",x }' ChangeLog` + if test "$SVN_REVISION" -ne "0" ; then + AC_MSG_RESULT([from ChangeLog: $SVN_REVISION]) + fi fi -if test -z "$SVN_REVISION" ; then - SVN_REVISION=0 +if test "$SVN_REVISION" -eq "0" ; then + AC_MSG_RESULT([unknown, using 0]) fi AC_DEFINE_UNQUOTED([SVN_REVISION], "$SVN_REVISION", [subversion revision number]) AC_SUBST([SVN_REVISION])