summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-10-21 13:48:23 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-10-21 13:48:23 +0000
commit7a447caf05ec70c35c9df4d5211b9dd3828e6b6a (patch)
treeaa48ee0fb8e42c238058f936b85feaeff76d7a8c
parent3092986fc6258172a5f4a6343cac1fb77ac86c60 (diff)
downloadabuild-7a447caf05ec70c35c9df4d5211b9dd3828e6b6a.tar.gz
abuild-7a447caf05ec70c35c9df4d5211b9dd3828e6b6a.tar.bz2
abuild-7a447caf05ec70c35c9df4d5211b9dd3828e6b6a.tar.xz
abuild-7a447caf05ec70c35c9df4d5211b9dd3828e6b6a.zip
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
-rwxr-xr-xbuildrepo.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/buildrepo.in b/buildrepo.in
index a37ab8d..dcba9b6 100755
--- a/buildrepo.in
+++ b/buildrepo.in
@@ -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