summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2021-01-31 16:08:36 +0100
committerLevente Polyak <anthraxx@archlinux.org>2021-01-31 23:44:11 +0100
commit8c26438df8be47531e4c071dc44d78a02fbf1d76 (patch)
tree705eb98bae690a539ad10f6457549e155cc24e8b
parenta49bcf20970214c12a0726c0f4bf4abb1a378ab2 (diff)
downloaddevtools32-8c26438df8be47531e4c071dc44d78a02fbf1d76.tar.xz
makechrootpkg: only expose failed build logs instead of products
After further followups always moving all products isn't actually desired as they can theoretically be broken in various ways if arch-nspawn exists non successful. However, as we would like to always preserve the produced log files we instead split out the logfiles into an own function and call that for unsuccessful buils. Fixes 4f305aa3
-rw-r--r--makechrootpkg.in19
1 files changed, 12 insertions, 7 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 9897eba..d308af2 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -242,6 +242,15 @@ download_sources() {
die "Could not download sources."
}
+move_logfiles() {
+ local l
+ for l in "$copydir"/logdest/*; do
+ [[ $l == */logpipe.* ]] && continue
+ chown "$src_owner" "$l"
+ mv "$l" "$LOGDEST"
+ done
+}
+
move_products() {
local pkgfile
for pkgfile in "$copydir"/pkgdest/*; do
@@ -254,12 +263,7 @@ move_products() {
fi
done
- local l
- for l in "$copydir"/logdest/*; do
- [[ $l == */logpipe.* ]] && continue
- chown "$src_owner" "$l"
- mv "$l" "$LOGDEST"
- done
+ move_logfiles
for s in "$copydir"/srcpkgdest/*; do
chown "$src_owner" "$s"
@@ -367,10 +371,11 @@ if arch-nspawn "$copydir" \
/chrootbuild "${makepkg_args[@]}"
then
mapfile -t pkgnames < <(sudo -u "$makepkg_user" bash -c 'source PKGBUILD; printf "%s\n" "${pkgname[@]}"')
+ move_products
else
(( ret += 1 ))
+ move_logfiles
fi
-move_products
(( temp_chroot )) && delete_chroot "$copydir" "$copy"