From nobody Thu Oct 05 07:31:30 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S1NXf43Rnz4wgPF; Thu, 5 Oct 2023 07:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S1NXf3bzHz4W7h; Thu, 5 Oct 2023 07:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696491090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WMoiyZp6+CKg400UNLzRpeh4LvVJNWBkGBWRzCVUUPE=; b=xvw8O8EX3O0aFHLC8FzeM2FtOm8UGjEL5M1K0fKHLZVCJMA+KvEKJtOGCcyZWBs8L//YIT ntisB2vWWcViXzbot4QwA5I6uyw9rucqN5gPicnbBCXkBoTwK3svx8Pf8+dhRgXtusEkF7 7pbfBI+0KU2M29cxylnzYPOi4s5JWuaiX7Deu28lKfS1XEAfh/EDhWgDnPgsVksoCy7NsJ i0jnrCkrqk787I+hutKdKnzH/GdhgE3NimSL7XT/uxGG7ez0P3tyXBtGqnMCW3qBEsPEYV dtks3WOPND3kE5oD3iBGL3wS16G3KKXz2O8gmwfG+V67iRxYXFnSXZ5oxx7Bjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696491090; a=rsa-sha256; cv=none; b=P4zRqk8dTuRM4nEUOoD/VP/JN3ig/fh33AkFdD85blNL+X7z+Z9wuGxGTCb0a3rWYxhPp2 wEG2nT8zFT0eHawgrKQrG+NBfJc3Lqil3tSX0jrtQtwhJ3GAVzadRYvj00QT6M9+p+ipYD Fa8KwHwO7ljyTo0MydaOjOVGAEYo1nzbPhw3qFNV/k/A5/6N2wVBwQfvAL270cTdA+GXdI c/9w39m+IdELrfDs8nwlKJjeUdyjS3Q2KJRM60DDu7SyPDgdcQuITfVoTavlI0xfNmurxN 5jG/qh4MM5idazfJOdRfQANvTdfNw62ViklZtNTIt0uKg9aHXkHyGfzdLL0MWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696491090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WMoiyZp6+CKg400UNLzRpeh4LvVJNWBkGBWRzCVUUPE=; b=eZE6apBUK7THxoIlOH9+SFtZUBRcOEQUjo22lxjcfwuFNimc5trWRrJswJNQv62tlnc+zN 6WNu1ktZwg70BdvNCeX81XbiC9ndYVwOeCbNDKcVZnWNZX0dYr+txMj8RXLlKlNXwToFzR CVtBnXtTSf4ilgMpAsJT8Giy8xiv4vhVm9+IcDQWOVmRVz0O6oFlXMY4qNaHD9wB7TOlTi ia0FDqK9mMYg5D4/TH3g/jBb9KVHlstgNdvA1GDz2pKPOAKncTzTZb6HnC5ac+7yeOBZt2 uvbpFYqQPuJ0Ok8AZuR9Y6X4OWkF8THyTvPSqC/ifWnaYZC0gXJU4ZPD2Mj2TA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4S1NXf2fbhz1B5h; Thu, 5 Oct 2023 07:31:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3957VUNF003299; Thu, 5 Oct 2023 07:31:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3957VUPl003296; Thu, 5 Oct 2023 07:31:30 GMT (envelope-from git) Date: Thu, 5 Oct 2023 07:31:30 GMT Message-Id: <202310050731.3957VUPl003296@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 30e9abf2fc46 - main - bsdconfig(8): add bsddialog(1) support List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 30e9abf2fc462084b752064fa814d90ad3161352 Auto-Submitted: auto-generated The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=30e9abf2fc462084b752064fa814d90ad3161352 commit 30e9abf2fc462084b752064fa814d90ad3161352 Author: Alfonso S. Siciliano AuthorDate: 2023-10-05 07:29:12 +0000 Commit: Baptiste Daroussin CommitDate: 2023-10-05 07:31:18 +0000 bsdconfig(8): add bsddialog(1) support Add bsddialog(1) to bsdconfig(8). This can be considered an increment not a replacement, `$DIALOG=dialog' restores dialog(1). Differential Revision: https://reviews.freebsd.org/D37480 --- usr.sbin/bsdconfig/share/dialog.subr | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr index 5b7ae9123073..0b6f11f39134 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="dialog" +DIALOG="bsddialog" # # Default dialog(1) title and backtitle text @@ -79,9 +79,15 @@ DIALOG_OK=${SUCCESS:-0} DIALOG_CANCEL=${FAILURE:-1} DIALOG_HELP=2 DIALOG_EXTRA=3 -DIALOG_ITEM_HELP=4 -export DIALOG_ERROR=254 # sh(1) can't handle the default of `-1' -DIALOG_ESC=255 +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 # # Default behavior is to call f_dialog_init() automatically when loaded. @@ -2221,7 +2227,14 @@ f_dialog_init() # # Process `-X' command-line option # - [ "$USE_XDIALOG" ] && DIALOG=Xdialog USE_DIALOG= + 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 # # Sanity check, or die gracefully @@ -2229,7 +2242,7 @@ f_dialog_init() if ! f_have $DIALOG; then unset USE_XDIALOG local failed_dialog="$DIALOG" - DIALOG=dialog + DIALOG=bsddialog f_die 1 "$msg_no_such_file_or_directory" "$pgm" "$failed_dialog" fi @@ -2261,7 +2274,7 @@ f_dialog_init() if ! f_have xauth; then # Die gracefully, as we [likely] can't use Xdialog(1) unset USE_XDIALOG - DIALOG=dialog + DIALOG=bsddialog f_die 1 "$msg_no_such_file_or_directory" "$pgm" "xauth" fi HOSTNAME=$( hostname ) @@ -2283,12 +2296,13 @@ 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" \