#!/bin/bash . .util.sh build() { if grep -c 'git+' PKGBUILD >/dev/null && ! grep -c '#tag=' PKGBUILD >/dev/null; then makepkg --nodeps --nobuild --skippgpcheck --noconfirm makepkg --printsrcinfo >.SRCINFO fi name=$(grep -m1 'pkgname' .SRCINFO | cut -d'=' -f2 | tr -d ' ') ver=$(grep 'pkgver' .SRCINFO | cut -d'=' -f2 | tr -d ' ') rel=$(grep 'pkgrel' .SRCINFO | cut -d'=' -f2 | tr -d ' ') epoch=$(grep 'epoch' .SRCINFO | cut -d'=' -f2 | tr -d ' ') if [ -n "${epoch}" ]; then epoch=${epoch}: fi if ! compgen -G "/repo/${name}-${epoch}${ver}-${rel}-*.pkg.tar.zst" >/dev/null; then if makepkg -s --skippgpcheck --noconfirm --sign || makepkg -s --skippgpcheck --nocheck --noconfirm --sign; then for pkg in *.pkg.tar.zst; do cp "${pkg}"{,.sig} /repo/ repo-add -R -s /repo/nyyu.db.tar.zst /repo/"${pkg}" done sudo pacman -Sy fi fi } git config user.email "drone@nyyu.dev" git config user.name "drone" git remote set-url origin "${DRONE_GIT_HTTP_URL}" git config credential.helper '!f() { sleep 1; echo "username=drone"; echo "password=${GIT_PASSWORD}"; }; f' for d in */; do cd "${d}" || continue if [ -f PKGBUILD ]; then echo "--> ${d}" if [ -f update.sh ]; then ./update.sh fi if ! grep -c 'pkgver()' PKGBUILD >/dev/null; then repo=$(grep -oPm 1 'github\.com\/\K([a-z0-9]|-)+\/([a-z0-9]|-)+' .SRCINFO) if [ -n "${repo}" ]; then update_github_tag "${repo}" && update_pkg fi fi build fi cd .. done while read -r p; do git clone https://aur.archlinux.org/"${p}".git || continue cd "${p}" || continue build cd .. done