From 05b56666d37d98e73697caf1cdf929d02b698a2f Mon Sep 17 00:00:00 2001 From: Nathan Whitehorn Date: Thu, 18 Aug 2011 16:00:32 +0000 Subject: [PATCH] Fix a bug that prevented docsinstall from being able to use DNS in most cases and provide a better error handling mechanism during package installation. Approved by: re (kib) --- usr.sbin/bsdinstall/scripts/docsinstall | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bsdinstall/scripts/docsinstall b/usr.sbin/bsdinstall/scripts/docsinstall index e037dcc424ef..e16116c62623 100644 --- a/usr.sbin/bsdinstall/scripts/docsinstall +++ b/usr.sbin/bsdinstall/scripts/docsinstall @@ -59,11 +59,21 @@ NB: This requires a working, configured network connection." 0 0 0 \ test $? -eq 0 || exit 0 exec 3>&- +# Let pkg_add be able to use name servers +cp ${BSDINSTALL_TMPETC}/resolv.conf ${BSDINSTALL_CHROOT}/etc + +error() { + dialog --backtitle "FreeBSD Installer" --title "Error" --msgbox \ + "Could not install package $1 (`tail -n 1 ${BSDINSTALL_LOG}`)" 0 0 + exit 1 +} + + clear echo "FreeBSD Installer" echo "========================" echo for i in $DOCS; do - pkg_add -C ${BSDINSTALL_CHROOT} -r ${i}-freebsd-doc + pkg_add -C ${BSDINSTALL_CHROOT} -r ${i}-freebsd-doc || error $i-freebsd-doc done