~ubuntu-branches/debian/sid/lvm2/sid

« back to all changes in this revision

Viewing changes to test/lib/lvm-wrapper.sh

  • Committer: Package Import Robot
  • Author(s): Bastian Blank
  • Date: 2013-03-03 12:33:47 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20130303123347-smfwei6dodkdth55
Tags: 2.02.98-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
 
2
# Copyright (C) 2011-2012 Red Hat, Inc.
 
3
#
 
4
# This copyrighted material is made available to anyone wishing to use,
 
5
# modify, copy, or redistribute it subject to the terms and conditions
 
6
# of the GNU General Public License v.2.
 
7
#
 
8
# You should have received a copy of the GNU General Public License
 
9
# along with this program; if not, write to the Free Software Foundation,
 
10
# Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
2
11
 
3
12
. lib/paths
4
 
cmd=$(echo ./$0|sed "s,.*/,,")
5
 
 
6
 
test "$cmd" = lvm && exec "$abs_top_builddir/tools/lvm" "$@"
7
 
exec "$abs_top_builddir/tools/lvm" "$cmd" "$@"
 
13
 
 
14
CMD=${0##*/}
 
15
test "$CMD" != lvm || unset CMD
 
16
 
 
17
# Multiple level of LVM_VALGRIND support
 
18
# the higher level the more commands are traced
 
19
if test -n "$LVM_VALGRIND"; then
 
20
        RUN_VALGRIND="aux run_valgrind";
 
21
        case "$CMD" in
 
22
          lvs|pvs|vgs|vgck|vgscan)
 
23
                test "$LVM_VALGRIND" -gt 2 || unset RUN_VALGRIND ;;
 
24
          pvcreate|pvremove|lvremove|vgcreate|vgremove)
 
25
                test "$LVM_VALGRIND" -gt 1 || unset RUN_VALGRIND ;;
 
26
          *)
 
27
                test "$LVM_VALGRIND" -gt 0 || unset RUN_VALGRIND ;;
 
28
        esac
 
29
fi
 
30
 
 
31
$RUN_VALGRIND "$abs_top_builddir/tools/lvm" $CMD "$@" && \
 
32
        rm -f debug.log # Remove log for successful command