common.subr (257782) | common.subr (257783) |
---|---|
1if [ ! "$_COMMON_SUBR" ]; then _COMMON_SUBR=1 2# 3# Copyright (c) 2012 Ron McDowell 4# Copyright (c) 2012-2013 Devin Teske 5# All rights reserved. 6# 7# Redistribution and use in source and binary forms, with or without 8# modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26# SUCH DAMAGE. 27# | 1if [ ! "$_COMMON_SUBR" ]; then _COMMON_SUBR=1 2# 3# Copyright (c) 2012 Ron McDowell 4# Copyright (c) 2012-2013 Devin Teske 5# All rights reserved. 6# 7# Redistribution and use in source and binary forms, with or without 8# modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26# SUCH DAMAGE. 27# |
28# $FreeBSD: head/usr.sbin/bsdconfig/share/common.subr 257782 2013-11-07 10:20:19Z dteske $ | 28# $FreeBSD: head/usr.sbin/bsdconfig/share/common.subr 257783 2013-11-07 10:23:37Z dteske $ |
29# 30############################################################ CONFIGURATION 31 32# 33# Default file descriptors to link to stdout/stderr for passthru allowing 34# redirection within a sub-shell to bypass directly to the terminal. 35# 36: ${TERMINAL_STDOUT_PASSTHRU:=3}} --- 316 unchanged lines hidden (view full) --- 353 # 354 if f_have f_dialog_msgbox; then 355 f_dialog_msgbox "$msg" 356 else 357 dialog --msgbox "$msg" 0 0 358 fi 359} 360 | 29# 30############################################################ CONFIGURATION 31 32# 33# Default file descriptors to link to stdout/stderr for passthru allowing 34# redirection within a sub-shell to bypass directly to the terminal. 35# 36: ${TERMINAL_STDOUT_PASSTHRU:=3}} --- 316 unchanged lines hidden (view full) --- 353 # 354 if f_have f_dialog_msgbox; then 355 f_dialog_msgbox "$msg" 356 else 357 dialog --msgbox "$msg" 0 0 358 fi 359} 360 |
361# f_show_err $format [$arguments ...] 362# 363# Display a message in a dialog box with ``Error'' i18n title (overridden by 364# setting msg_error) using printf(1) syntax. If running non-interactively, 365# the process will terminate (using [above] f_die()). 366# 367f_show_err() 368{ 369 [ "$nonInteractive" ] && f_die |
|
361 | 370 |
371 local msg 372 msg=$( printf "$@" ) 373 374 : ${msg:=${msg_an_unknown_error_occurred:-An unknown error occurred}} 375 376 if [ "$_DIALOG_SUBR" ]; then 377 f_dialog_title "${msg_error:-Error}" 378 f_dialog_msgbox "$msg" 379 f_dialog_title_restore 380 else 381 dialog --title "${msg_error:-Error}" --msgbox "$msg" 0 0 382 fi 383 return $SUCCESS 384} 385 |
|
362# f_yesno $format [$arguments ...] 363# 364# Display a message in a dialog yes/no box using printf(1) syntax. 365# 366f_yesno() 367{ 368 local msg 369 msg=$( printf "$@" ) --- 421 unchanged lines hidden --- | 386# f_yesno $format [$arguments ...] 387# 388# Display a message in a dialog yes/no box using printf(1) syntax. 389# 390f_yesno() 391{ 392 local msg 393 msg=$( printf "$@" ) --- 421 unchanged lines hidden --- |