diff options
author | root <root@localhost> | 2013-02-14 00:00:00 +0000 |
---|---|---|
committer | root <root@localhost> | 2013-02-14 00:00:00 +0000 |
commit | 2cac13417acfbe6314aca1cfb46274488f96e50b (patch) | |
tree | 76a9028c4be2b1448842dace8f97ae582c7f5bc3 | |
parent | 5751a91aefd99cae8c3e213b7bb8008f9bb26bcc (diff) | |
download | git-remote-gcrypt-2cac13417acfbe6314aca1cfb46274488f96e50b.zip git-remote-gcrypt-2cac13417acfbe6314aca1cfb46274488f96e50b.tar.gz git-remote-gcrypt-2cac13417acfbe6314aca1cfb46274488f96e50b.tar.bz2 |
Unify all uses of trap
-rwxr-xr-x | git-remote-gcrypt | 12 |
1 files changed, 4 insertions, 8 deletions
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 |