aboutsummaryrefslogtreecommitdiff
path: root/apkg-purge
diff options
context:
space:
mode:
Diffstat (limited to 'apkg-purge')
-rwxr-xr-xapkg-purge6
1 files changed, 3 insertions, 3 deletions
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