rcdelete (251244) | rcdelete (251264) |
---|---|
1#!/bin/sh 2#- 3# Copyright (c) 2012-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# | 1#!/bin/sh 2#- 3# Copyright (c) 2012-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/rcdelete 251244 2013-06-02 09:02:12Z dteske $ | 27# $FreeBSD: head/usr.sbin/bsdconfig/startup/rcdelete 251264 2013-06-02 20:02:50Z dteske $ |
28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." "$0" 34f_include $BSDCFG_SHARE/dialog.subr 35f_include $BSDCFG_SHARE/mustberoot.subr --- 105 unchanged lines hidden (view full) --- 141} 142 143# dialog_menu_main 144# 145# Display the dialog(1)-based application main menu. 146# 147dialog_menu_main() 148{ | 28# 29############################################################ INCLUDES 30 31BSDCFG_SHARE="/usr/share/bsdconfig" 32. $BSDCFG_SHARE/common.subr || exit 1 33f_dprintf "%s: loading includes..." "$0" 34f_include $BSDCFG_SHARE/dialog.subr 35f_include $BSDCFG_SHARE/mustberoot.subr --- 105 unchanged lines hidden (view full) --- 141} 142 143# dialog_menu_main 144# 145# Display the dialog(1)-based application main menu. 146# 147dialog_menu_main() 148{ |
149 local hline="$hline_arrows_tab_enter" 150 local prompt="" | 149 local prompt= 150 local menu_list=" 151 'X $msg_exit_cancel' '$msg_exit_cancel_desc' 152 ${SHOW_DESC:+'$msg_exit_cancel_help'} 153 '> $msg_delete_selected' '$msg_delete_selected_desc' 154 ${SHOW_DESC:+'$msg_delete_selected_help'} 155 '> $msg_all' '$msg_all_desc' 156 ${SHOW_DESC:+'$msg_all_help'} 157 '> $msg_none' '$msg_none_desc' 158 ${SHOW_DESC:+'$msg_none_help'} 159 ${USE_XDIALOG:+ 160 '> $msg_view_details' '$msg_view_details_desc' 161 ${SHOW_DESC:+'$msg_view_details_help'} 162 } 163 " # END-QUOTE |
151 local defaultitem= # Calculated below | 164 local defaultitem= # Calculated below |
165 local hline="$hline_arrows_tab_enter" |
|
152 153 # 154 # [Re-]Accent the menu list before incorporating it 155 # 156 local rcconf_var details help menu_buf delete 157 eval set -- $RCCONF_MENU_LIST 158 while [ $# -gt 0 ]; do 159 rcconf_var="$1" details="$2" delete= --- 13 unchanged lines hidden (view full) --- 173 else 174 details="[ ]${details#???}" 175 fi 176 177 # Update buffer with modified elements 178 menu_buf="$menu_buf 179 '$rcconf_var' '$details' ${SHOW_DESC:+'$help'}" # End-Quote 180 done | 166 167 # 168 # [Re-]Accent the menu list before incorporating it 169 # 170 local rcconf_var details help menu_buf delete 171 eval set -- $RCCONF_MENU_LIST 172 while [ $# -gt 0 ]; do 173 rcconf_var="$1" details="$2" delete= --- 13 unchanged lines hidden (view full) --- 187 else 188 details="[ ]${details#???}" 189 fi 190 191 # Update buffer with modified elements 192 menu_buf="$menu_buf 193 '$rcconf_var' '$details' ${SHOW_DESC:+'$help'}" # End-Quote 194 done |
195 menu_list="$menu_list $menu_buf" |
|
181 | 196 |
182 local menu_list=" 183 'X $msg_exit_cancel' '$msg_exit_cancel_desc' 184 ${SHOW_DESC:+'$msg_exit_cancel_help'} 185 '> $msg_delete_selected' '$msg_delete_selected_desc' 186 ${SHOW_DESC:+'$msg_delete_selected_help'} 187 '> $msg_all' '$msg_all_desc' 188 ${SHOW_DESC:+'$msg_all_help'} 189 '> $msg_none' '$msg_none_desc' 190 ${SHOW_DESC:+'$msg_none_help'} 191 ${USE_XDIALOG:+ 192 '> $msg_view_details' '$msg_view_details_desc' 193 ${SHOW_DESC:+'$msg_view_details_help'} 194 } 195 $menu_buf 196 " # END-QUOTE 197 | |
198 set -f # noglob (descriptions in $RCCONF_MENU_LIST may contain *) 199 200 local height width rows 201 eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ 202 height width rows \ 203 \"\$DIALOG_TITLE\" \ 204 \"\$DIALOG_BACKTITLE\" \ 205 \"\$prompt\" \ --- 33 unchanged lines hidden (view full) --- 239# dialog_menu_confirm_delete $var1 [$var2 ...] 240# 241# Get the user's blessing to delete one or more variables. Returns success if 242# (and only-if) the user confirms (does not press ESC or Cancel/NO). Does NOT 243# return the user's menu-choice. 244# 245dialog_menu_confirm_delete() 246{ | 197 set -f # noglob (descriptions in $RCCONF_MENU_LIST may contain *) 198 199 local height width rows 200 eval f_dialog_menu${SHOW_DESC:+_with_help}_size \ 201 height width rows \ 202 \"\$DIALOG_TITLE\" \ 203 \"\$DIALOG_BACKTITLE\" \ 204 \"\$prompt\" \ --- 33 unchanged lines hidden (view full) --- 238# dialog_menu_confirm_delete $var1 [$var2 ...] 239# 240# Get the user's blessing to delete one or more variables. Returns success if 241# (and only-if) the user confirms (does not press ESC or Cancel/NO). Does NOT 242# return the user's menu-choice. 243# 244dialog_menu_confirm_delete() 245{ |
247 local hline="$hline_arrows_tab_enter" | |
248 local prompt="$msg_are_you_sure_you_want_delete_the_following" | 246 local prompt="$msg_are_you_sure_you_want_delete_the_following" |
249 local var_list menu_list | 247 local menu_list # Calculated below 248 local hline="$hline_arrows_tab_enter" |
250 251 [ $# -ge 1 ] || return $FAILURE 252 253 if [ $# -eq 1 ]; then 254 f_noyes "$msg_are_you_sure_you_want_to_delete" "$delete_vars" 255 return $? 256 fi 257 | 249 250 [ $# -ge 1 ] || return $FAILURE 251 252 if [ $# -eq 1 ]; then 253 f_noyes "$msg_are_you_sure_you_want_to_delete" "$delete_vars" 254 return $? 255 fi 256 |
257 local var_list |
|
258 var_list=$( for var in $*; do echo "$var"; done | sort -u ) 259 menu_list=$( 260 . "$RC_DEFAULTS" 261 source_rc_confs 262 echo "$var_list" | awk ' 263 BEGIN { 264 prefix = "" 265 } --- 148 unchanged lines hidden --- | 258 var_list=$( for var in $*; do echo "$var"; done | sort -u ) 259 menu_list=$( 260 . "$RC_DEFAULTS" 261 source_rc_confs 262 echo "$var_list" | awk ' 263 BEGIN { 264 prefix = "" 265 } --- 148 unchanged lines hidden --- |