From 0737b5af9c3d7d4bf97b94b1a2ceff36ac938002 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Thu, 1 May 2025 17:39:15 +0800 Subject: updated --- apkg-purge | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apkg-purge') diff --git a/apkg-purge b/apkg-purge index a991715..1f7c73c 100755 --- a/apkg-purge +++ b/apkg-purge @@ -4,7 +4,7 @@ purge() { for j in $(apkg -j $1); do - apkg -a | grep -qx $j && { + [ "$(apkg -a ^$j$)" ] && { echo "[$1] dependent package is installed: $j" error=1 } @@ -12,10 +12,10 @@ purge() { [ "$error" ] && return 1 for i in $(apkg -d $1); do - apkg -a | grep -qx $i || continue + [ "$(apkg -a ^$i$)" ] || continue for d in $(apkg -j $i); do [ "$d" = "$1" ] && continue - apkg -a | grep -qx $d && continue 2 + [ "$(apkg -a ^$d$)" ] && continue 2 done if [ "$purgeit" ]; then spm -r $i -- cgit v1.2.3