mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-25 00:20:05 -07:00
kiss: Block Ctrl+C during package install.
This commit is contained in:
parent
2821cc1dd8
commit
b0504511bf
11
kiss
11
kiss
@ -665,6 +665,11 @@ pkg_install() {
|
||||
cp "$(command -v mkdir)" "$cac_dir"
|
||||
cp "$(command -v find)" "$cac_dir"
|
||||
|
||||
# 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
|
||||
|
||||
log "[$pkg_name]: Removing previous version of package if it exists."
|
||||
pkg_remove "$pkg_name"
|
||||
log "[$pkg_name]: Installing package..."
|
||||
@ -689,9 +694,13 @@ pkg_install() {
|
||||
[ -f "$KISS_ROOT/${rpath%/*}/${file##*/}" ] &&
|
||||
return
|
||||
|
||||
"$cac_dir/mv" "$file" "$KISS_ROOT/${rpath%/*}"
|
||||
"$cac_dir/mv" "$file" "$KISS_ROOT/${rpath%/*}" ||:
|
||||
done
|
||||
|
||||
# Reset 'trap' to its original value. Installation is done so
|
||||
# we no longer need to block 'Ctrl+C'.
|
||||
trap pkg_clean EXIT INT
|
||||
|
||||
# Run the post install script and suppress errors. If it exists,
|
||||
# it will run, else nothing will happen.
|
||||
"$KISS_ROOT/var/db/kiss/$pkg_name/post-install" 2>/dev/null ||:
|
||||
|
Loading…
Reference in New Issue
Block a user