aur/build.sh
nyyu 92fa34c928
All checks were successful
continuous-integration/drone/push Build is passing
test
2021-12-05 22:40:18 +01:00

52 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
build() {
if [ -f "update.sh" ]; then
./update.sh
fi
if grep -c 'git+' PKGBUILD > /dev/null ; then
makepkg --nodeps --nobuild --skippgpcheck --noconfirm
fi
makepkg --printsrcinfo > .SRCINFO
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
}
env
git config --global user.email "drone@nyyu.dev"
git config --global user.name "drone"
git remote set-url origin $DRONE_GIT_HTTP_URL
for d in */ ; do
cd "$d" || continue
sudo pacman -S core/binutils
build
cd ..
done
while read -r p; do
git clone https://aur.archlinux.org/"$p".git || continue
cd "$p" || continue
build
cd ..
done <aur.txt
repo-remove -s /repo/nyyu.db.tar.zst $(git --no-pager diff HEAD~$DRONE_COMMIT_BEFORE aur.txt | tail -n +4 | grep -E '^-' | cut -c2-)