Commit 512d5fd5 authored by Dubiousjim's avatar Dubiousjim Committed by Natanael Copa

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

parent 7a628e7d
......@@ -16,43 +16,46 @@ 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
set -e
cd $APORTS/*/$pkgname || return 1
local section=${PWD%/*} upgrade="upgrade" cve=
section=${section##*/}
if [ -n "$cvelist" ]; then
upgrade="security upgrade"
cve=" ($cvelist)"
fi
message="$section/$pkgname: $upgrade to ${pkgver}${cve}"
if [ -n "$fixes" ]; then
message="$message
local p rc=0 pkgname pkgver section upgrade cve message
for p; do
pkgname=${p%-[0-9]*}
pkgver=${p#${pkgname}-}
(
set -e
cd $HOME/aports/*/$pkgname
section=${PWD%/*} upgrade="upgrade" cve=
section=${section##*/}
if [ -n "$cvelist" ]; then
upgrade="security upgrade"
cve=" ($cvelist)"
fi
message="$section/$pkgname: $upgrade to ${pkgver}${cve}"
if [ -n "$fixes" ]; then
message="$message
fixes #${fixes#\#}
"
fi
echo "$message"
fi
echo "$message"
( . ./APKBUILD; type package | grep -q function ) || die "package() missing"
( . ./APKBUILD; type package | grep -q function ) || die "package() missing"
sed -i -e "s/^pkgver=.*/pkgver=$pkgver/" \
-e "s/^pkgrel=.*/pkgrel=0/" \
APKBUILD
sed -i -e "s/^pkgver=.*/pkgver=$pkgver/" \
-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"
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 "$@"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment