git: 0f8b2ba6c629 - main - bsdconfig: Revert bsddialog support

From: Alfonso S. Siciliano <asiciliano_at_FreeBSD.org>
Date: Mon, 23 Oct 2023 14:00:00 UTC
The branch main has been updated by asiciliano:

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

commit 0f8b2ba6c629237e4ddd7a72f7c22f687208060d
Author:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
AuthorDate: 2023-10-23 13:52:56 +0000
Commit:     Alfonso S. Siciliano <asiciliano@FreeBSD.org>
CommitDate: 2023-10-23 13:59:31 +0000

    bsdconfig: Revert bsddialog support
    
    This commit reverts "bsdconfig(8): add bsddialog(1) support"
    30e9abf2fc462084b752064fa814d90ad3161352 because it is not intended for
    the current bsddialog 1.0 version.
---
 usr.sbin/bsdconfig/share/dialog.subr | 30 ++++++++----------------------
 1 file changed, 8 insertions(+), 22 deletions(-)

diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr
index 0b6f11f39134..5b7ae9123073 100644
--- a/usr.sbin/bsdconfig/share/dialog.subr
+++ b/usr.sbin/bsdconfig/share/dialog.subr
@@ -51,7 +51,7 @@ f_include_lang $BSDCFG_LIBE/include/messages.subr
 # Default name of dialog(1) utility
 # NOTE: This is changed to "Xdialog" by the optional `-X' argument
 #
-DIALOG="bsddialog"
+DIALOG="dialog"
 
 #
 # Default dialog(1) title and backtitle text
@@ -79,15 +79,9 @@ DIALOG_OK=${SUCCESS:-0}
 DIALOG_CANCEL=${FAILURE:-1}
 DIALOG_HELP=2
 DIALOG_EXTRA=3
-if [ $DIALOG = "bsddialog" ]; then
-	DIALOG_ITEM_HELP=2
-	DIALOG_ERROR=255
-	DIALOG_ESC=5
-else
-	DIALOG_ITEM_HELP=4
-	export DIALOG_ERROR=254 # sh(1) can't handle the default of `-1'
-	DIALOG_ESC=255
-fi
+DIALOG_ITEM_HELP=4
+export DIALOG_ERROR=254 # sh(1) can't handle the default of `-1'
+DIALOG_ESC=255
 
 #
 # Default behavior is to call f_dialog_init() automatically when loaded.
@@ -2227,14 +2221,7 @@ f_dialog_init()
 	#
 	# Process `-X' command-line option
 	#
-	if [ "$USE_XDIALOG" ]; then
-		if [ $DIALOG = "bsddialog" ]; then
-			DIALOG_ESC=255
-			# else it is already 255 like dialog(1)
-		fi
-		DIALOG=Xdialog
-		USE_DIALOG=
-	fi
+	[ "$USE_XDIALOG" ] && DIALOG=Xdialog USE_DIALOG=
 
 	#
 	# Sanity check, or die gracefully
@@ -2242,7 +2229,7 @@ f_dialog_init()
 	if ! f_have $DIALOG; then
 		unset USE_XDIALOG
 		local failed_dialog="$DIALOG"
-		DIALOG=bsddialog
+		DIALOG=dialog
 		f_die 1 "$msg_no_such_file_or_directory" "$pgm" "$failed_dialog"
 	fi
 
@@ -2274,7 +2261,7 @@ f_dialog_init()
 		if ! f_have xauth; then
 			# Die gracefully, as we [likely] can't use Xdialog(1)
 			unset USE_XDIALOG
-			DIALOG=bsddialog
+			DIALOG=dialog
 			f_die 1 "$msg_no_such_file_or_directory" "$pgm" "xauth"
 		fi
 		HOSTNAME=$( hostname )
@@ -2296,13 +2283,12 @@ f_dialog_init()
 		then
 			# Xdialog(1) failed, fall back to dialog(1)
 			unset USE_XDIALOG
-			DIALOG=bsddialog
 
 			# Display the error message produced by Xdialog(1)
 			local height width
 			f_dialog_buttonbox_size height width \
 				"$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$maxsize"
-			$DIALOG \
+			dialog \
 				--title "$DIALOG_TITLE"         \
 				--backtitle "$DIALOG_BACKTITLE" \
 				--ok-label "$msg_ok"            \