summarylogtreecommitdiffstats
path: root/update.sh
diff options
context:
space:
mode:
authorFernando Ortiz2020-03-19 11:51:29 -0500
committerFernando Ortiz2020-03-19 11:51:29 -0500
commit2155f1b7a9a4002f1aad599e47bf759def2008db (patch)
tree8952ed0ea9f8dcd14ffe73435611ec062d247fc9 /update.sh
parente7c9d61dc6089022de128452dd726e1d63b73261 (diff)
downloadaur-2155f1b7a9a4002f1aad599e47bf759def2008db.tar.gz
Version 2.1.0
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/update.sh b/update.sh
new file mode 100755
index 000000000000..ff5d2422df42
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+
+latest_version=$1
+current_version=$(cat PKGBUILD | grep pkgver= | awk -F'=' '{print $2}')
+
+if ! [ "$latest_version" = "$current_version" ]; then
+ echo Updating the package with the latest version
+ echo latest: $latest_version
+ echo current: $current_version
+ sed -i.bak "s/$current_version/$latest_version/g" PKGBUILD
+ sed -i.bak "s/pkgrel=[^d.]/pkgrel=1/g" PKGBUILD
+ ./pkgsum.sh
+ if which makepkg &> /dev/null; then
+ makepkg --printsrcinfo > .SRCINFO
+ else
+ mksrcinfo
+ fi
+ rm -f *.bak
+else
+ echo Nothing to update.
+fi