From nobody Mon Oct 23 14:14:40 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 4SDcdY3Kx1z4y65k; Mon, 23 Oct 2023 14:14:41 +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 4SDcdY1bmCz3gHr; Mon, 23 Oct 2023 14:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1698070481; 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=yGXgBpv4vlvWzOCboryjxC906Pm6lms5HJj3wXE5Sws=; b=EyWluc4RRMf2sm65gNiqwxNC7Rys4GX64C+fookyKv+eYxR0ePHLgbWHgHJxFeEOq6dsaQ kBdIeaxV1Gy5hw3M9DGmiAxdpneQ01x7OXuMjOvUjAMDWgpQEd5Ev0Tn+fHT2RWPoTSChf QIqniLjtsq0pXQQW7yOm+ElYd3wMRyBAsxaVsA33aybZskKthpLxoDlvzt+bTxNo4xHSz2 8FDtJrOHAZ3ZiK6hBBXWVpIlgU9zQzlR+NU0V/rM7c+VCmcWtotNa7h6VS7tIqJO6I+9Ph gzBw6zzybmxoXDtlnaG77WWenOgVBUBYRB3gWhu4HG0Z88iAIkidAvQNWgnvXg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1698070481; a=rsa-sha256; cv=none; b=qiETXPtjC37vsg5D+KP3ORuCN6LJt4Rt2nWJqIDJHTlhV58sCe4efJhVC2tHWgHfRI4Q3n u/1MhWO9LEU5re5pH9dxWmtEC3mwfSbJRlJawylrmY+mK03eUoRvu2WiBiPdN7gFb9AkCb Iw0SUVE0p8jm+ONBC2mGCefmPNbmFeS0fsnEZBczcJRa0Z3e3aytzzTu9tF7sFi/NWRupe bUGGmw7+Wz2y8bluWXIJNn89Q/TSv4r7JJieMQrn3vxcf5NLEv2J1xVgaH8UdI6xlHVLSY RTaMA1J2/EnLG2XcjX05eGaysaDYUJe5hXv3UCQr9+VZE1pOTMI1IPi0jdEWDA== 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=1698070481; 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=yGXgBpv4vlvWzOCboryjxC906Pm6lms5HJj3wXE5Sws=; b=GKuhUNTVxe6Gh+seL4kNP5XORVdJp94g7CAMPusXBgHoCZNOW7sylAbBdMrmyHAtIO7/fo pJdJCWoOllcxRcT4UPS8+Sh8PeMe4gfptp5hdKP9splE2r9CtQUJtnu98JCvOkOVWmPBc7 EcuGCPSPn4mdV/3ZmMtAD9+PVjQogxAIXaBrLMjfAK2tia9IXIHeLZE0mlsCGbpIehigaV wzMQlRypyhQeu+o+b94D6EaIe0oilpPDmTFDPHIdRuWOh1w9NS3bSysNNLHOxPbucFel9i PBLWF23oUzVh7ZhmuFAxSqbgdwIUvKRM1M+C2a1MesqRc0gAwHjrg/8U3WambQ== 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 4SDcdY0f10zjDq; Mon, 23 Oct 2023 14:14:41 +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 39NEEegB045726; Mon, 23 Oct 2023 14:14:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 39NEEeDt045723; Mon, 23 Oct 2023 14:14:40 GMT (envelope-from git) Date: Mon, 23 Oct 2023 14:14:40 GMT Message-Id: <202310231414.39NEEeDt045723@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfonso S. Siciliano" Subject: git: c36b3dbc99d1 - main - bsdconfig: Restore bsddialog 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: asiciliano X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c36b3dbc99d1e6dfc658e9c20382abc75749af82 Auto-Submitted: auto-generated The branch main has been updated by asiciliano: URL: https://cgit.FreeBSD.org/src/commit/?id=c36b3dbc99d1e6dfc658e9c20382abc75749af82 commit c36b3dbc99d1e6dfc658e9c20382abc75749af82 Author: Alfonso S. Siciliano AuthorDate: 2023-10-23 14:11:54 +0000 Commit: Alfonso S. Siciliano CommitDate: 2023-10-23 14:11:54 +0000 bsdconfig: Restore bsddialog Readd bsddialog(1) to bsdconfig(8). This can be considered an increment not a replacement: `$DIALOG=dialog' restores dialog(1), no change for Xdialog(1). An exception is if an error occurs, bsddialog(1) replaces dialog. --- usr.sbin/bsdconfig/share/common.subr | 10 +++++----- usr.sbin/bsdconfig/share/dialog.subr | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr index ba4d4fce4abb..830279168ff2 100644 --- a/usr.sbin/bsdconfig/share/common.subr +++ b/usr.sbin/bsdconfig/share/common.subr @@ -369,7 +369,7 @@ f_show_info() if f_have f_dialog_info; then f_dialog_info "$msg" else - dialog --infobox "$msg" 0 0 + bsddialog --infobox "$msg" 0 0 fi } @@ -390,7 +390,7 @@ f_show_msg() if f_have f_dialog_msgbox; then f_dialog_msgbox "$msg" else - dialog --msgbox "$msg" 0 0 + bsddialog --msgbox "$msg" 0 0 fi } @@ -433,7 +433,7 @@ f_yesno() if f_have f_dialog_yesno; then f_dialog_yesno "$msg" else - dialog --yesno "$msg" 0 0 + bsddialog --yesno "$msg" 0 0 fi } @@ -455,7 +455,7 @@ f_noyes() if f_have f_dialog_noyes; then f_dialog_noyes "$msg" else - dialog --defaultno --yesno "$msg" 0 0 + bsddialog --defaultno --yesno "$msg" 0 0 fi } @@ -486,7 +486,7 @@ f_show_help() if f_have f_dialog_textbox; then f_dialog_textbox "$file" else - dialog --msgbox "$( cat "$file" 2>&1 )" 0 0 + bsddialog --msgbox "$( cat "$file" 2>&1 )" 0 0 fi } diff --git a/usr.sbin/bsdconfig/share/dialog.subr b/usr.sbin/bsdconfig/share/dialog.subr index 5b7ae9123073..cac0a3e24e53 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 @@ -83,6 +83,15 @@ DIALOG_ITEM_HELP=4 export DIALOG_ERROR=254 # sh(1) can't handle the default of `-1' DIALOG_ESC=255 +# +# Set bsddialog(1) compatibility with dialog(1): exit codes and use_shadow +# +export BSDDIALOG_TIMEOUT=0 +export BSDDIALOG_ITEM_HELP=4 +export BSDDIALOG_ERROR=254 +export BSDDIALOG_ESC=255 +export BSDDIALOG_COMPATRC=".dialogrc" + # # Default behavior is to call f_dialog_init() automatically when loaded. # @@ -2229,7 +2238,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 +2270,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 ) @@ -2288,7 +2297,7 @@ f_dialog_init() local height width f_dialog_buttonbox_size height width \ "$DIALOG_TITLE" "$DIALOG_BACKTITLE" "$maxsize" - dialog \ + bsddialog \ --title "$DIALOG_TITLE" \ --backtitle "$DIALOG_BACKTITLE" \ --ok-label "$msg_ok" \