upgpkg: webapp v0.0.5
add: upgpkg script
This commit is contained in:
parent
69b2e94903
commit
a5ba799d2e
2 changed files with 54 additions and 2 deletions
52
updpkg.sh
Executable file
52
updpkg.sh
Executable file
|
@ -0,0 +1,52 @@
|
||||||
|
#!/usr/bin/sh
|
||||||
|
|
||||||
|
function get_latest_version()
|
||||||
|
{
|
||||||
|
repo=$1
|
||||||
|
prefix="v"
|
||||||
|
[ -n "$2" ] && prefix="$2-v"
|
||||||
|
|
||||||
|
releases_json=$(curl -sfX GET "https://git.serguzim.me/api/v1/repos/emgauwa/$repo/releases" -H "accept: application/json")
|
||||||
|
[ $? -ne 0 ] && echo "v0.0.0" && exit
|
||||||
|
|
||||||
|
tags=$(echo $releases_json | jq -r ".[] | select(.tag_name | test(\"$prefix*\")).tag_name")
|
||||||
|
|
||||||
|
latest_version="0.0.0"
|
||||||
|
|
||||||
|
for tag in $tags; do
|
||||||
|
version=$(echo $tag | sed "s/^$prefix//")
|
||||||
|
[ $(vercmp $version $latest_version) -gt 0 ] && latest_version=$version
|
||||||
|
done
|
||||||
|
|
||||||
|
echo $latest_version
|
||||||
|
}
|
||||||
|
|
||||||
|
cd core
|
||||||
|
latest_version=$(get_latest_version core)
|
||||||
|
sed -i "s/pkgver=.*$/pkgver=$latest_version/" PKGBUILD
|
||||||
|
updpkgsums
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd core-testing
|
||||||
|
latest_version=$(get_latest_version core testing)
|
||||||
|
sed -i "s/pkgver=.*$/pkgver=$latest_version/" PKGBUILD
|
||||||
|
updpkgsums
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd controller
|
||||||
|
latest_version=$(get_latest_version controller)
|
||||||
|
sed -i "s/pkgver=.*$/pkgver=$latest_version/" PKGBUILD
|
||||||
|
updpkgsums
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd controller-testing
|
||||||
|
latest_version=$(get_latest_version controller testing)
|
||||||
|
sed -i "s/pkgver=.*$/pkgver=$latest_version/" PKGBUILD
|
||||||
|
updpkgsums
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
cd webapp
|
||||||
|
latest_version=$(get_latest_version client)
|
||||||
|
sed -i "s/pkgver=.*$/pkgver=$latest_version/" PKGBUILD
|
||||||
|
updpkgsums
|
||||||
|
cd ..
|
|
@ -1,6 +1,6 @@
|
||||||
# Maintainer: Tobias Reisinger <tobias@msrg.cc>
|
# Maintainer: Tobias Reisinger <tobias@msrg.cc>
|
||||||
pkgname=emgauwa-webapp
|
pkgname=emgauwa-webapp
|
||||||
pkgver=0.0.4
|
pkgver=0.0.5
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
epoch=
|
epoch=
|
||||||
pkgdesc=""
|
pkgdesc=""
|
||||||
|
@ -9,7 +9,7 @@ url="https://git.serguzim.me/emgauwa/client"
|
||||||
license=('unknown')
|
license=('unknown')
|
||||||
groups=()
|
groups=()
|
||||||
source=("$pkgname-$pkgver.tar.gz::https://git.serguzim.me/emgauwa/client/releases/download/v$pkgver/emgauwa.tar.gz")
|
source=("$pkgname-$pkgver.tar.gz::https://git.serguzim.me/emgauwa/client/releases/download/v$pkgver/emgauwa.tar.gz")
|
||||||
sha256sums=('ea35a25a30159c63506d302411b1ef5d9cff43eb9081fd9a38e4d1c46e66f7f3')
|
sha256sums=('d98ae89bf2e122a33b66fc22c28a16a7652f1d0a33cffa81306527071582e9e3')
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
# install project
|
# install project
|
||||||
|
|
Reference in a new issue