From cd4890255c9ab4bbb400c214aa0012c95361a9a5 Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Thu, 13 Dec 2007 09:00:16 +0000 Subject: [PATCH] configure: Run "svn info" with "-R" to get revision. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@837 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 4 ++++ jtag/configure.ac | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) 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])