diff --git a/.util.sh b/.util.sh new file mode 100644 index 0000000..95a7ac2 --- /dev/null +++ b/.util.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +update_pkg() { + + updpkgsums > /dev/null 2>&1 + + if [ $? -eq 0 ] + then + makepkg --printsrcinfo > .SRCINFO + git add .SRCINFO PKGBUILD + git commit -m "$(basename $(pwd)): update to $ver" > /dev/null 2>&1 + if [ $? -eq 0 ] + then + git push + fi + fi + +} diff --git a/drone/update.sh b/drone/update.sh new file mode 100755 index 0000000..a464a90 --- /dev/null +++ b/drone/update.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +source ../.util.sh + +ver=`curl -s https://api.github.com/repos/drone/drone/tags | jq -r '.[0].name' | cut -c2-` +echo $ver +sed -i "s/pkgver=.*/pkgver=${ver}/" PKGBUILD + +update_pkg