fix: build sh
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
nyyu 2023-04-09 09:51:46 +02:00
parent 2d61203a51
commit e48dbb9ab8
2 changed files with 14 additions and 9 deletions

View File

@ -7,7 +7,7 @@ update_github_tag() {
update_pkg() {
if [ $(git diff . | wc -l) -ne 0 ]; then
if [[ $(git diff . | wc -l) -ne 0 ]]; then
sed -i 's/pkgrel=.*/pkgrel=1/' PKGBUILD
if updpkgsums; then

View File

@ -1,12 +1,17 @@
#!/bin/bash
# shellcheck disable=SC3044,SC3009
# shellcheck disable=SC3044,SC3009,SC2312
. .util.sh
build() {
local upd=$1
if grep -c 'git+' PKGBUILD >/dev/null && ! grep -c '#tag=' PKGBUILD >/dev/null; then
makepkg --noprepare --nodeps --nobuild --skippgpcheck --noconfirm
makepkg --printsrcinfo >.SRCINFO
if [[ "${upd}" = true ]]; then
update_pkg
fi
fi
name=$(grep -m1 'pkgname' .SRCINFO | cut -d'=' -f2 | tr -d ' ')
ver=$(grep 'pkgver' .SRCINFO | cut -d'=' -f2 | tr -d ' ')
@ -40,20 +45,20 @@ git config credential.helper '!f() { sleep 1; echo "username=drone"; echo "passw
for d in */; do
cd "${d}" || continue
if [ -f PKGBUILD ]; then
if [[ -f PKGBUILD ]]; then
echo "--> ${d}"
if [ -f update.sh ]; then
if [[ -f update.sh ]]; then
./update.sh
fi
if ! grep -c 'pkgver()' PKGBUILD >/dev/null; then
repo=$(grep -oPm 1 'github\.com\/\K(\w|-)+\/(\w|-)+' .SRCINFO)
if [ -n "${repo}" ]; then
if [[ -n "${repo}" ]]; then
update_github_tag "${repo}"
fi
fi
update_pkg
build
build true
fi
cd ..
done
@ -61,12 +66,12 @@ done
while read -r p; do
git clone https://aur.archlinux.org/"${p}".git || continue
cd "${p}" || continue
build
build false
cd ..
done <aur.txt
del=$(git --no-pager diff ${CI_PREV_COMMIT_SHA}..HEAD aur.txt | tail -n +4 | grep -E '^-' | cut -c2-)
if [ -n "${del}" ]; then
if [[ -n "${del}" ]]; then
# shellcheck disable=SC2086
repo-remove -s /repo/nyyu.db.tar.zst ${del} || true
fi