From 2cac13417acfbe6314aca1cfb46274488f96e50b Mon Sep 17 00:00:00 2001 From: root Date: Thu, 14 Feb 2013 00:00:00 +0000 Subject: Unify all uses of trap --- git-remote-gcrypt | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'git-remote-gcrypt') diff --git a/git-remote-gcrypt b/git-remote-gcrypt index f4735c1..a70fc75 100755 --- a/git-remote-gcrypt +++ b/git-remote-gcrypt @@ -389,8 +389,7 @@ ensure_connected() URL=${URL%"#$url_id"} Repoid=$(xecho_n "$url_id" | pack_hash) - TmpManifest_Enc="$Localdir/manifest.$$" - trap 'rm -f "$TmpManifest_Enc"' EXIT + TmpManifest_Enc="$Localdir/tmp_manifest.$$" GET "$URL" "$Repoid" "$TmpManifest_Enc" 2>/dev/null || echo_die "Repository not found: $url_id at $URL" @@ -400,7 +399,6 @@ ensure_connected() isnonnull "$manifest_" || echo_die "Failed to decrypt manifest!" rm -f "$TmpManifest_Enc" - trap - EXIT Branchlist=$(xecho "$manifest_" | xgrep -E '^[0-9a-f]{40} ') Packlist=$(xecho "$manifest_" | xgrep "^$Packpfx") @@ -529,7 +527,6 @@ do_fetch() fi TmpPack_Encrypted="$Localdir/tmp_pack_ENCRYPTED_.$$" - trap 'rm -f "$TmpPack_Encrypted"' EXIT premote_=$(xecho "$Packlist" | cut -f 1-2 -d ' ') # The `+` for $GITCEPTION is pointless but we will be safe for stacking @@ -547,7 +544,6 @@ do_fetch() done rm -f "$TmpPack_Encrypted" - trap - EXIT echo_git # end with blank line } @@ -568,7 +564,6 @@ do_push() make_new_repo fi - trap 'rm -f "$TmpPack_Encrypted" "$TmpObjlist" "$TmpManifest_Enc"' EXIT if isnonnull "$Branchlist" then # filter through batch-check to mark only the commits we have @@ -623,7 +618,7 @@ EOF echo_info "Participants are: $Signers" echo_info "Requesting manifest signature" - TmpManifest_Enc="$Localdir/manifest.$$" + TmpManifest_Enc="$Localdir/tmp_manifest.$$" (xecho "$Branchlist"; xecho "$Packlist"; xecho "$Keeplist"; repoidstr; xecho "$Extension_list") | @@ -653,7 +648,6 @@ EOF PUT_FINAL "$URL" rm -f "$TmpManifest_Enc" - trap - EXIT # ok all updates xecho "$1" | while read line_ @@ -671,6 +665,8 @@ URL=$2 # Remote URL mkdir -p "$Localdir" +trap 'rm -f "$Localdir/tmp_"*".$$"' EXIT 1 2 3 15 + while read Input do case "$Input" in -- cgit v1.2.3