[Bug 264578] release/tools/vmimage.subr has no error handling for pkg failures

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 09 Jun 2022 19:30:36 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=264578

--- Comment #1 from Ed Maste <emaste@freebsd.org> ---
(In reply to Dave Cottlehuber from comment #0)
chroot should pass through the return value. (I have no idea whether
${EMULATOR} does, off hand)

perhaps:

diff --git a/release/tools/vmimage.subr b/release/tools/vmimage.subr
index 0d9202431822..9a89759edc7c 100644
--- a/release/tools/vmimage.subr
+++ b/release/tools/vmimage.subr
@@ -134,6 +134,9 @@ vm_extra_install_packages() {
        for p in ${VM_EXTRA_PACKAGES}; do
                chroot ${DESTDIR} ${EMULATOR} env ASSUME_ALWAYS_YES=yes \
                        /usr/sbin/pkg install -y ${p}
+               if [ $? -ne 0 ]; then
+                       err "Package ${p} installation failed"
+               fi
        done
        umount_loop ${DESTDIR}/dev

-- 
You are receiving this mail because:
You are the assignee for the bug.