Skip to content

Commit

Permalink
aur: generate .SRCINFO only if there are changes to commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ppacher committed Aug 8, 2022
1 parent 45c59c2 commit 842ae82
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions linux/release_to_aur.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ set -e
target="/tmp/portmaster-stub-bin"

group "Cloning AUR repository to /tmp/portmaster-stub-bin"
git init "${target}"
# git clone ssh://aur@aur.archlinux.org/portmaster-stub-bin.git "${target}"
git clone ssh://aur@aur.archlinux.org/portmaster-stub-bin.git "${target}"
endgroup

group "Copying files to AUR repository"
Expand All @@ -28,16 +27,19 @@ group "Copying files to AUR repository"
done
endgroup

group "Generating .SRCINFO"
docker run --rm -v "$(pwd):/workspace" -w /workspace -u 1000 archlinux:latest makepkg --printsrcinfo > "${target}/.SRCINFO"
endgroup

cd "${target}"
if [[ `git status --porcelain` ]]; then
# we only generate a new .SRCINFO file if we have actual changes to the AUR repo
# that we want to publish.
group "Generating .SRCINFO"
docker run --rm -v "$(pwd):/workspace" -w /workspace -u 1000 archlinux:latest makepkg --printsrcinfo > "${target}/.SRCINFO"
endgroup

group "Commiting and pushing to AUR"
git add .
git commit -m "${GITHUB_COMMIT_MESSAGE}"
git push
# git push
git log
endgroup
else
info "No changes detected, aborting"
Expand Down

0 comments on commit 842ae82

Please sign in to comment.