mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-03 05:02:18 +00:00
abump: move loop inside do_bump, refine locals, introduce subshell
This commit is contained in:
parent
7a628e7dc4
commit
512d5fd551
60
abump.in
60
abump.in
@ -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}-}
|
||||
local p rc=0 pkgname pkgver section upgrade cve message
|
||||
for p; do
|
||||
pkgname=${p%-[0-9]*}
|
||||
pkgver=${p#${pkgname}-}
|
||||
|
||||
APORTS=$HOME/aports
|
||||
(
|
||||
set -e
|
||||
|
||||
set -e
|
||||
cd $HOME/aports/*/$pkgname
|
||||
section=${PWD%/*} upgrade="upgrade" cve=
|
||||
section=${section##*/}
|
||||
if [ -n "$cvelist" ]; then
|
||||
upgrade="security upgrade"
|
||||
cve=" ($cvelist)"
|
||||
fi
|
||||
|
||||
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
|
||||
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 "$@"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user