diff options
Diffstat (limited to 'build')
-rwxr-xr-x | build | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -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 "$@" |