提交 47b71644 编写于 作者: S Stephen Warren 提交者: Tom Rini

fs-test.sh: fix pre-requisite detection

In the following snippet:

if [ ! -x `which $prereq` ]; then

When $prereq does not exist, `which $prereq` evaluates to the empty string,
which results in *no* argument being passed to the -x operator, which then
evaluates to true, which is the equivalent of the prereq having been found. In
order for this to fail as expected, we must pass an empty argument, which then
causes -x to fail. Do this by wrapping the `` in quotes so there's always an
argument to -x, even if the value of the argument is zero-length.
Signed-off-by: NStephen Warren <swarren@wwwdotorg.org>
Reviewed-by: NSimon Glass <sjg@chromium.org>
Tested-by: NSimon Glass <sjg@chromium.org>
上级 4a282742
......@@ -58,7 +58,7 @@ GB2p5="${MOUNT_DIR}/${BIG_FILE}"
# Check if the prereq binaries exist, or exit
function check_prereq() {
for prereq in $PREREQ_BINS; do
if [ ! -x `which $prereq` ]; then
if [ ! -x "`which $prereq`" ]; then
echo "Missing $prereq binary. Exiting!"
exit
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册