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
This commit is contained in:
Natanael Copa 2013-10-21 13:48:23 +00:00
parent 3092986fc6
commit 7a447caf05

View File

@ -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