svn commit: r245116 - head/usr.sbin/bsdconfig/share

Devin Teske dteske at svn.freebsd.org
Mon Jan 7 00:15:52 UTC 2013


Author: dteske
Date: Mon Jan  7 00:15:52 2013
New Revision: 245116
URL: http://svnweb.freebsd.org/changeset/base/245116

Log:
  Add nonInteractive support to f_dialog_yesno/noyes().

Modified:
  head/usr.sbin/bsdconfig/share/dialog.subr

Modified: head/usr.sbin/bsdconfig/share/dialog.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/dialog.subr	Sun Jan  6 22:15:44 2013	(r245115)
+++ head/usr.sbin/bsdconfig/share/dialog.subr	Mon Jan  7 00:15:52 2013	(r245116)
@@ -32,6 +32,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig"
 . $BSDCFG_SHARE/common.subr || exit 1
 f_dprintf "%s: loading includes..." dialog.subr
 f_include $BSDCFG_SHARE/strings.subr
+f_include $BSDCFG_SHARE/variable.subr
 
 BSDCFG_LIBE="/usr/libexec/bsdconfig"
 f_include_lang $BSDCFG_LIBE/include/messages.subr
@@ -1058,6 +1059,9 @@ f_dialog_yesno()
 {
 	local msg_text="$*"
 	local hline="$hline_arrows_tab_enter"
+
+	f_interactive || return 0 # If non-interactive, return YES all the time
+
 	local size="$( f_dialog_buttonbox_size \
 	               		"$DIALOG_TITLE"     \
 	               		"$DIALOG_BACKTITLE" \
@@ -1098,6 +1102,9 @@ f_dialog_noyes()
 {
 	local msg_text="$*"
 	local hline="$hline_arrows_tab_enter"
+
+	f_interactive || return 1 # If non-interactive, return NO all the time
+
 	local size="$( f_dialog_buttonbox_size \
 	               		"$DIALOG_TITLE"     \
 	               		"$DIALOG_BACKTITLE" \


More information about the svn-src-all mailing list