abump: error out on first faild package

If some package fails, then stop processing the rest. This is so we
don't risk test build the rest for the packages against wrong lib.

For example, if 'abump libfoo-2.0 foo-2.0' fails on libfoo, we don't
want testbuild foo-2.0, which might end with success against libfoo-1.

We also echo the list of packages that was not bumped, so its easy to
copy/paste next run.
This commit is contained in:
Natanael Copa 2013-07-26 07:31:54 +00:00
parent b0ea14135d
commit bfee7b63f9
1 changed files with 11 additions and 7 deletions

View File

@ -18,10 +18,14 @@ fi
# version bump packages # version bump packages
do_bump() { do_bump() {
local p rc=0 errors=0 failed= name ver section message local p rc=0 notbumped="" name ver section message
local upgrade="${cvelist:+security }upgrade" local upgrade="${cvelist:+security }upgrade"
local a local a
for p; do for p; do
if [ $rc -gt 0 ]; then
notbumped="$notbumped $p"
continue
fi
name=${p%-[0-9]*} name=${p%-[0-9]*}
ver=${p#${name}-} ver=${p#${name}-}
@ -64,15 +68,15 @@ fixes #${fixes#\#}
git add APKBUILD git add APKBUILD
git commit -m"$message" git commit -m"$message"
) )
if [ $? -ne 0 ]; then rc=$?
errors=$(( $errors + 1 )) if [ $rc -gt 0 ]; then
failed="$failed $p" error "Failed to build $p"
fi fi
done done
if [ -n "$failed" ]; then if [ -n "$notbumped" ]; then
error "Failed: $failed" error "Not bumped: $notbumped"
fi fi
return $errors return $rc
} }
usage() { usage() {