aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-07-04 15:32:53 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-07-04 15:32:53 +0000
commit199482be58e2ad0edc8b7eaba7916c0ab4d2837d (patch)
tree8ccbc6cfdf3b61e5da3dfe93fe8fd7eb117ed734 /kiss
parent8146678ed376c26e57352b01478f9a9d30417e8a (diff)
downloadcpt-199482be58e2ad0edc8b7eaba7916c0ab4d2837d.tar.gz
kiss: Block Ctrl+C during removal.
FossilOrigin-Name: 40d0609d468be5f9973c912368d7a62004ef389fd9f42be00ea05cdc1d8ea029
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss9
1 files changed, 9 insertions, 0 deletions
diff --git a/kiss b/kiss
index 3142b87..3e9649f 100755
--- a/kiss
+++ b/kiss
@@ -583,6 +583,11 @@ pkg_remove() {
die "[$1]: Package is required by ${required_by%, }." \
"[$1]: Aborting here..."
+ # Block being able to abort the script with 'Ctrl+C' during installation.
+ # Removes all risk of the user aborting a package installation leaving
+ # an incomplete package installed.
+ trap '' INT
+
while read -r file; do
# The file is in '/etc' skip it. This prevents the package
# manager from removing user edited configuration files.
@@ -596,6 +601,10 @@ pkg_remove() {
fi
done < "$KISS_ROOT/var/db/kiss/$1/manifest"
+ # Reset 'trap' to its original value. Installation is done so
+ # we no longer need to block 'Ctrl+C'.
+ trap pkg_clean EXIT INT
+
log "[$1]: Removed successfully."
}