summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xabump.in23
1 files changed, 14 insertions, 9 deletions
diff --git a/abump.in b/abump.in
index 7628462..cd6163e 100755
--- a/abump.in
+++ b/abump.in
@@ -18,19 +18,26 @@ fi
# version bump packages
do_bump() {
- local p rc=0 pkgname pkgver section message
+ local p rc=0 name ver section message
local upgrade="${cvelist:+security }upgrade"
local a
for p; do
- pkgname=${p%-[0-9]*}
- pkgver=${p#${pkgname}-}
+ name=${p%-[0-9]*}
+ ver=${p#${name}-}
# calculate APKBUILD's path
- if [ "${pkgname#*/}" != "$pkgname" ] && ! [ -d "$APORTSDIR/${pkgname%/*} ]; then
+ if [ "${name#*/}" != "$name" ] && ! [ -d "$APORTSDIR/${name%/*} ]; 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; }
+ a=$(aports_buildscript "$name" || die "can't find APKBUILD for $name") || { rc=1; continue; }
+
+ # verify APKBUILD
+ (
+ . "$a" || exit 1
+ [ "$pkgname" = "$name" ] || die "$name: APKBUILD has different \$pkgname"
+ type package | grep -q function || die "$name: missing package()"
+ ) || { rc=1; continue; }
(
set -e
@@ -39,7 +46,7 @@ do_bump() {
section=${PWD%/*}
section=${section##*/}
- message="$section/$pkgname: $upgrade to ${pkgver}${cvelist}"
+ message="$section/$name: $upgrade to ${ver}${cvelist}"
if [ -n "$fixes" ]; then
message="$message
@@ -48,9 +55,7 @@ fixes #${fixes#\#}
fi
echo "$message"
- ( . ./APKBUILD; type package | grep -q function ) || die "package() missing"
-
- sed -i -e "s/^pkgver=.*/pkgver=$pkgver/" \
+ sed -i -e "s/^pkgver=.*/pkgver=$ver/" \
-e "s/^pkgrel=.*/pkgrel=0/" \
APKBUILD