Patchwork [CONSOLIDATED,PULL,(v2),29/33] scripts/qemuimage-testlib: Output a slightly better error if expect is missing

login
register
mail settings
Submitter Saul Wold
Date Nov. 10, 2011, 7:43 a.m.
Message ID <3e0c90d0d73c5b2b2d509dc8d4f5cad24753581e.1320910946.git.sgw@linux.intel.com>
Download mbox | patch
Permalink /patch/14743/
State New
Headers show

Comments

Saul Wold - Nov. 10, 2011, 7:43 a.m.
From: Richard Purdie <richard.purdie@linuxfoundation.org>

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/qemuimage-testlib |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

Patch

diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib
index 6a1b900..d0d1b74 100644
--- a/scripts/qemuimage-testlib
+++ b/scripts/qemuimage-testlib
@@ -96,6 +96,13 @@  expect {
     eof          { exit [ lindex [wait] 3 ] }
 }
 EOF`
+
+	expect=`which expect`
+	if [ ! -x "$expect" ]; then
+		Test_Error "ERROR: Please install expect"
+		return 1
+	fi
+
 	expect -c "$exp_cmd"
 	ret=$?
 	rm -rf $tmpfile
@@ -120,6 +127,13 @@  expect {
     eof          { exit [ lindex [wait] 3 ] }
 }
 EOF`
+
+	expect=`which expect`
+	if [ ! -x "$expect" ]; then
+		Test_Error "ERROR: Please install expect"
+		return 1
+	fi
+
 	expect -c "$exp_cmd"
 	ret=$?
 	rm -rf $tmpfile