Patchwork scripts/qemuimage-testlib: Output a slightly better error if expect is missing

login
register
mail settings
Submitter Richard Purdie
Date Nov. 8, 2011, 5:55 p.m.
Message ID <1320774950.10843.99.camel@ted>
Download mbox | patch
Permalink /patch/14527/
State Accepted
Commit bfbbb420c0a6b315f73d3d5e463a518098ca6ef0
Headers show

Comments

Richard Purdie - Nov. 8, 2011, 5:55 p.m.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---

Patch

diff --git a/scripts/qemuimage-testlib b/scripts/qemuimage-testlib
index 6a1b900..d0d1b74 100755
--- 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