summaryrefslogtreecommitdiffstats
path: root/abump.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-11-19 10:25:15 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-11-19 10:25:15 +0000
commitc016772849a1bc03d8ee4ef354c00cac34695735 (patch)
tree1be64f0f9fa493e40c00222b6a11239e8a1c1498 /abump.in
parente1ebd05ce69e4c53d43e9ff85127a106a1853a75 (diff)
downloadabuild-c016772849a1bc03d8ee4ef354c00cac34695735.tar.bz2
abuild-c016772849a1bc03d8ee4ef354c00cac34695735.tar.xz
abump: add usage and support for recursive abuild
Diffstat (limited to 'abump.in')
-rwxr-xr-xabump.in25
1 files changed, 23 insertions, 2 deletions
diff --git a/abump.in b/abump.in
index f000f48..6675af5 100755
--- a/abump.in
+++ b/abump.in
@@ -1,5 +1,7 @@
#!/bin/sh
+program=${0##*/}
+
die() {
echo "$@" >&2
exit 1
@@ -15,7 +17,7 @@ do_bump() {
set -e
- cd $APORTS/*/$pkgname
+ cd $APORTS/*/$pkgname || return 1
section=${PWD%/*}
section=${section##*/}
@@ -28,13 +30,32 @@ do_bump() {
-e "s/^pkgrel=.*/pkgrel=0/" \
APKBUILD
- abuild -r checksum all || exit 1
+ abuild $abuild_opts checksum all || exit 1
git add APKBUILD
git commit -m"$msg"
}
+usage() {
+ echo "$program - utility to bump pkgver in APKBUILDs"
+ echo "usage: $program [-hR]"
+ echo ""
+ echo " -h show this help"
+ echo " -R run abuild with -R for recursive building"
+ exit 0
+}
+
+abuild_opts="-r"
+while getopts "hR" opt; do
+ case $opt in
+ h) usage;;
+ R) abuild_opts="-R";;
+ esac
+done
+shift $(( $OPTIND - 1))
+
while [ $# -gt 0 ]; do
( do_bump "$1" ) || exit 1
shift
done
+