]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
utils/brmake: print the error code of the build
authorYann E. MORIN <yann.morin.1998@free.fr>
Tue, 4 Jul 2017 21:53:15 +0000 (23:53 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 4 Jul 2017 22:15:05 +0000 (00:15 +0200)
Since the stdout and stderr streams are redirected, it is not
immediately obvious when a build failed, even though brmake really exits
with the same error code as make did.

When there is an error, print the exit code after the elapsed time.

Reported-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
utils/brmake

index 3c6f8485ab6629bd4dd134d3776d6d11ab943b0b..e30119dd10bc5b35eacc158040bddcc5d7cad52a 100755 (executable)
@@ -29,7 +29,12 @@ main() {
     m=$((d/60))
     d=$((d%60))
     [ ${m} -eq 0 ] || { printf "%${mf}dmin " ${m}; sf="02"; }
-    printf "%${sf}ds\n" ${d}
+    printf "%${sf}ds" ${d}
+
+    if [ ${ret} -ne 0 ]; then
+        printf "  (error code: %s)" ${ret}
+    fi
+    printf "\n"
 
     return ${ret}
 }