fix build error detection in verbose mode
authorTimo Savola <tsavola@movial.fi>
Fri, 11 Apr 2008 16:22:44 +0000 (19:22 +0300)
committerTimo Savola <tsavola@movial.fi>
Fri, 11 Apr 2008 16:24:38 +0000 (19:24 +0300)
this change makes the shell script bash-specific.

matrix/build.py
scripts/run.sh

index 5e0d48d..a7146db 100644 (file)
@@ -268,7 +268,7 @@ def spawn(c, action):
        workdir = os.path.join(config.top_dir, 'src', c.name)
        log = log_path(c, action)
 
-       args = ['/bin/sh', script]
+       args = ['bash', script]
 
        env = dict(
                MATRIX_TOPDIR      = os.path.abspath(config.top_dir),
@@ -297,6 +297,11 @@ def spawn(c, action):
 
        if config.debug:
                print 'Executing:', ' '.join(args)
+               print 'Variables:'
+               l = [key for key in env if key.startswith('MATRIX_')]
+               l.sort()
+               for key in l:
+                       print '\t%-18s = "%s"' % (key, env[key])
 
        return os.spawnvpe(os.P_NOWAIT, args[0], args, env)
 
index 486bd57..88e60de 100644 (file)
@@ -1,9 +1,7 @@
-#!/bin/sh
-#
 # Copyright (C) 2008 Movial Oy
 # Authors: Timo Savola <tsavola@movial.fi>
 
-if [ x"$MAKE" = x ]
+if [ -z "$MAKE" ]
 then
        MAKE="make"
 fi
@@ -11,7 +9,7 @@ fi
 MAKEFILE="$MATRIX_SCRIPTDIR/matrix.mk"
 TARGET="__matrix_$MATRIX_ACTION"
 
-if [ x"$MATRIX_VERBOSE" = x1 ]
+if [ "$MATRIX_VERBOSE" ]
 then
        "$MAKE" \
                --no-print-directory \
@@ -20,6 +18,7 @@ then
                -f "$MAKEFILE" \
                "$TARGET" \
                2>&1 | tee $MATRIX_LOG
+       exit ${PIPESTATUS[0]}
 else
        exec "$MAKE" \
                --no-print-directory \