From d35ab46b816bff5c4a88c1093cbd9b440005edee Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Thu, 5 Dec 2024 09:52:49 -0500 Subject: [PATCH] fixed error on removing sort file too early that file i cleaned up was actually needed across function calls. did find the place where an error could leave the file lying around, and fixed that instead. --- scripts/rev_control/version_control.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/rev_control/version_control.sh b/scripts/rev_control/version_control.sh index 5c9bbe18..02bf827a 100644 --- a/scripts/rev_control/version_control.sh +++ b/scripts/rev_control/version_control.sh @@ -524,7 +524,7 @@ function generate_rev_ctrl_filelist() local sortfile=$(mktemp /tmp/zz_checkin_sort.XXXXXX) sort <"$tempfile" >"$sortfile" echo "$sortfile" - \rm "$tempfile" "$sortfile" + \rm "$tempfile" } # iterates across a list of directories contained in a file (first parameter). @@ -546,7 +546,12 @@ function perform_revctrl_action_on_file() echo -n "[$(pwd)] " # pass the current directory plus the remaining parameters from function invocation. $action . - exit_on_error "performing action $action on: $(pwd)" + local retval=$? + if [ $retval -ne 0 ]; then + rm "$tempfile" + (exit $retval) # re-assert the return value as our exit value. + exit_on_error "performing action $action on: $(pwd)" + fi popd &>/dev/null done 3<"$tempfile" -- 2.34.1