Unify all uses of trap
This commit is contained in:
parent
5751a91aef
commit
2cac13417a
1 changed files with 4 additions and 8 deletions
|
@ -389,8 +389,7 @@ ensure_connected()
|
||||||
URL=${URL%"#$url_id"}
|
URL=${URL%"#$url_id"}
|
||||||
Repoid=$(xecho_n "$url_id" | pack_hash)
|
Repoid=$(xecho_n "$url_id" | pack_hash)
|
||||||
|
|
||||||
TmpManifest_Enc="$Localdir/manifest.$$"
|
TmpManifest_Enc="$Localdir/tmp_manifest.$$"
|
||||||
trap 'rm -f "$TmpManifest_Enc"' EXIT
|
|
||||||
GET "$URL" "$Repoid" "$TmpManifest_Enc" 2>/dev/null ||
|
GET "$URL" "$Repoid" "$TmpManifest_Enc" 2>/dev/null ||
|
||||||
echo_die "Repository not found: $url_id at $URL"
|
echo_die "Repository not found: $url_id at $URL"
|
||||||
|
|
||||||
|
@ -400,7 +399,6 @@ ensure_connected()
|
||||||
isnonnull "$manifest_" ||
|
isnonnull "$manifest_" ||
|
||||||
echo_die "Failed to decrypt manifest!"
|
echo_die "Failed to decrypt manifest!"
|
||||||
rm -f "$TmpManifest_Enc"
|
rm -f "$TmpManifest_Enc"
|
||||||
trap - EXIT
|
|
||||||
|
|
||||||
Branchlist=$(xecho "$manifest_" | xgrep -E '^[0-9a-f]{40} ')
|
Branchlist=$(xecho "$manifest_" | xgrep -E '^[0-9a-f]{40} ')
|
||||||
Packlist=$(xecho "$manifest_" | xgrep "^$Packpfx")
|
Packlist=$(xecho "$manifest_" | xgrep "^$Packpfx")
|
||||||
|
@ -529,7 +527,6 @@ do_fetch()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
TmpPack_Encrypted="$Localdir/tmp_pack_ENCRYPTED_.$$"
|
TmpPack_Encrypted="$Localdir/tmp_pack_ENCRYPTED_.$$"
|
||||||
trap 'rm -f "$TmpPack_Encrypted"' EXIT
|
|
||||||
|
|
||||||
premote_=$(xecho "$Packlist" | cut -f 1-2 -d ' ')
|
premote_=$(xecho "$Packlist" | cut -f 1-2 -d ' ')
|
||||||
# The `+` for $GITCEPTION is pointless but we will be safe for stacking
|
# The `+` for $GITCEPTION is pointless but we will be safe for stacking
|
||||||
|
@ -547,7 +544,6 @@ do_fetch()
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -f "$TmpPack_Encrypted"
|
rm -f "$TmpPack_Encrypted"
|
||||||
trap - EXIT
|
|
||||||
echo_git # end with blank line
|
echo_git # end with blank line
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -568,7 +564,6 @@ do_push()
|
||||||
make_new_repo
|
make_new_repo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
trap 'rm -f "$TmpPack_Encrypted" "$TmpObjlist" "$TmpManifest_Enc"' EXIT
|
|
||||||
if isnonnull "$Branchlist"
|
if isnonnull "$Branchlist"
|
||||||
then
|
then
|
||||||
# filter through batch-check to mark only the commits we have
|
# filter through batch-check to mark only the commits we have
|
||||||
|
@ -623,7 +618,7 @@ EOF
|
||||||
echo_info "Participants are: $Signers"
|
echo_info "Participants are: $Signers"
|
||||||
echo_info "Requesting manifest signature"
|
echo_info "Requesting manifest signature"
|
||||||
|
|
||||||
TmpManifest_Enc="$Localdir/manifest.$$"
|
TmpManifest_Enc="$Localdir/tmp_manifest.$$"
|
||||||
|
|
||||||
(xecho "$Branchlist"; xecho "$Packlist"; xecho "$Keeplist";
|
(xecho "$Branchlist"; xecho "$Packlist"; xecho "$Keeplist";
|
||||||
repoidstr; xecho "$Extension_list") |
|
repoidstr; xecho "$Extension_list") |
|
||||||
|
@ -653,7 +648,6 @@ EOF
|
||||||
PUT_FINAL "$URL"
|
PUT_FINAL "$URL"
|
||||||
|
|
||||||
rm -f "$TmpManifest_Enc"
|
rm -f "$TmpManifest_Enc"
|
||||||
trap - EXIT
|
|
||||||
|
|
||||||
# ok all updates
|
# ok all updates
|
||||||
xecho "$1" | while read line_
|
xecho "$1" | while read line_
|
||||||
|
@ -671,6 +665,8 @@ URL=$2 # Remote URL
|
||||||
|
|
||||||
mkdir -p "$Localdir"
|
mkdir -p "$Localdir"
|
||||||
|
|
||||||
|
trap 'rm -f "$Localdir/tmp_"*".$$"' EXIT 1 2 3 15
|
||||||
|
|
||||||
while read Input
|
while read Input
|
||||||
do
|
do
|
||||||
case "$Input" in
|
case "$Input" in
|
||||||
|
|
Loading…
Reference in a new issue