# HG changeset patch # User "Yann E. MORIN" # Date 1350851237 -7200 # Node ID 0c3f8dd9d18431283fc44ebc93b24c284dc3ff13 # Parent 95df9d32afd275ad29c256cc87d58ac34b1a1c48 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 -r 95df9d32afd2 -r 0c3f8dd9d184 scripts/functions --- a/scripts/functions Wed Oct 17 22:01:25 2012 +0200 +++ b/scripts/functions Sun Oct 21 22:27:17 2012 +0200 @@ -216,6 +216,7 @@ CT_DoExecLog() { local level="$1" local cur_cmd + local ret shift ( for i in "$@"; do @@ -254,12 +255,14 @@ 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 @@ 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 }