From eca4c6fcaf7393a4a042ca2c6d104e83e0de2ffe Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 8 Sep 2020 18:33:42 +0530 Subject: minstall: Print a big FAILED when a script fails We don't run any further scripts when this happens, so we need to print a big error. The exit code was already correct. Fixes https://github.com/mesonbuild/meson/issues/7627 --- mesonbuild/minstall.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py index e6e973a..d477718 100644 --- a/mesonbuild/minstall.py +++ b/mesonbuild/minstall.py @@ -437,11 +437,13 @@ class Installer: self.log('Running custom install script {!r}'.format(name)) try: rc = subprocess.call(script + args, env=child_env) - if rc != 0: - sys.exit(rc) except OSError: - print('Failed to run install script {!r}'.format(name)) - sys.exit(1) + print('FAILED: install script \'{}\' could not be run, stopped'.format(name)) + # POSIX shells return 127 when a command could not be found + sys.exit(127) + if rc != 0: + print('FAILED: install script \'{}\' exit code {}, stopped'.format(name, rc)) + sys.exit(rc) def install_targets(self, d): for t in d.targets: -- cgit v1.1