summaryrefslogtreecommitdiffstats
path: root/abump.in
diff options
context:
space:
mode:
authorDubiousjim <dubiousjim@gmail.com>2013-07-05 00:21:29 -0400
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-09 07:09:05 +0000
commit78b22a0f78f72cc9890add81f49a15e8390c2e05 (patch)
treeed875e65fe7d2d192ede917470924788975f8dc9 /abump.in
parentecde203930001b0db3e05e7582cd10d437187f27 (diff)
downloadabuild-78b22a0f78f72cc9890add81f49a15e8390c2e05.tar.bz2
abuild-78b22a0f78f72cc9890add81f49a15e8390c2e05.tar.xz
abump, functions: refactor (and verify) calculation of APKBUILD path
Diffstat (limited to 'abump.in')
-rwxr-xr-xabump.in12
1 files changed, 11 insertions, 1 deletions
diff --git a/abump.in b/abump.in
index 581ed8d..7628462 100755
--- a/abump.in
+++ b/abump.in
@@ -20,14 +20,22 @@ fi
do_bump() {
local p rc=0 pkgname pkgver section message
local upgrade="${cvelist:+security }upgrade"
+ local a
for p; do
pkgname=${p%-[0-9]*}
pkgver=${p#${pkgname}-}
+ # calculate APKBUILD's path
+ if [ "${pkgname#*/}" != "$pkgname" ] && ! [ -d "$APORTSDIR/${pkgname%/*} ]; then
+ error "'$p' should be of form 'foo-1.2.3' or 'main/foo-1.2.3'"
+ rc=1; continue
+ fi
+ a=$(aports_buildscript "$pkgname" || die "can't find APKBUILD for $pkgname") || { rc=1; continue; }
+
(
set -e
- cd $HOME/aports/*/$pkgname
+ cd "${a%/*}"
section=${PWD%/*}
section=${section##*/}
@@ -75,6 +83,8 @@ recursive="-r"
cvelist=
fixes=
+[ -n "$APORTSDIR" ] || error "can't locate \$APORTSDIR"
+
args=`getopt -o s:Rkqh --long security:,recursive,keep,quiet,help -n "$prog" -- "$@"`
if [ $? -ne 0 ]; then
usage