btrfs-progs: tests: replace which by type -p
In some environments the which utility might not be available and the shell builtin 'type -p' is readily available. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
f2ffce38b9
commit
01c1bf8d8e
|
@ -11,7 +11,7 @@ if [ -z "$TOP" ]; then
|
|||
INTERNAL_BIN="$TOP"
|
||||
else
|
||||
# external, defaults to system binaries
|
||||
TOP=$(dirname `which btrfs`)
|
||||
TOP=$(dirname `type -p btrfs`)
|
||||
TEST_TOP="$SCRIPT_DIR"
|
||||
INTERNAL_BIN="$TEST_TOP"
|
||||
fi
|
||||
|
|
|
@ -12,7 +12,7 @@ if [ -z "$TOP" ]; then
|
|||
INTERNAL_BIN="$TOP"
|
||||
else
|
||||
# external, defaults to system binaries
|
||||
TOP=$(dirname `which btrfs`)
|
||||
TOP=$(dirname `type -p btrfs`)
|
||||
TEST_TOP="$SCRIPT_DIR"
|
||||
INTERNAL_BIN="$TEST_TOP"
|
||||
fi
|
||||
|
|
|
@ -393,7 +393,7 @@ check_prereq()
|
|||
|
||||
check_global_prereq()
|
||||
{
|
||||
which "$1" &> /dev/null
|
||||
type -p "$1" &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
_fail "Failed system wide prerequisities: $1";
|
||||
fi
|
||||
|
@ -405,7 +405,7 @@ check_dm_target_support()
|
|||
{
|
||||
setup_root_helper
|
||||
|
||||
which dmsetup &> /dev/null
|
||||
type -p dmsetup &> /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
_not_run "This test requires dmsetup tool";
|
||||
fi
|
||||
|
|
|
@ -13,7 +13,7 @@ if [ -z "$TOP" ]; then
|
|||
INTERNAL_BIN="$TOP"
|
||||
else
|
||||
# external, defaults to system binaries
|
||||
TOP=$(dirname `which btrfs`)
|
||||
TOP=$(dirname `type -p btrfs`)
|
||||
TEST_TOP="$SCRIPT_DIR"
|
||||
INTERNAL_BIN="$TEST_TOP"
|
||||
fi
|
||||
|
|
|
@ -12,7 +12,7 @@ if [ -z "$TOP" ]; then
|
|||
INTERNAL_BIN="$TOP"
|
||||
else
|
||||
# external, defaults to system binaries
|
||||
TOP=$(dirname `which btrfs`)
|
||||
TOP=$(dirname `type -p btrfs`)
|
||||
TEST_TOP="$SCRIPT_DIR"
|
||||
INTERNAL_BIN="$TEST_TOP"
|
||||
fi
|
||||
|
|
|
@ -12,7 +12,7 @@ if [ -z "$TOP" ]; then
|
|||
INTERNAL_BIN="$TOP"
|
||||
else
|
||||
# external, defaults to system binaries
|
||||
TOP=$(dirname `which btrfs`)
|
||||
TOP=$(dirname `type -p btrfs`)
|
||||
TEST_TOP="$SCRIPT_DIR"
|
||||
INTERNAL_BIN="$TEST_TOP"
|
||||
fi
|
||||
|
|
|
@ -12,7 +12,7 @@ if [ -z "$TOP" ]; then
|
|||
INTERNAL_BIN="$TOP"
|
||||
else
|
||||
# external, defaults to system binaries
|
||||
TOP=$(dirname `which btrfs`)
|
||||
TOP=$(dirname `type -p btrfs`)
|
||||
TEST_TOP="$SCRIPT_DIR"
|
||||
INTERNAL_BIN="$TEST_TOP"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue