pkgmeek: added interrupt() to handle SIGTERM and SIGHUP
This commit is contained in:
parent
71ad099fef
commit
eeddae981c
@ -548,6 +548,10 @@ refresh_signature() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interrupted() {
|
||||||
|
error "Interrupted."; cleanup_work; exit 1
|
||||||
|
}
|
||||||
|
|
||||||
cleanup_work() {
|
cleanup_work() {
|
||||||
[ "$PKGMK_KEEP_WORK" = "yes" ] || { cd "$PKGMK_ROOT"; rm -rf "$work"; }
|
[ "$PKGMK_KEEP_WORK" = "yes" ] || { cd "$PKGMK_ROOT"; rm -rf "$work"; }
|
||||||
}
|
}
|
||||||
@ -585,5 +589,6 @@ readonly -f main info warning error print_help parse_options validate_pkgfile \
|
|||||||
check_reqvars check_pkg_mtime fetch_url cat_manifest check_manifest \
|
check_reqvars check_pkg_mtime fetch_url cat_manifest check_manifest \
|
||||||
cat_signature check_signature parse_signify_output refresh_signature \
|
cat_signature check_signature parse_signify_output refresh_signature \
|
||||||
cleanup_work recursive
|
cleanup_work recursive
|
||||||
|
trap "interrupted" SIGHUP SIGINT SIGQUIT SIGTERM
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user