mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-24 16:10:05 -07:00
kiss: Block Ctrl+C during removal.
This commit is contained in:
parent
55c1ea682b
commit
da0f1fd203
9
kiss
9
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."
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user