summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild30
1 files changed, 30 insertions, 0 deletions
diff --git a/build b/build
new file mode 100755
index 0000000..0c70c8e
--- /dev/null
+++ b/build
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+pkgfilename() (
+ BUILDFILE="$(realpath -ms -- "$1")"
+ . "$BUILDFILE"
+ echo $pkgname-$pkgver-$pkgrel-any.pkg.tar.xz
+)
+
+main() {
+ local src pkg
+ local pkgs=()
+ for src in *.PKGBUILD; do
+ pkg="$(pkgfilename "$src")"
+ while ! { test "$src" -ot "$pkg" && test config.sh -ot "$pkg"; } 2>/dev/null; do
+ makepkg -d -p "$src"
+ pkg="$(pkgfilename "$src")"
+ done
+ pkgs+=("$pkg")
+ done
+
+ for pkg in "${pkgs[@]}"; do
+ if test "$pkg" -nt config.db.tar.gz; then
+ rm -f config.{db,files}{,.tar.gz}
+ repo-add config.db.tar.gz "${pkgs[@]}"
+ return
+ fi
+ done
+}
+
+main "$@"