From e388eb1467c94b0d98acc7d81a2c3e7c99dce67f Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 6 Apr 2010 06:56:33 +0000
Subject: [PATCH] abump: small utility to maintain aports

---
 abump | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100755 abump

diff --git a/abump b/abump
new file mode 100755
index 000000000000..f000f483b23e
--- /dev/null
+++ b/abump
@@ -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
-- 
GitLab