Commit 7a447caf authored by Natanael Copa's avatar Natanael Copa
Browse files

buildrepo: exit early if listing of packages for purging fails

Otherwise we might end up purging more packages than expected if an
APKBUILD has syntax errors
parent 3092986f
......@@ -146,7 +146,7 @@ do_build() {
local purgefiles
cd "$repodir/$repo/$CARCH" || return 1
trap 'rm -f "$tmp"; exit 1' INT
( listpackages "$1") >$tmp
( listpackages "$1") >$tmp || return 1
purge=$(ls *.apk 2>/dev/null | grep -v -w -f $tmp)
if [ -n "$purge" ]; then
rm -f $purge
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