Deleted Added
full compact
rcconf.subr (249751) rcconf.subr (251190)
1if [ ! "$_STARTUP_RCCONF_SUBR" ]; then _STARTUP_RCCONF_SUBR=1
2#
3# Copyright (c) 2006-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 10 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
1if [ ! "$_STARTUP_RCCONF_SUBR" ]; then _STARTUP_RCCONF_SUBR=1
2#
3# Copyright (c) 2006-2013 Devin Teske
4# All Rights Reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:

--- 10 unchanged lines hidden (view full) ---

19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20# DAMAGES (INLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25# SUCH DAMAGE.
26#
27# $FreeBSD: head/usr.sbin/bsdconfig/startup/share/rcconf.subr 249751 2013-04-22 05:52:06Z dteske $
27# $FreeBSD: head/usr.sbin/bsdconfig/startup/share/rcconf.subr 251190 2013-05-31 19:07:17Z dteske $
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." startup/rcconf.subr
34f_include $BSDCFG_SHARE/sysrc.subr
35

--- 232 unchanged lines hidden (view full) ---

268#
269# Each variable is treated as a boolean (NULL for false, non-NULL for true).
270#
271# Variables are exported for later-required awk(1) ENVIRON visibility. Returns
272# success unless the user chose `Cancel' or pressed Escape.
273#
274f_dialog_input_view_details()
275{
28#
29############################################################ INCLUDES
30
31BSDCFG_SHARE="/usr/share/bsdconfig"
32. $BSDCFG_SHARE/common.subr || exit 1
33f_dprintf "%s: loading includes..." startup/rcconf.subr
34f_include $BSDCFG_SHARE/sysrc.subr
35

--- 232 unchanged lines hidden (view full) ---

268#
269# Each variable is treated as a boolean (NULL for false, non-NULL for true).
270#
271# Variables are exported for later-required awk(1) ENVIRON visibility. Returns
272# success unless the user chose `Cancel' or pressed Escape.
273#
274f_dialog_input_view_details()
275{
276 local menu_list size
276 local menu_list
277 local hline="$hline_arrows_tab_enter"
278 local prompt=""
279
280 local md=" "
281 if [ "$SHOW_DESC" ]; then
282 md="X"
283 fi
284 local m1=" " m2=" " m3=" " defaultitem=

--- 11 unchanged lines hidden (view full) ---

296 menu_list="
297 'R $msg_reset' '$msg_reset_desc'
298 'D [$md] $msg_desc' '$msg_desc_desc'
299 '1 ($m1) $msg_show_value' '$msg_show_value_desc'
300 '2 ($m2) $msg_show_default_value' '$msg_show_default_value_desc'
301 '3 ($m3) $msg_show_configured' '$msg_show_configured_desc'
302 " # END-QUOTE
303
277 local hline="$hline_arrows_tab_enter"
278 local prompt=""
279
280 local md=" "
281 if [ "$SHOW_DESC" ]; then
282 md="X"
283 fi
284 local m1=" " m2=" " m3=" " defaultitem=

--- 11 unchanged lines hidden (view full) ---

296 menu_list="
297 'R $msg_reset' '$msg_reset_desc'
298 'D [$md] $msg_desc' '$msg_desc_desc'
299 '1 ($m1) $msg_show_value' '$msg_show_value_desc'
300 '2 ($m2) $msg_show_default_value' '$msg_show_default_value_desc'
301 '3 ($m3) $msg_show_configured' '$msg_show_configured_desc'
302 " # END-QUOTE
303
304 size=$( eval f_dialog_menu_size \
305 \"\$DIALOG_TITLE\" \
306 \"\$DIALOG_BACKTITLE\" \
307 \"\$prompt\" \
308 \"\$hline\" \
309 $menu_list )
304 local height width rows
305 eval f_dialog_menu_size height width rows \
306 \"\$DIALOG_TITLE\" \
307 \"\$DIALOG_BACKTITLE\" \
308 \"\$prompt\" \
309 \"\$hline\" \
310 $menu_list
310
311 f_dialog_title "$msg_choose_view_details"
312
313 local dialog_menu
314 dialog_menu=$( eval $DIALOG \
315 --title \"\$DIALOG_TITLE\" \
316 --backtitle \"\$DIALOG_BACKTITLE\" \
317 --hline \"\$hline\" \
318 --ok-label \"\$msg_ok\" \
319 --cancel-label \"\$msg_cancel\" \
320 --default-item \"\$defaultitem\" \
311
312 f_dialog_title "$msg_choose_view_details"
313
314 local dialog_menu
315 dialog_menu=$( eval $DIALOG \
316 --title \"\$DIALOG_TITLE\" \
317 --backtitle \"\$DIALOG_BACKTITLE\" \
318 --hline \"\$hline\" \
319 --ok-label \"\$msg_ok\" \
320 --cancel-label \"\$msg_cancel\" \
321 --default-item \"\$defaultitem\" \
321 --menu \"\$prompt\" $size \
322 --menu \"\$prompt\" \
323 $height $width $rows \
322 $menu_list \
323 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
324 )
325
326 local retval=$?
327 setvar DIALOG_MENU_$$ "$dialog_menu"
328 local mtag="$( f_dialog_menutag )"
329

--- 32 unchanged lines hidden (view full) ---

362#
363# Presents a menu of rc.conf(5) defaults (with, or without descriptions). This
364# function should be treated like a call to dialog(1) (the exit status should
365# be captured and f_dialog_menutag() should be used to clean-up and get the
366# user's response).
367#
368f_dialog_input_rclist()
369{
324 $menu_list \
325 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
326 )
327
328 local retval=$?
329 setvar DIALOG_MENU_$$ "$dialog_menu"
330 local mtag="$( f_dialog_menutag )"
331

--- 32 unchanged lines hidden (view full) ---

364#
365# Presents a menu of rc.conf(5) defaults (with, or without descriptions). This
366# function should be treated like a call to dialog(1) (the exit status should
367# be captured and f_dialog_menutag() should be used to clean-up and get the
368# user's response).
369#
370f_dialog_input_rclist()
371{
370 local size
371 local hline="$hline_arrows_tab_enter"
372 local prompt="$msg_please_select_an_rcconf_directive"
373 local menu_list
374
375 menu_list="
376 'X $msg_exit' '' ${SHOW_DESC:+'$msg_exit_help'}
377 " # END-QUOTE
378

--- 30 unchanged lines hidden (view full) ---

409 printf " '\''%s'\''", desc
410 }
411 printf "\n"
412 }'
413 )"
414
415 set -f # noglob
416
372 local hline="$hline_arrows_tab_enter"
373 local prompt="$msg_please_select_an_rcconf_directive"
374 local menu_list
375
376 menu_list="
377 'X $msg_exit' '' ${SHOW_DESC:+'$msg_exit_help'}
378 " # END-QUOTE
379

--- 30 unchanged lines hidden (view full) ---

410 printf " '\''%s'\''", desc
411 }
412 printf "\n"
413 }'
414 )"
415
416 set -f # noglob
417
417 size=$( eval f_dialog_menu_${SHOW_DESC:+with_help_}size \
418 \"\$DIALOG_TITLE\" \
419 \"\$DIALOG_BACKTITLE\" \
420 \"\$prompt\" \
421 \"\$hline\" \
422 $menu_list )
418 local height width rows
419 eval f_dialog_menu${SHOW_DESC:+_with_help}_size \
420 height width rows \
421 \"\$DIALOG_TITLE\" \
422 \"\$DIALOG_BACKTITLE\" \
423 \"\$prompt\" \
424 \"\$hline\" \
425 $menu_list
423
424 local dialog_menu
425 dialog_menu=$( eval $DIALOG \
426 --title \"\$DIALOG_TITLE\" \
427 --backtitle \"\$DIALOG_BACKTITLE\" \
428 --hline \"\$hline\" \
429 --ok-label \"\$msg_ok\" \
430 --cancel-label \"\$msg_cancel\" \

--- 56 unchanged lines hidden ---
426
427 local dialog_menu
428 dialog_menu=$( eval $DIALOG \
429 --title \"\$DIALOG_TITLE\" \
430 --backtitle \"\$DIALOG_BACKTITLE\" \
431 --hline \"\$hline\" \
432 --ok-label \"\$msg_ok\" \
433 --cancel-label \"\$msg_cancel\" \

--- 56 unchanged lines hidden ---