diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2023-08-08 07:51:43 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2023-08-08 07:51:43 -0700 |
commit | 231c9cfb0b64c3c566d89f0cd1ae5b0b124a9f25 (patch) | |
tree | 4c73ef6029204f7dfb30d70687aad8f8e3b12213 /create-squashfs-snapshot | |
parent | snapshots-create.sh: hopefully make this script entirely quiet for normal runs (diff) | |
download | mastermirror-scripts-231c9cfb0b64c3c566d89f0cd1ae5b0b124a9f25.tar.gz mastermirror-scripts-231c9cfb0b64c3c566d89f0cd1ae5b0b124a9f25.tar.bz2 mastermirror-scripts-231c9cfb0b64c3c566d89f0cd1ae5b0b124a9f25.zip |
*: fix trap calls to ensure call on regular exit and errors20230808T145156Z
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'create-squashfs-snapshot')
-rwxr-xr-x | create-squashfs-snapshot | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/create-squashfs-snapshot b/create-squashfs-snapshot index 1579877..4fc35ff 100755 --- a/create-squashfs-snapshot +++ b/create-squashfs-snapshot @@ -69,8 +69,8 @@ reponame=$(<"${repodir}"/profiles/repo_name) [[ ${reponame} ]] tempdir=$(mktemp -d) - -trap 'rm -r "${tempdir}"' EXIT +[[ -z $tempdir ]] && echo "Failed to create tempdir" 1>&2 && exit 97 +trap 'rm -rf "${tempdir}"' SIGINT SIGTERM EXIT # Build exclusion list EXCLUSION_LIST="$(mktemp -p "${tempdir}" squashfs-exclude.XXXXXXXXXX)" |