git: bbddd8888aa9 - main - bsdinstall mirrorselect: Replace dialog with bsddialog

From: Alfonso S. Siciliano <asiciliano_at_FreeBSD.org>
Date: Sat, 26 Mar 2022 00:16:29 UTC
The branch main has been updated by asiciliano:

URL: https://cgit.FreeBSD.org/src/commit/?id=bbddd8888aa9119746d3af3af98800b359ab3b40

commit bbddd8888aa9119746d3af3af98800b359ab3b40
Author:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
AuthorDate: 2022-03-26 00:13:59 +0000
Commit:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
CommitDate: 2022-03-26 00:16:03 +0000

    bsdinstall mirrorselect: Replace dialog with bsddialog
    
    Replace (LGPL) dialog utility with (BSD-2-Clause) bsddialog utility.
    
    Approved by:            bapt (mentor)
    Differential Revision:  https://reviews.freebsd.org/D34582
---
 usr.sbin/bsdinstall/scripts/mirrorselect | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/usr.sbin/bsdinstall/scripts/mirrorselect b/usr.sbin/bsdinstall/scripts/mirrorselect
index e218fe92dbbb..a80b9282cbd0 100755
--- a/usr.sbin/bsdinstall/scripts/mirrorselect
+++ b/usr.sbin/bsdinstall/scripts/mirrorselect
@@ -26,18 +26,18 @@
 #
 # $FreeBSD$
 
-: ${DIALOG_OK=0}
-: ${DIALOG_CANCEL=1}
-: ${DIALOG_HELP=2}
-: ${DIALOG_EXTRA=3}
-: ${DIALOG_ITEM_HELP=4}
-: ${DIALOG_ESC=255}
+: ${BSDDIALOG_OK=0}
+: ${BSDDIALOG_CANCEL=1}
+: ${BSDDIALOG_HELP=2}
+: ${BSDDIALOG_EXTRA=3}
+: ${BSDDIALOG_ESC=5}
+: ${BSDDIALOG_ERROR=255}
 
 exec 3>&1
-MIRROR=`dialog --backtitle "FreeBSD Installer" \
+MIRROR=`bsddialog --backtitle "FreeBSD Installer" \
     --title "Mirror Selection" --extra-button --extra-label "Other" \
     --menu "Please select the site closest to you or \"other\" if you'd like to specify a different choice.  Also note that not every site listed here carries more than the base distribution kits. Only Primary sites are guaranteed to carry the full range of possible distributions. Select a site that's close!" \
-    0 0 0 \
+    0 0 16 \
 	ftp://ftp.freebsd.org	"Main Site"\
 	ftp://ftp.freebsd.org 	"IPv6 Main Site"\
 	ftp://ftp3.ie.freebsd.org 	"IPv6 Ireland"\
@@ -157,20 +157,20 @@ esac
 BSDINSTALL_DISTSITE="$MIRROR/pub/FreeBSD/${RELDIR}/`uname -m`/`uname -p`/${_UNAME_R}"
 
 case $MIRROR_BUTTON in
-$DIALOG_CANCEL)
+$BSDDIALOG_ERROR | $BSDDIALOG_CANCEL | $BSDDIALOG_ESC)
 	exit 1
 	;;
-$DIALOG_OK)
+$BSDDIALOG_OK)
 	;;
-$DIALOG_EXTRA)
+$BSDDIALOG_EXTRA)
 	exec 3>&1
-	BSDINSTALL_DISTSITE=`dialog --backtitle "FreeBSD Installer" \
+	BSDINSTALL_DISTSITE=`bsddialog --backtitle "FreeBSD Installer" \
 	    --title "Mirror Selection" \
 	    --inputbox "Please enter the URL to an alternate FreeBSD mirror:" \
-	    0 0 "$BSDINSTALL_DISTSITE" 2>&1 1>&3`
+	    0 74 "$BSDINSTALL_DISTSITE" 2>&1 1>&3`
 	MIRROR_BUTTON=$?
 	exec 3>&-
-	test $MIRROR_BUTTON -eq 0 || exec $0 $@
+	test $MIRROR_BUTTON -eq $BSDDIALOG_OK || exec $0 $@
 	;;
 esac