aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xapkg9
-rwxr-xr-xapkg-purge6
-rwxr-xr-xrevdep2
3 files changed, 7 insertions, 10 deletions
diff --git a/apkg b/apkg
index 3debe15..2c4c363 100755
--- a/apkg
+++ b/apkg
@@ -5,8 +5,7 @@
# \ \_\ \_\\ \_\ \ \_\ \_\\ \_____\
# \/_/\/_/ \/_/ \/_/\/_/ \/_____/
#
-# APKG - Alice Package Manager
-# (C) Emmett1
+# APKG - Alice Package Manager (C) 2023-2025 Emmett1
#
fetch_src() {
@@ -370,10 +369,8 @@ build_src() {
ret 1
fi
- cd $APKG_PACKAGE_DIR
- spm -b $PKG && {
- mv package.spm $packagefile
- } || {
+ cd $PKG
+ spm -b $packagefile || {
msg "Failed packaging $packagefile"
ret 1
}
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
diff --git a/revdep b/revdep
index f0ae5f9..3418264 100755
--- a/revdep
+++ b/revdep
@@ -46,7 +46,7 @@ while read -r line; do
if [ "$verbose" ]; then
echo " $ownby: $line (requires $i)"
else
- echo "$p" | tr ' ' '\n' | grep -xq $ownby || {
+ [ "$(echo "$p" | tr ' ' '\n' | grep -x $ownby)" ] || {
echo $ownby
p="$p $ownby"
}