summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbumpVersion38
1 files changed, 38 insertions, 0 deletions
diff --git a/bumpVersion b/bumpVersion
new file mode 100755
index 000000000..e2e1a80f0
--- /dev/null
+++ b/bumpVersion
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+if [ $# -ne 1 ]
+then
+ err=0
+ for pkg in "$@"
+ do
+ $0 "${pkg}"
+ cErr=$?
+ [ ${cErr} -gt ${err} ] && err=${cErr}
+ done
+ exit ${err}
+fi
+
+cd "$(dirname "$(readlink -f "$0")")"
+[ -r "$1/PKGBUILD" ] || exit 1
+eval $(./checkVersions -m "$1")
+if [ "${remVer}" == "${pkgver}" ]
+then
+ exit 0
+fi
+
+cd "$1"
+# sed ':begin;$!N;s@^\s*\(sha[[:digit:]]\+sums=\|md5sums=\)\([^)]*\)\n\(.*\)$@sha512sums=\2 \3@;tbegin;P;D' PKGBUILD
+sed 's|pkgver=.*$|pkgver='"${remVer}"'|;
+ s|pkgrel=.*$|pkgrel=1|;
+ :begin;
+ $!N;s@^\s*\(sha[[:digit:]]\+sums=\|md5sums=\)\([^)]*\)\n\(.*\)$@sha512sums=\2 \3@;
+ tbegin;
+ P;
+ D
+' -i PKGBUILD
+summen="$(makepkg -g)"
+sed 's|sha512sums=.*$|'"${summen}"'|' -i PKGBUILD
+
+rm -rf pkg src
+sudo pacman -Sy
+makepkg -fcsr