mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
bsdconfig: Revert bsddialog support
This commit reverts "bsdconfig(8): add bsddialog(1) support"
30e9abf2fc
because it is not intended for
the current bsddialog 1.0 version.
This commit is contained in:
parent
271e669ed5
commit
0f8b2ba6c6
|
@ -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" \
|
||||
|
|
Loading…
Reference in a new issue