File: valgrind-wrapper.in

package info (click to toggle)
pspp 0.8.4-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 35,692 kB
  • ctags: 20,600
  • sloc: ansic: 218,288; sh: 12,890; xml: 11,342; perl: 715; lisp: 597; makefile: 157
file content (38 lines) | stat: -rwxr-xr-x 764 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/sh

program=`basename "$0"`

new_PATH=
save_IFS=$IFS
IFS=:
found=no
for dir in $PATH; do
    IFS=$save_IFS
    if test "X$dir" = X; then
	dir=.
    fi
    if test -x "$dir/$program"; then
	if test $found = no; then
	    found=yes
	    continue
	else
	    if test "X$next_program" = X; then
		next_program=$dir/$program
	    fi
	fi
    fi
done
IFS=$save_IFS

if test $found = no; then
    echo "$0: $program not found in PATH ($PATH)" >&2
    exit 1
elif test "X$next_program" = X; then
    echo "$0: $program found only once in PATH ($PATH)" >&2
    exit 1
fi

: ${VALGRIND:=libtool --mode=execute valgrind --log-file=valgrind.%p --leak-check=full --num-callers=20}
exec $VALGRIND $next_program "$@"
echo "$0: $VALGRIND $wrap_program $* failed" >&2
exit 1