aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss8
1 files changed, 7 insertions, 1 deletions
diff --git a/kiss b/kiss
index e6e5116..c98416c 100755
--- a/kiss
+++ b/kiss
@@ -927,10 +927,16 @@ pkg_remove() {
required_by="$required_by'${file##*/}', "
done
+ [ "$required_by" ] &&
+ die "$1" "Package is required by ${required_by%, }"
+
# Disable globbing.
set -f
- [ "$required_by" ] && die "$1" "Package is required by ${required_by%, }"
+ # Ensure that the user leaves their machine in a working state by
+ # refusing to remove the package which providees 'su'.
+ grep -q "^$(command -v su)$" "$sys_db/$1/manifest" &&
+ die "$1" "Removing su will break the system."
# Block being able to abort the script with 'Ctrl+C' during removal.
# Removes all risk of the user aborting a package removal leaving