352395 - Please provide SVN revision info in --version -v

Finally committed ... :)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16164
This commit is contained in:
Philippe Waroquiers 2016-11-29 22:32:27 +00:00
parent dee49c2144
commit 11671ae1d3
5 changed files with 77 additions and 18 deletions

View File

@ -62,7 +62,7 @@ vglib_DATA = default.supp
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = valgrind.pc
BUILT_SOURCES = default.supp valgrind.pc
BUILT_SOURCES = default.supp vgversion.h valgrind.pc
CLEANFILES = default.supp
default.supp: $(DEFAULT_SUPP_FILES)
@ -116,10 +116,13 @@ EXTRA_DIST = \
valgrind.spec \
autogen.sh
dist-hook: vgversion.h
cp -p include/vgversion.h $(distdir)/include/vgversion.h
dist_noinst_SCRIPTS = \
vg-in-place
all-local: default.supp
all-local: default.supp vgversion.h
mkdir -p $(inplacedir)
rm -f $(inplacedir)/default.supp
ln -s ../default.supp $(inplacedir)
@ -129,3 +132,7 @@ clean-local:
# Need config.h in the installed tree, since some files depend on it
pkginclude_HEADERS = config.h
# vgversion.h defines accurate versions to report with -v --version
vgversion.h:
auxprogs/make_or_upd_vgversion_h

2
NEWS
View File

@ -72,6 +72,7 @@ To see details of a given bug, visit
where XXXXXX is the bug number as listed below.
348616 Wine/valgrind: noted but unhandled ioctl 0x5390 [..] (DVD_READ_STRUCT)
352395 Please provide SVN revision info in --version -v
352767 Wine/valgrind: noted but unhandled ioctl 0x5307 [..] (CDROMSTOP)
371412 Rename wrap_sys_shmat to sys_shmat like other wrappers
371869 support '%' in symbol Z-encoding
@ -81,7 +82,6 @@ where XXXXXX is the bug number as listed below.
372600 process loops forever when fatal signals are arriving quickly
373046 Stacks registered by core are never deregistered
Release 3.12.0 (20 October 2016)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -6,6 +6,7 @@ dist_noinst_SCRIPTS = \
gen-mdg \
gsl16test \
gsl19test \
make_or_upd_vgversion_h \
nightly-build-summary \
update-demangler \
posixtestsuite-1.5.1-diff-results

View File

@ -0,0 +1,40 @@
#!/bin/sh
extract_svn_version()
{
if [ -d "$1"/.svn ]
then
svnversion -n "$1"
elif [ -d "$1"/.git/svn ]
then
cd "$1" || exit 1
git svn info . | grep '^Revision' | cut -d ' ' -f2 | tr -d '\n'
else
echo "unknown"
fi
}
cat > include/vgversion.h.tmp <<EOF
/* Do not edit: file generated by auxprogs/make_or_upd_vgversion_h.
This file defines VGSVN and VEXSVN, used to report SVN revision
when using command line options: -v --version
*/
#define VGSVN "$(extract_svn_version .)"
#define VEXSVN "$(extract_svn_version VEX)"
EOF
if [ -f include/vgversion.h ]
then
# There is already a vgversion.h.
# Update it only if we found a different and real svn version
if grep unknown include/vgversion.h.tmp ||
cmp -s include/vgversion.h include/vgversion.h.tmp
then
rm include/vgversion.h.tmp
else
mv include/vgversion.h.tmp include/vgversion.h
fi
else
# There is no vgversion.h. Use the one just generated, whatever it is.
mv include/vgversion.h.tmp include/vgversion.h
fi

View File

@ -28,6 +28,7 @@
The GNU General Public License is contained in the file COPYING.
*/
#include "vgversion.h"
#include "pub_core_basics.h"
#include "pub_core_vki.h"
#include "pub_core_vkiscnums.h"
@ -378,6 +379,7 @@ static void early_process_cmd_line_options ( /*OUT*/Int* need_help,
{
UInt i;
HChar* str;
Int need_version = 0;
vg_assert( VG_(args_for_valgrind) );
@ -387,12 +389,13 @@ static void early_process_cmd_line_options ( /*OUT*/Int* need_help,
str = * (HChar**) VG_(indexXA)( VG_(args_for_valgrind), i );
vg_assert(str);
// Nb: the version string goes to stdout.
if VG_XACT_CLO(str, "--version", VG_(log_output_sink).fd, 1) {
VG_(log_output_sink).is_socket = False;
VG_(printf)("valgrind-" VERSION "\n");
VG_(exit)(0);
}
if VG_XACT_CLO(str, "--version", need_version, 1) {}
else if (VG_STREQ(str, "-v") ||
VG_STREQ(str, "--verbose"))
VG_(clo_verbosity)++;
else if (VG_STREQ(str, "-q") ||
VG_STREQ(str, "--quiet"))
VG_(clo_verbosity)--;
else if VG_XACT_CLO(str, "--help", *need_help, *need_help+1) {}
else if VG_XACT_CLO(str, "-h", *need_help, *need_help+1) {}
@ -421,6 +424,17 @@ static void early_process_cmd_line_options ( /*OUT*/Int* need_help,
VG_(clo_sim_hints)) {}
}
if (need_version) {
// Nb: the version string goes to stdout.
VG_(log_output_sink).fd = 1;
VG_(log_output_sink).is_socket = False;
if (VG_(clo_verbosity) <= 1)
VG_(printf)("valgrind-" VERSION "\n");
else
VG_(printf)("valgrind-" VERSION "-" VGSVN "-vex-" VEXSVN "\n");
VG_(exit)(0);
}
/* For convenience */
VG_N_THREADS = VG_(clo_max_threads);
}
@ -557,6 +571,10 @@ void main_process_cmd_line_options ( /*OUT*/Bool* logging_to_fd,
else if VG_STREQN(20, arg, "--command-line-only=") {}
else if VG_STREQ( arg, "--") {}
else if VG_STREQ( arg, "-d") {}
else if VG_STREQ( arg, "-q") {}
else if VG_STREQ( arg, "--quiet") {}
else if VG_STREQ( arg, "-v") {}
else if VG_STREQ( arg, "--verbose") {}
else if VG_STREQN(17, arg, "--max-stackframe=") {}
else if VG_STREQN(17, arg, "--main-stacksize=") {}
else if VG_STREQN(14, arg, "--max-threads=") {}
@ -587,15 +605,8 @@ void main_process_cmd_line_options ( /*OUT*/Bool* logging_to_fd,
" (or --vex-iropt-register-updates=allregs-at-each-insn)\n");
}
// These options are new.
else if (VG_STREQ(arg, "-v") ||
VG_STREQ(arg, "--verbose"))
VG_(clo_verbosity)++;
else if (VG_STREQ(arg, "-q") ||
VG_STREQ(arg, "--quiet"))
VG_(clo_verbosity)--;
/* These options are new, not yet handled by
early_process_cmd_line_options. */
else if VG_BOOL_CLO(arg, "--sigill-diagnostics", VG_(clo_sigill_diag))
sigill_diag_set = True;