aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss18
1 files changed, 5 insertions, 13 deletions
diff --git a/kiss b/kiss
index e502437..d76b9d0 100755
--- a/kiss
+++ b/kiss
@@ -1036,21 +1036,13 @@ pkg_remove() {
# overwritten.
pkg_list "$1" >/dev/null || return
- set +f
-
# Make sure that nothing depends on this package.
- [ "$2" = check ] && for file in "$sys_db/"*; do
- # Check each depends file for the package and if it's
- # a run-time dependency, append to the $required_by string.
- "$grep" -qFx "$1" "$file/depends" 2>/dev/null &&
- required_by="$required_by'${file##*/}', "
- done
-
- [ "$required_by" ] &&
- die "$1" "Package is required by ${required_by%, }"
-
- set -f
+ [ "$KISS_FORCE" = 1 ] || {
+ log "$1" "Checking for reverse dependencies"
+ (cd "$sys_db"; set +f; grep -lFx "$1" -- */depends) &&
+ die "$1" "Can't remove package, others depend on it"
+ }
# Block being able to abort the script with 'Ctrl+C' during removal.
# Removes all risk of the user aborting a package removal leaving
# an incomplete package installed.