abump: move loop inside do_bump, refine locals, introduce subshell

This commit is contained in:
Dubiousjim 2013-07-05 00:21:25 -04:00 committed by Natanael Copa
parent 7a628e7dc4
commit 512d5fd551

View File

@ -16,18 +16,18 @@ fi
. "$datadir/functions.sh"
# version bump a pkg
# version bump packages
do_bump() {
local pkgname=${1%-[0-9]*}
local pkgver=${1#${pkgname}-}
APORTS=$HOME/aports
local p rc=0 pkgname pkgver section upgrade cve message
for p; do
pkgname=${p%-[0-9]*}
pkgver=${p#${pkgname}-}
(
set -e
cd $APORTS/*/$pkgname || return 1
local section=${PWD%/*} upgrade="upgrade" cve=
cd $HOME/aports/*/$pkgname
section=${PWD%/*} upgrade="upgrade" cve=
section=${section##*/}
if [ -n "$cvelist" ]; then
upgrade="security upgrade"
@ -49,10 +49,13 @@ fixes #${fixes#\#}
-e "s/^pkgrel=.*/pkgrel=0/" \
APKBUILD
abuild $abuild_opts checksum all || exit 1
abuild $abuild_opts checksum all
git add APKBUILD
git commit -m"$message"
) || rc=1
done
return $rc
}
usage() {
@ -101,8 +104,5 @@ fi
abuild_opts="$recursive $keep"
while [ $# -gt 0 ]; do
( do_bump "$1" ) || exit 1
shift
done
do_bump "$@"