# HG changeset patch # User Ilya Tumaykin # Date 1456106713 -10800 # Node ID d287d2a720150fd76a90df31d7cc9ac5eba5fa59 # Parent d7db6772827986cd4e50000ca56f6ec7e268b688 unix: return proper error code from `trap' action Use single quotes for `trap' action. This way `$?' is evaluated when action is executed, not when `trap' is defined. diff -r d7db67728279 -r d287d2a72015 plat/unix/update_scopedb.sh --- a/plat/unix/update_scopedb.sh Mon Feb 22 03:50:50 2016 +0300 +++ b/plat/unix/update_scopedb.sh Mon Feb 22 05:05:13 2016 +0300 @@ -47,7 +47,7 @@ echo $$ > "$DB_FILE.lock" # Remove lock and temp file if script is stopped unexpectedly. -trap "rm -f \"$DB_FILE.lock\" \"$DB_FILE.temp\"" 0 3 4 15 +trap 'rm -f "$DB_FILE.lock" "$DB_FILE.temp"' 0 3 4 15 PREVIOUS_DIR=$(pwd) if [ -d "$PROJECT_ROOT" ]; then diff -r d7db67728279 -r d287d2a72015 plat/unix/update_tags.sh --- a/plat/unix/update_tags.sh Mon Feb 22 03:50:50 2016 +0300 +++ b/plat/unix/update_tags.sh Mon Feb 22 05:05:13 2016 +0300 @@ -67,7 +67,7 @@ echo $$ > "$TAGS_FILE.lock" # Remove lock and temp file if script is stopped unexpectedly. -trap "errorcode=$?; rm -f \"$TAGS_FILE.lock\" \"$TAGS_FILE.temp\"; exit $errorcode" INT TERM EXIT +trap 'errorcode=$?; rm -f "$TAGS_FILE.lock" "$TAGS_FILE.temp"; exit $errorcode' INT TERM EXIT INDEX_WHOLE_PROJECT=1 if [ -f "$TAGS_FILE" ]; then