Include input script in error message.

Signed-off-by: Tim 'mithro' Ansell <tansell@google.com>
diff --git a/common/foundry_install.py b/common/foundry_install.py
index c535b0c..904d9ab 100755
--- a/common/foundry_install.py
+++ b/common/foundry_install.py
@@ -250,10 +250,21 @@
             print(line)
 
     if fproc.returncode != 0:
-        emsg = "Command {} failed with exit code: {}\n".format(
-            name, fproc.returncode)
-        emsg += "  " + " ".join(cmd)
-        raise SystemError(emsg)
+        emsg = [
+            "Command {} failed with exit code: {}\n".format(
+                name, fproc.returncode),
+            "  " + " ".join(cmd),
+        ]
+        if stdin != subprocess.DEVNULL:
+            stdin.seek(0)
+            input_script = stdin.read()
+            emsg += [
+                "\nInput script was:\n",
+                '-'*75,'\n',
+                input_script,'\n',
+                '-'*75,'\n',
+            ]
+        raise SystemError("".join(emsg))
 
 #----------------------------------------------------------------------------
 #----------------------------------------------------------------------------