diff --git a/.util.sh b/.util.sh index be51f97..1f53765 100644 --- a/.util.sh +++ b/.util.sh @@ -1,7 +1,7 @@ #!/bin/bash update_github_tag() { - ver=$(curl -Ls https://api.github.com/repos/"$1"/tags | jq -r '[.[] | select(.name | index("rc") | not) | select (.name | index("dev") | not)] | first | .name' | cut -c2-) + local ver=$(curl -Ls https://api.github.com/repos/"$1"/tags | jq -r '[.[] | select(.name | index("rc") | not) | select (.name | index("dev") | not)] | first | .name' | cut -c2-) echo "${ver}" | grep -Eq "^(\w|\+|\.)+$" && sed -i "s/pkgver=.*/pkgver=${ver}/" PKGBUILD } @@ -12,7 +12,7 @@ update_pkg() { if updpkgsums; then makepkg --printsrcinfo >.SRCINFO - ver=$(grep 'pkgver' .SRCINFO | cut -d'=' -f2 | tr -d ' ') + local ver=$(grep 'pkgver' .SRCINFO | cut -d'=' -f2 | tr -d ' ') git add .SRCINFO PKGBUILD if git commit -m "$(basename $(pwd)): update to ${ver} [CI SKIP]"; then git push --set-upstream origin "${CI_COMMIT_BRANCH}" diff --git a/build.sh b/build.sh index 25cfbf3..cdc6a2b 100755 --- a/build.sh +++ b/build.sh @@ -5,15 +5,19 @@ build() { + local upd=$1 + if grep -c 'git+' PKGBUILD >/dev/null && ! grep -c '#tag=' PKGBUILD >/dev/null; then makepkg --nodeps --nobuild --skippgpcheck --noconfirm - update_pkg + 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 ' ') rel=$(grep 'pkgrel' .SRCINFO | cut -d'=' -f2 | tr -d ' ') epoch=$(grep 'epoch' .SRCINFO | cut -d'=' -f2 | tr -d ' ') - if [ -n "${epoch}" ]; then + if [[ -n "${epoch}" ]]; then epoch=${epoch}: fi @@ -53,7 +57,7 @@ for d in */; do fi fi - build + build true fi cd .. done @@ -61,7 +65,7 @@ done while read -r p; do git clone https://aur.archlinux.org/"${p}".git || continue cd "${p}" || continue - build + build false cd .. done