1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00

Improvements to whitespace and comments.

This commit is contained in:
Devin Teske 2013-06-02 22:34:40 +00:00
parent 5b4765c331
commit f4844f65a9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=251266
12 changed files with 57 additions and 38 deletions

View File

@ -169,7 +169,6 @@ dialog_menu_main()
local hline= local hline=
local sanitize_awk="{ gsub(/'/, \"'\\\\''\"); print }" local sanitize_awk="{ gsub(/'/, \"'\\\\''\"); print }"
local menuitem menu_title menu_help menu_selection index=2 local menuitem menu_title menu_help menu_selection index=2
for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do
[ $index -lt ${#DIALOG_MENU_TAGS} ] || break [ $index -lt ${#DIALOG_MENU_TAGS} ] || break

View File

@ -101,7 +101,9 @@ f_ifconfig_media()
# f_dialog_input_options $interface # f_dialog_input_options $interface
# #
# Input custom interface options. # Input custom interface options. If the user does not press ESC or choose
# Cancel/No, $options will hold the user's input. Default input is taken from
# the same variable ($options).
# #
f_dialog_input_options() f_dialog_input_options()
{ {

View File

@ -1672,7 +1672,7 @@ f_dialog_inputstr_fetch()
# #
# Prompt the user with a dialog(1) inputbox to enter some value. The inputbox # Prompt the user with a dialog(1) inputbox to enter some value. The inputbox
# remains until the the user presses ENTER or ESC, or otherwise ends the # remains until the the user presses ENTER or ESC, or otherwise ends the
# editing session, by selecting `Cancel' for example. # editing session (by selecting `Cancel' for example).
# #
# If the user presses ENTER, the exit status is zero (success), otherwise if # If the user presses ENTER, the exit status is zero (success), otherwise if
# the user presses ESC the exit status is 255, or if the user chose Cancel, the # the user presses ESC the exit status is 255, or if the user chose Cancel, the

View File

@ -171,7 +171,8 @@ f_become_root_via_sudo()
--cancel-label "$msg_cancel" \ --cancel-label "$msg_cancel" \
--password --inputbox "$prompt" \ --password --inputbox "$prompt" \
$height $width \ $height $width \
2>&1 > /dev/null ) 2>&1 > /dev/null
)
retval=$? retval=$?
# Catch X11-related errors # Catch X11-related errors

View File

@ -307,18 +307,18 @@ f_package_menu_categories()
$menu_list $menu_list
local menu_choice local menu_choice
menu_choice=$( eval $DIALOG \ menu_choice=$( eval $DIALOG \
--title \"\$DIALOG_TITLE\" \ --title \"\$DIALOG_TITLE\" \
--backtitle \"\$DIALOG_BACKTITLE\" \ --backtitle \"\$DIALOG_BACKTITLE\" \
--hline \"\$hline\" \ --hline \"\$hline\" \
--item-help \ --item-help \
--default-item \"\$defaultitem\" \ --default-item \"\$defaultitem\" \
--ok-label \"$msg_select\" \ --ok-label \"$msg_select\" \
--cancel-label \"$msg_cancel\" \ --cancel-label \"$msg_cancel\" \
--menu \"\$prompt\" \ --menu \"\$prompt\" \
$height $width $rows \ $height $width $rows \
$menu_list \ $menu_list \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) )
local retval=$? local retval=$?
f_dialog_menutag_store -s "$menu_choice" f_dialog_menutag_store -s "$menu_choice"
return $retval return $retval
@ -353,7 +353,7 @@ f_package_index_get_page()
fi fi
} }
# f_package_menu_select $category [ $page [ $defaultitem ] ] # f_package_menu_select $category [$page [$defaultitem]]
# #
# Display list of packages for $category, optionally $page N and with a default # Display list of packages for $category, optionally $page N and with a default
# item selected. If $page is omitted, the first page is displayed (but this # item selected. If $page is omitted, the first page is displayed (but this

View File

@ -63,6 +63,7 @@ dialog_menu_main()
local defaultitem= # Calculated below local defaultitem= # Calculated below
local hline="$hline_arrows_tab_enter" local hline="$hline_arrows_tab_enter"
# List of variables we'll need from rc.conf(5)
local var_list=" local var_list="
accounting_enable accounting_enable
local_startup local_startup
@ -75,6 +76,7 @@ dialog_menu_main()
startup_dirs startup_dirs
" # END-QUOTE " # END-QUOTE
# Add i386-specific variables if appropriate
if [ "$UNAME_P" = "i386" ]; then if [ "$UNAME_P" = "i386" ]; then
var_list="$var_list var_list="$var_list
apm_enable apm_enable

View File

@ -158,7 +158,9 @@ dialog_menu_main()
}' }'
)" )"
set -f # noglob set -f # set noglob because descriptions in the $menu_list may contain
# `*' and get expanded by dialog(1) (doesn't affect Xdialog(1)).
# This prevents dialog(1) from expanding wildcards in help line.
local height width rows local height width rows
eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ eval f_dialog_menu${SHOW_DESC:+_with_help}_size \

View File

@ -194,7 +194,9 @@ dialog_menu_main()
done done
menu_list="$menu_list $menu_buf" menu_list="$menu_list $menu_buf"
set -f # noglob (descriptions in $RCCONF_MENU_LIST may contain *) set -f # set noglob because descriptions in the $menu_list may contain
# `*' and get expanded by dialog(1) (doesn't affect Xdialog(1)).
# This prevents dialog(1) from expanding wildcards in help line.
local height width rows local height width rows
eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ eval f_dialog_menu${SHOW_DESC:+_with_help}_size \
@ -249,11 +251,14 @@ dialog_menu_confirm_delete()
[ $# -ge 1 ] || return $FAILURE [ $# -ge 1 ] || return $FAILURE
# If asked to delete only one variable, simply ask and return
if [ $# -eq 1 ]; then if [ $# -eq 1 ]; then
f_noyes "$msg_are_you_sure_you_want_to_delete" "$delete_vars" f_noyes "$msg_are_you_sure_you_want_to_delete" "$delete_vars"
return $? return $?
fi fi
# Not reached unless requested to delete multiple variables
# Generate a menu to cleanly display the variables to be deleted
local var_list local var_list
var_list=$( for var in $*; do echo "$var"; done | sort -u ) var_list=$( for var in $*; do echo "$var"; done | sort -u )
menu_list=$( menu_list=$(

View File

@ -69,6 +69,8 @@ dialog_menu_main()
local hline="$hline_arrows_tab_enter" local hline="$hline_arrows_tab_enter"
local defaultitem= # Calculated below local defaultitem= # Calculated below
# NOTE: Using a GLOBAL here because caller will need this list to turn
# the menu tag into the menu item with f_dialog_menutag2item()
RCVAR_MENU_LIST=" RCVAR_MENU_LIST="
'X $msg_exit' '$msg_exit_this_menu' 'X $msg_exit' '$msg_exit_this_menu'
${SHOW_DESC:+'$msg_exit_this_menu'} ${SHOW_DESC:+'$msg_exit_this_menu'}
@ -124,7 +126,9 @@ dialog_menu_main()
}' }'
)" )"
set -f # noglob set -f # set noglob because descriptions in the $RCVAR_MENU_LIST may
# contain `*' and get expanded by dialog(1). This prevents
# dialog(1) from expanding wildcards in the help line.
local height width rows local height width rows
eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ eval f_dialog_menu${SHOW_DESC:+_with_help}_size \

View File

@ -278,6 +278,7 @@ f_dialog_input_view_details()
local defaultitem= # calculated below local defaultitem= # calculated below
local hline="$hline_arrows_tab_enter" local hline="$hline_arrows_tab_enter"
# Calculate marks for checkboxes and radio buttons
local md=" " local md=" "
if [ "$SHOW_DESC" ]; then if [ "$SHOW_DESC" ]; then
md="X" md="X"
@ -294,6 +295,7 @@ f_dialog_input_view_details()
defaultitem="3 ($m3) $msg_show_configured" defaultitem="3 ($m3) $msg_show_configured"
fi fi
# Create the menu list with the above-calculated marks
menu_list=" menu_list="
'R $msg_reset' '$msg_reset_desc' 'R $msg_reset' '$msg_reset_desc'
'D [$md] $msg_desc' '$msg_desc_desc' 'D [$md] $msg_desc' '$msg_desc_desc'
@ -410,7 +412,9 @@ f_dialog_input_rclist()
}' }'
)" )"
set -f # noglob set -f # set noglob because descriptions in the $menu_list may contain
# `*' and get expanded by dialog(1) (doesn't affect Xdialog(1)).
# This prevents dialog(1) from expanding wildcards in help line.
local height width rows local height width rows
eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ eval f_dialog_menu${SHOW_DESC:+_with_help}_size \

View File

@ -280,9 +280,9 @@ f_dialog_input_group_gid()
# f_dialog_input_group_members [$group_members] # f_dialog_input_group_members [$group_members]
# #
# Allow the user to modify a list of members for a given group. If the user does # Allow the user to modify a list of members for a given group. If the user
# not cancel or press ESC, the $group_members variable will hold the newly- # does not cancel or press ESC, the $group_members variable will hold the
# configured value upon return. # newly-configured value upon return.
# #
f_dialog_input_group_members() f_dialog_input_group_members()
{ {

View File

@ -280,18 +280,18 @@ f_dialog_input_password()
local height1 width1 local height1 width1
f_dialog_inputbox_size height1 width1 \ f_dialog_inputbox_size height1 width1 \
"$DIALOG_TITLE" \ "$DIALOG_TITLE" \
"$DIALOG_BACKTITLE" \ "$DIALOG_BACKTITLE" \
"$prompt1" \ "$prompt1" \
"" \ "" \
"$hline" "$hline"
local height2 width2 local height2 width2
f_dialog_inputbox_size height2 width2 \ f_dialog_inputbox_size height2 width2 \
"$DIALOG_TITLE" \ "$DIALOG_TITLE" \
"$DIALOG_BACKTITLE" \ "$DIALOG_BACKTITLE" \
"$prompt2" \ "$prompt2" \
"" \ "" \
"$hline" "$hline"
# #
# Loop until the user provides taint-free/valid input # Loop until the user provides taint-free/valid input
@ -496,9 +496,9 @@ f_dialog_input_change()
$menu_list \ $menu_list \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) )
retval=$? retval=$?
f_dialog_data_sanitize date_type f_dialog_data_sanitize date_type
f_dprintf "retval=%u date_type=[%s]" $retval "$date_type" f_dprintf "retval=%u date_type=[%s]" $retval "$date_type"
# Return if user has either pressed ESC or chosen Cancel/No # Return if user has either pressed ESC or chosen Cancel/No
[ $retval -eq $SUCCESS ] || return $retval [ $retval -eq $SUCCESS ] || return $retval
@ -677,9 +677,9 @@ f_dialog_input_expire()
$menu_list \ $menu_list \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) )
retval=$? retval=$?
f_dialog_data_sanitize date_type f_dialog_data_sanitize date_type
f_dprintf "retval=%u date_type=[%s]" $retval "$date_type" f_dprintf "retval=%u date_type=[%s]" $retval "$date_type"
# Return if user has either pressed ESC or chosen Cancel/No # Return if user has either pressed ESC or chosen Cancel/No
[ $retval -eq $SUCCESS ] || return $retval [ $retval -eq $SUCCESS ] || return $retval