From f378c3c1ffb4a4fdf68364fe9298e5bccbccd440 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 21 Oct 2012 22:27:17 +0200 Subject: scripts/functions: return a proper error code in CT_DoExecLog Since we added the debug-shell feature, CT_DoExecLog no longer returns the error code of the command, but always return 0. This breaks the download mechanism, which relies on CT_DoExecLog to fail _on_purpose_ to detect that the ressource was not found at the specified URL. Signed-off-by: "Yann E. MORIN" diff --git a/scripts/functions b/scripts/functions index 6e4f0ba..7983f47 100644 --- a/scripts/functions +++ b/scripts/functions @@ -216,6 +216,7 @@ CT_DoLog() { CT_DoExecLog() { local level="$1" local cur_cmd + local ret shift ( for i in "$@"; do @@ -254,12 +255,14 @@ CT_DoExecLog() { rm -f "${CT_BUILD_DIR}/repeat" CT_DoLog DEBUG "==> Executing: ${cur_cmd}" "${@}" 2>&1 |CT_DoLog "${level}" + ret="${?}" if [ -f "${CT_BUILD_DIR}/repeat" ]; then continue else break fi done + exit ${ret} ) # Catch failure of the sub-shell [ $? -eq 0 ] @@ -570,9 +573,11 @@ CT_DoGetFile() { then # Success, we got it, good! mv "${tmp}" "${dest}" + CT_DoLog DEBUG "Got it from: \"${url}\"" else # Woops... rm -f "${tmp}" + CT_DoLog DEBUG "Not at this location: \"${url}\"" fi } -- cgit v0.10.2-6-g49f6