summarylogtreecommitdiffstats
path: root/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update.sh')
-rwxr-xr-xupdate.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/update.sh b/update.sh
new file mode 100755
index 000000000000..3e913e8dbaee
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+latest_version=$(source ./PKGBUILD && rm -rf ${_pkgname} && url=$(echo ${source[0]} | sed "s/${_pkgname}::git+//") && git clone ${url} $_pkgname && pkgver)
+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
+else
+ echo Nothing to update.
+fi