From 05de43cb8395b523d59de27dd964c6abe26e41e3 Mon Sep 17 00:00:00 2001 From: fche Date: Sun, 13 Jan 2008 03:06:33 +0000 Subject: add git commit id as testsuite Snapshot field 2008-01-12 Frank Ch. Eigler * configure.ac: Generate a build tree SNAPSHOT file from git-rev-list, if we suspect the source tree came from git. * configure: Regenerated. 2008-01-12 Frank Ch. Eigler * lib/systemtap.exp (get_system_info): Look for $builddir/SNAPSHOT too. --- ChangeLog | 6 ++++++ configure | 7 +++++++ configure.ac | 7 +++++++ testsuite/ChangeLog | 4 ++++ testsuite/lib/systemtap.exp | 4 +++- 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ab1a2fc5..28109604 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-12 Frank Ch. Eigler + + * configure.ac: Generate a build tree SNAPSHOT file from git-rev-list, + if we suspect the source tree came from git. + * configure: Regenerated. + 2008-01-12 Frank Ch. Eigler PR 5603. diff --git a/configure b/configure index ccca2d7f..1a547523 100755 --- a/configure +++ b/configure @@ -6572,6 +6572,13 @@ cap_LIBS="$LIBS" LIBS="$SAVE_LIBS" CFLAGS="$SAVE_CFLAGS" +if test -d $srcdir/.git -a ! -f $srcdir/SNAPSHOT; then + snapshot=`cd $srcdir; git-rev-list --abbrev-commit --max-count=1 HEAD` + echo $snapshot > SNAPSHOT + { echo "$as_me:$LINENO: Created git SNAPSHOT $snapshot" >&5 +echo "$as_me: Created git SNAPSHOT $snapshot" >&6;} +fi + ac_config_headers="$ac_config_headers config.h:config.in" ac_config_files="$ac_config_files Makefile systemtap.spec stap.1 stapprobes.5 stapfuncs.5 stapex.5 staprun.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5" diff --git a/configure.ac b/configure.ac index 522af8d7..256155a8 100644 --- a/configure.ac +++ b/configure.ac @@ -161,6 +161,13 @@ AC_SUBST(cap_LIBS) LIBS="$SAVE_LIBS" CFLAGS="$SAVE_CFLAGS" +dnl Create SNAPSHOT file from git commit id if possible +if test -d $srcdir/.git -a ! -f $srcdir/SNAPSHOT; then + snapshot=`cd $srcdir; git-rev-list --abbrev-commit --max-count=1 HEAD` + echo $snapshot > SNAPSHOT + AC_MSG_NOTICE([Created git SNAPSHOT $snapshot]) +fi + AC_CONFIG_HEADERS([config.h:config.in]) AC_CONFIG_FILES(Makefile systemtap.spec stap.1 stapprobes.5 stapfuncs.5 stapex.5 staprun.8 man/stapprobes.iosched.5 man/stapprobes.netdev.5 man/stapprobes.nfs.5 man/stapprobes.nfsd.5 man/stapprobes.pagefault.5 man/stapprobes.process.5 man/stapprobes.rpc.5 man/stapprobes.scsi.5 man/stapprobes.signal.5 man/stapprobes.socket.5 man/stapprobes.tcp.5 man/stapprobes.udp.5) AC_CONFIG_SUBDIRS(testsuite) diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index d8d26ce9..d8439450 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2008-01-12 Frank Ch. Eigler + + * lib/systemtap.exp (get_system_info): Look for $builddir/SNAPSHOT too. + 2008-01-09 Masami Hiramatsu PR5554 diff --git a/testsuite/lib/systemtap.exp b/testsuite/lib/systemtap.exp index 3b66b05a..f677da41 100644 --- a/testsuite/lib/systemtap.exp +++ b/testsuite/lib/systemtap.exp @@ -53,7 +53,9 @@ proc get_system_info {} { global Host Snapshot Distro env set Host [exec /bin/uname -a] - if [file exists $env(SRCDIR)/../SNAPSHOT] { + if [file exists ../SNAPSHOT] { + set Snapshot [exec /bin/cat ../SNAPSHOT] + } elseif [file exists $env(SRCDIR)/../SNAPSHOT] { set Snapshot [exec /bin/cat $env(SRCDIR)/../SNAPSHOT] } else { set Snapshot "unknown" -- cgit