summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@free.fr>2012-10-21 20:27:17 (GMT)
committerYann E. MORIN" <yann.morin.1998@free.fr>2012-10-21 20:27:17 (GMT)
commitf378c3c1ffb4a4fdf68364fe9298e5bccbccd440 (patch)
treea200501d34de62d05385bb943d185d851e608f08 /scripts
parent623a30ed4509302efc7856cc6a80ad3b283c4c2d (diff)
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" <yann.morin.1998@free.fr>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions5
1 files changed, 5 insertions, 0 deletions
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
}