summaryrefslogtreecommitdiff
path: root/abump.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-11-19 10:24:15 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-11-19 10:24:15 +0000
commite1ebd05ce69e4c53d43e9ff85127a106a1853a75 (patch)
tree80d99ffbe79f752888547a165007be37d796d247 /abump.in
parent9aeef85a03ed6479192fa3e111b02968d957d9c3 (diff)
downloadabuild-e1ebd05ce69e4c53d43e9ff85127a106a1853a75.tar.gz
abuild-e1ebd05ce69e4c53d43e9ff85127a106a1853a75.tar.bz2
abuild-e1ebd05ce69e4c53d43e9ff85127a106a1853a75.tar.xz
abuild-e1ebd05ce69e4c53d43e9ff85127a106a1853a75.zip
abump: install with make install
Diffstat (limited to 'abump.in')
-rwxr-xr-xabump.in40
1 files changed, 40 insertions, 0 deletions
diff --git a/abump.in b/abump.in
new file mode 100755
index 0000000..f000f48
--- /dev/null
+++ b/abump.in
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+die() {
+ echo "$@" >&2
+ exit 1
+}
+
+# version bump a pkg
+
+do_bump() {
+ pkgname=${1%-[0-9]*}
+ pkgver=${1#${pkgname}-}
+
+ APORTS=$HOME/aports
+
+ set -e
+
+ cd $APORTS/*/$pkgname
+ section=${PWD%/*}
+ section=${section##*/}
+
+ msg="$section/$pkgname: upgrade to $pkgver"
+ echo "$msg"
+
+ ( . ./APKBUILD; type package | grep -q function ) || die "package() missing"
+
+ sed -i -e "s/^pkgver=.*/pkgver=$pkgver/" \
+ -e "s/^pkgrel=.*/pkgrel=0/" \
+ APKBUILD
+
+ abuild -r checksum all || exit 1
+
+ git add APKBUILD
+ git commit -m"$msg"
+}
+
+while [ $# -gt 0 ]; do
+ ( do_bump "$1" ) || exit 1
+ shift
+done