diff options
author | dteske <dteske@FreeBSD.org> | 2013-04-22 21:03:44 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-04-22 21:03:44 +0000 |
commit | 1a05c430de3bf7e0c89dd10a25ac1ba403928c6c (patch) | |
tree | 5b8b68815330a5308e21e7353f76783cd2e74aeb /usr.sbin/bsdconfig/share | |
parent | 57261b1059dc7ec6b497fdda62182e92995b0df3 (diff) | |
download | FreeBSD-src-1a05c430de3bf7e0c89dd10a25ac1ba403928c6c.zip FreeBSD-src-1a05c430de3bf7e0c89dd10a25ac1ba403928c6c.tar.gz |
Fix "-D file" to automagically enable debugging if not explicitly disabled.
Diffstat (limited to 'usr.sbin/bsdconfig/share')
-rw-r--r-- | usr.sbin/bsdconfig/share/common.subr | 32 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/share/media/options.subr | 24 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/share/script.subr | 37 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/share/variable.subr | 5 |
4 files changed, 69 insertions, 29 deletions
diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr index d1a3c00..8db80ea 100644 --- a/usr.sbin/bsdconfig/share/common.subr +++ b/usr.sbin/bsdconfig/share/common.subr @@ -100,23 +100,21 @@ f_debug_init() # # Process stored command-line arguments # - ( set -- "$ARGV" - while getopts d flag > /dev/null; do - case "$flag" in - d) true; exit;; - \?) continue;; - esac - done - false - ) && debug=1 - debugFile=$( set -- "$ARGV" - while getopts D flag > /dev/null; do - case "$flag" in - D) echo "$OPTARG";; - \?) continue;; - esac - done - ) + set -- $ARGV + local OPTIND + while getopts dD: flag > /dev/null; do + case "$flag" in + d) debug=1;; + D) debugFile="$OPTARG";; + \?) continue;; + esac + done + shift $(( $OPTIND - 1 )) + + # + # Automagically enable debugging if debugFile is set (and non-NULL) + # + [ "$debugFile" ] && { [ "${debug+set}" ] || debug=1; } # # Make debugging persistant if set diff --git a/usr.sbin/bsdconfig/share/media/options.subr b/usr.sbin/bsdconfig/share/media/options.subr index 2c8d3bd..5147056 100644 --- a/usr.sbin/bsdconfig/share/media/options.subr +++ b/usr.sbin/bsdconfig/share/media/options.subr @@ -111,6 +111,15 @@ f_media_options_menu() '$msg_emit_extra_debugging_output'" fi + f_getvar $VAR_NO_CONFIRM cp + if [ "$cp" ]; then menu_list="$menu_list + ' $msg_yes_to_all' 'YES' + '$msg_assume_yes_to_all_non_critical_dialogs'" + else menu_list="$menu_list + ' $msg_yes_to_all' 'NO' + '$msg_assume_yes_to_all_non_critical_dialogs'" + fi + f_getvar $VAR_TRY_DHCP cp if [ "$cp" = "YES" ]; then menu_list="$menu_list ' $msg_dhcp' 'YES' @@ -179,6 +188,11 @@ f_media_options_menu() ' $msg_media_timeout' '$cp' '$msg_timeout_value_in_seconds_for_slow_media'" + f_getvar $VAR_PKG_TMPDIR cp + menu_list="$menu_list + ' $msg_package_temp' '$cp' + '$msg_directory_where_package_temporary_files_go'" + menu_list="$menu_list ' $msg_rescan_devices' '<*>' '$msg_rerun_bsdconfig_initial_device_probe' @@ -260,6 +274,12 @@ f_media_options_menu() else export $VAR_DEBUG=1 fi ;; + " $msg_yes_to_all") + if f_getvar $VAR_NO_CONFIRM cp && [ "$cp" ]; then + unset $VAR_NO_CONFIRM + else + export $VAR_NO_CONFIRM=1 + fi ;; " $msg_dhcp") f_getvar $VAR_TRY_DHCP cp if [ "$cp" = "YES" ]; then @@ -290,6 +310,10 @@ f_media_options_menu() f_variable_get_value $VAR_MEDIA_TIMEOUT \ "$msg_please_specify_the_number_of_seconds_to_wait" ;; + " $msg_package_temp") + f_variable_get_value $VAR_PKG_TMPDIR \ + "$msg_please_specify_a_temporary_directory" + ;; " $msg_rescan_devices") f_device_rescan ;; " $msg_use_defaults") diff --git a/usr.sbin/bsdconfig/share/script.subr b/usr.sbin/bsdconfig/share/script.subr index 3ea5dd5..969e4eb 100644 --- a/usr.sbin/bsdconfig/share/script.subr +++ b/usr.sbin/bsdconfig/share/script.subr @@ -32,6 +32,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." script.subr f_include $BSDCFG_SHARE/device.subr +f_include $BSDCFG_SHARE/packages.subr f_include $BSDCFG_SHARE/variable.subr f_include $BSDCFG_SHARE/media/any.subr f_include $BSDCFG_SHARE/media/tcpip.subr @@ -151,26 +152,38 @@ f_script_load() # # Reserved words meant for scripting # -f_resword_new deviceRescan f_device_rescan + +f_resword_new loadConfig f_script_load # this file +f_resword_new deviceRescan f_device_rescan # device.subr + +# variable.subr +f_resword_new installVarDefaults f_variable_set_defaults f_resword_new dumpVariables f_dump_variables -f_resword_new loadConfig f_script_load -f_resword_new mediaClose f_media_close -f_resword_new mediaGetType f_media_get_type + +# media/common.subr f_resword_new mediaOpen f_media_open -f_resword_new mediaSetCDROM f_media_set_cdrom -f_resword_new mediaSetDOS f_media_set_dos +f_resword_new mediaClose f_media_close + +f_resword_new mediaGetType f_media_get_type # media/any.subr +f_resword_new mediaSetCDROM f_media_set_cdrom # media/cdrom.subr +f_resword_new mediaSetDOS f_media_set_dos # media/dos.subr +f_resword_new mediaSetFloppy f_media_set_floppy # media/floppy.subr +f_resword_new mediaSetNFS f_media_set_nfs # media/nfs.subr + +# media/ftp.subr f_resword_new mediaSetFTP f_media_set_ftp f_resword_new mediaSetFTPActive f_media_set_ftp_active f_resword_new mediaSetFTPPassive f_media_set_ftp_passive f_resword_new mediaSetFTPUserPass f_media_set_ftp_userpass -f_resword_new mediaSetFloppy f_media_set_floppy + +# media/httpproxy.subr f_resword_new mediaSetHTTP f_media_set_http_proxy f_resword_new mediaSetHTTPProxy f_media_set_http_proxy -f_resword_new mediaSetNFS f_media_set_nfs -f_resword_new mediaSetUFS f_media_set_ufs -f_resword_new mediaSetUSB f_media_set_usb -f_resword_new optionsEditor f_media_options_menu -f_resword_new tcpMenuSelect f_dialog_menu_select_tcp + +f_resword_new mediaSetUFS f_media_set_ufs # media/ufs.subr +f_resword_new mediaSetUSB f_media_set_usb # media/usb.subr +f_resword_new optionsEditor f_media_options_menu # media/options.subr +f_resword_new tcpMenuSelect f_dialog_menu_select_tcp # media/tcp.subr f_dprintf "%s: Successfully loaded." script.subr diff --git a/usr.sbin/bsdconfig/share/variable.subr b/usr.sbin/bsdconfig/share/variable.subr index 7a066421..f51ebd6 100644 --- a/usr.sbin/bsdconfig/share/variable.subr +++ b/usr.sbin/bsdconfig/share/variable.subr @@ -117,6 +117,7 @@ f_variable_set_defaults() setvar $VAR_NFS_SECURE "NO" setvar $VAR_NFS_TCP "NO" setvar $VAR_NFS_V3 "YES" + setvar $VAR_PKG_TMPDIR "/var/tmp" setvar $VAR_RELNAME "$UNAME_R" f_dprintf "f_variable_set_defaults: Defaults initialized." @@ -224,8 +225,12 @@ f_variable_new VAR_NFS_SECURE nfs_reserved_port_only f_variable_new VAR_NFS_TCP nfs_use_tcp f_variable_new VAR_NFS_V3 nfs_use_v3 f_variable_new VAR_NONINTERACTIVE nonInteractive +f_variable_new VAR_NO_CONFIRM noConfirm f_variable_new VAR_NO_ERROR noError f_variable_new VAR_NO_INET6 noInet6 +f_variable_new VAR_PACKAGE package +f_variable_new VAR_PKG_TMPDIR PKG_TMPDIR +f_variable_new VAR_PORTS_PATH ports f_variable_new VAR_RELNAME releaseName f_variable_new VAR_SLOW_ETHER slowEthernetCard f_variable_new VAR_TRY_DHCP tryDHCP |