Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/scripts/repo-add.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/repo-add.sh.in')
-rw-r--r--scripts/repo-add.sh.in10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 29b150c8..d147b875 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -520,13 +520,19 @@ remove() {
}
trap_exit() {
+ # unhook all traps to avoid race conditions
+ trap '' EXIT TERM HUP QUIT INT ERR
+
echo
error "$@"
- exit 1
+ clean_up 1
}
clean_up() {
- local exit_code=$?
+ local exit_code=${1:-$?}
+
+ # unhook all traps to avoid race conditions
+ trap '' EXIT TERM HUP QUIT INT ERR
[[ -d $tmpdir ]] && rm -rf "$tmpdir"
(( CLEAN_LOCK )) && [[ -f $LOCKFILE ]] && rm -f "$LOCKFILE"