mirror of
https://github.com/archlinux/aur.git
synced 2026-03-14 23:16:48 +01:00
Add update.sh
This commit is contained in:
parent
d5dbaff015
commit
c7ff4410c2
2 changed files with 28 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -3,3 +3,5 @@
|
|||
|
||||
!PKGBUILD
|
||||
!.SRCINFO
|
||||
|
||||
!update.sh
|
||||
|
|
|
|||
26
update.sh
Executable file
26
update.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
echo "Working directory not clean"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -r -d "\n" TAG_NAME RELEASE_NAME <<< "$(curl -sSf "https://api.github.com/repos/ruffle-rs/ruffle/releases?per_page=1" | jq -r ".[0] | .tag_name, .name")" || true
|
||||
|
||||
sed -e "s/^pkgver=.*/pkgver=${TAG_NAME//-/.}/" \
|
||||
-e "s/^pkgrel=.*/pkgrel=1/" \
|
||||
-i PKGBUILD
|
||||
|
||||
if [ -z "$(git status --porcelain)" ]; then
|
||||
echo "Nothing to do"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Updating to $RELEASE_NAME..."
|
||||
updpkgsums
|
||||
makepkg --printsrcinfo > .SRCINFO
|
||||
git commit -am "Update to $RELEASE_NAME"
|
||||
Loading…
Add table
Reference in a new issue