common: fix "utility required warning" with empty utility name

In generic/019, if we hadn't install fio, we will get following output:

 generic/019      [not run]  utility required, skipped this test <- *
 Not run: generic/019
 Passed all 0 tests

When fio is not installed, "$FIO_PROG" is set to blank, and
_require_fio() call _require_command() with none arguments.

This patch fixed all misuse of _require_command(), add 2nd argument
to let _require_command() output right message, and add quotes to
first argument to avoid argument shifting.

Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Zhao Lei
2015-03-18 15:00:23 +11:00
committed by Dave Chinner
parent 57914b8850
commit 7a1ad744f2
12 changed files with 17 additions and 17 deletions
+3 -3
View File
@@ -1299,7 +1299,7 @@ _require_dm_flakey()
{
# require SCRATCH_DEV to be a valid block device
_require_block_device $SCRATCH_DEV
_require_command $DMSETUP_PROG
_require_command "$DMSETUP_PROG" dmsetup
modprobe dm-flakey >/dev/null 2>&1
$DMSETUP_PROG targets | grep flakey >/dev/null 2>&1
@@ -2289,7 +2289,7 @@ _require_deletable_scratch_dev_pool()
_require_btrfs()
{
cmd=$1
_require_command $BTRFS_UTIL_PROG btrfs
_require_command "$BTRFS_UTIL_PROG" btrfs
if [ -z "$1" ]; then
return 1;
fi
@@ -2302,7 +2302,7 @@ _require_fio()
{
job=$1
_require_command $FIO_PROG
_require_command "$FIO_PROG" fio
if [ -z "$1" ]; then
return 1;
fi