aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-01-23 13:24:30 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-01-23 13:24:30 +0200
commitb91134b806ff46049d591f015a06b9bc79a6c62e (patch)
treecf68e033ffd3c8ecf57bbea64048272e2df0445f
parent9573ec60ad36169c9ce7748998c63f09570f2dd4 (diff)
downloadmeson-b91134b806ff46049d591f015a06b9bc79a6c62e.zip
meson-b91134b806ff46049d591f015a06b9bc79a6c62e.tar.gz
meson-b91134b806ff46049d591f015a06b9bc79a6c62e.tar.bz2
Better error message when failing to run install script. Closes #361.
-rw-r--r--mesonbuild/scripts/meson_install.py8
-rwxr-xr-xtest cases/common/60 install script/myinstall.sh2
2 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py
index 1ede757..7e43efd 100644
--- a/mesonbuild/scripts/meson_install.py
+++ b/mesonbuild/scripts/meson_install.py
@@ -125,7 +125,13 @@ def run_install_script(d):
final_command = commands + [script] + i.cmd_arr[1:]
else:
final_command = i.cmd_arr
- subprocess.check_call(final_command, env=child_env)
+ try:
+ rc = subprocess.call(final_command, env=child_env)
+ if rc != 0:
+ sys.exit(rc)
+ except Exception:
+ print('Failed to run install script:', i.cmd_arr[0])
+ sys.exit(1)
def is_elf_platform():
platname = platform.system().lower()
diff --git a/test cases/common/60 install script/myinstall.sh b/test cases/common/60 install script/myinstall.sh
index 4739dee..42a415e 100755
--- a/test cases/common/60 install script/myinstall.sh
+++ b/test cases/common/60 install script/myinstall.sh
@@ -1,5 +1,7 @@
#!/bin/sh
+set -eu
+
echo Starting custom installation step
# These commands fail on Windows, but we don't really care.