aboutsummaryrefslogtreecommitdiff
path: root/apkg
diff options
context:
space:
mode:
authoremmett1 <emmett1.2miligrams@protonmail.com>2024-06-12 23:37:45 +0800
committeremmett1 <emmett1.2miligrams@protonmail.com>2024-06-12 23:37:45 +0800
commitdfd4934a783d991b31063171f9e454a218e431b1 (patch)
treea43138940b7efbb5a28e9797d87b0349aaf20685 /apkg
parentb52a73a431aec49e791b1a03be38bb8d643751db (diff)
downloadautils-dfd4934a783d991b31063171f9e454a218e431b1.tar.gz
autils-dfd4934a783d991b31063171f9e454a218e431b1.zip
updates and added apkg-chroot and apkg-orphan
Diffstat (limited to 'apkg')
-rwxr-xr-xapkg29
1 files changed, 14 insertions, 15 deletions
diff --git a/apkg b/apkg
index 21b9a6d..b9abb9a 100755
--- a/apkg
+++ b/apkg
@@ -235,21 +235,21 @@ build_src() {
if [ ! "$source" ]; then
# dummy pkg
mkdir -p $PKG/usr
- elif [ -s $HERE/build ]; then
- sh -e -x $HERE/build
+ elif [ "$(command -v build)" ]; then
+ (set -e -x; build)
buildstatus build
else
- if [ -s $HERE/prebuild ]; then
- sh -e -x $HERE/prebuild
+ if [ "$(command -v prebuild)" ]; then
+ (set -e -x; prebuild)
buildstatus prebuild
fi
if [ ! "${build_type}" ]; then
detect_buildtype
fi
(set -e -x; _${build_type})
- buildstatus _${build_type}
- if [ -s $HERE/postbuild ]; then
- sh -e -x $HERE/postbuild
+ buildstatus ${build_type}
+ if [ "$(command -v postbuild)" ]; then
+ (set -e -x; postbuild)
buildstatus postbuild
fi
fi
@@ -348,7 +348,7 @@ build_src() {
exit 1
}
- if [ ! -f "$HERE"/.files ] || [ "$HERE"/info -nt "$HERE"/.files ]; then
+ if [ ! -f "$HERE"/.files ] || [ "$HERE"/abuild -nt "$HERE"/.files ]; then
pkg_updatefiles
fi
@@ -367,7 +367,7 @@ pkg_updatefiles() {
pkg_path() {
for r in $APKG_REPO; do
- [ -f $r/$1/info ] && {
+ [ -f $r/$1/abuild ] && {
echo $r/$1
break
}
@@ -434,7 +434,7 @@ pkg_depends() {
pkg_outdate() {
spm -a | while read -r n v; do
[ "$(pkg_path $n)" ] || continue
- nv="$(grep ^version= $(pkg_path $n)/info | awk -F = '{print $2}')-$(grep ^release= $(pkg_path $n)/info | awk -F = '{print $2}')"
+ nv="$(grep ^version= $(pkg_path $n)/abuild | awk -F = '{print $2}')-$(grep ^release= $(pkg_path $n)/abuild | awk -F = '{print $2}')"
[ "$nv" ] || continue
[ "$v" = "$nv" ] || echo "$n $v -> $nv"
done
@@ -478,7 +478,7 @@ pkg_search() {
exit 1
fi
[ "$1" ] && grep=grep || grep=cat
- find $APKG_REPO -type f -name info 2>/dev/null | sed 's|/info||' | rev | awk -F / '{print $1}' | rev | $grep $1
+ find $APKG_REPO -type f -name abuild 2>/dev/null | sed 's|/abuild||' | rev | awk -F / '{print $1}' | rev | $grep $1
}
pkg_depinstalll() {
@@ -642,12 +642,12 @@ main() {
exit 0
fi
- if [ ! -f ./info ]; then
- msg "'info' not found."
+ if [ ! -f ./abuild ]; then
+ msg "'abuild' not found."
exit 1
fi
- . ./info
+ . ./abuild
[ "$name" ] || die "name is empty"
[ "$version" ] || die "version is empty"
[ "$release" ] || die "release is empty"
@@ -655,7 +655,6 @@ main() {
msg "'name' should be same as package directory name (${PWD##*/})."
exit 1
}
- export name version release
packagefile=$APKG_PACKAGE_DIR/$name#$version-$release.spm