summaryrefslogtreecommitdiff
path: root/bumpPkgrel
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-12 09:14:17 +0100
committerErich Eckner <git@eckner.net>2019-02-12 09:14:17 +0100
commitebb987535050f398ea8210d8cc21dd40bf329d3c (patch)
treeccdd042e72d8323f37bb334dbf8ced7ffbc21420 /bumpPkgrel
parent14fa5725ab09d2246e55429f4862f2f0187912ac (diff)
downloadarchlinuxewe-ebb987535050f398ea8210d8cc21dd40bf329d3c.tar.xz
bumpPkgrel neu
Diffstat (limited to 'bumpPkgrel')
-rwxr-xr-xbumpPkgrel35
1 files changed, 35 insertions, 0 deletions
diff --git a/bumpPkgrel b/bumpPkgrel
new file mode 100755
index 000000000..d58de5041
--- /dev/null
+++ b/bumpPkgrel
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+if [ $# -eq 0 ]; then
+ >&2 echo 'usage: bumpPkgrel [-n] $pkg1 $pkg2 $pkg3 ...'
+ exit 1
+fi
+
+if [ "x$1" = 'x-n' ]; then
+ commit=false
+ shift
+else
+ commit=true
+fi
+
+if [ $# -eq 1 ]; then
+
+ cd "$(dirname "$0")"
+
+ pkg="${1%/}"
+ eval "$(
+ grep '^pkgrel=' "${pkg}/PKGBUILD"
+ )"
+ sed -i '
+ s@^\(pkgrel=\)\('"'"'\?\)[0-9]\+\2$@\1'"'$((pkgrel+1))'"'@
+ ' "${pkg}/PKGBUILD"
+ if ${commit}; then
+ git commit "${pkg}/PKGBUILD" -m "${pkg}: rebuild"
+ fi
+
+else
+
+ printf '%s\n' "$@" \
+ | xargs -rn1 "$0"
+
+fi