summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share
Commit message (Collapse)AuthorAgeFilesLines
* Standardize the way functions build their arguments leading up to a dialogdteske2013-06-025-38/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | invocation. Specifically, "top-load" your arguments and in the order in- which they will be displayed. For example, many [if not all] widgets display information in the following order, top-to-bottom (visually): + backtitle (displayed behind the widget at top-left) + title (at the top of the `window') + prompt text (just below the title and above whatever widget you choose) + Depending on widget, _one_ of the following: - menu list - radio list - check list - text input box with initial text - [Xdialog(1)] 2x or 3x text input boxes - [dialog(1)] a multi-part form - progress bar - etc. (many more widget choices) + buttons (right below the selected widget) + [dialog(1)] the hline (displayed at bottom of `window') NOTE: Xdialog(1) accepts and silently ignores --hline When building local arguments for your dialog invocation, if the value can't be cleanly loaded into a local, add "# Calculated below" to the end of the local declaration while retaining the block order of argument declarations. Move other local declarations that are not associated with this top-loading the dialog arguments to right-above where they are first-used. Also, standardize on the names of the arguments. For example, always use $prompt (instead of sometimes $msg and sometimes $prompt); use $menu_list or $shell_list or $radio_list for those respective widgets; ad nauseum. While we're doing this, flush-out full arguments for many invocations that were passing NULL strings (making it unapparent if you were staring at this one invocation what argument that NULL string was supposed to represent). Last, while we're in startup/rcconf let's remove the unnecessary use of a GLOBAL (RCCONF_MENU_LIST) for the menu_list.
* Improve the dialog(1) API in dialog.subr by adding f_dialog_default_store()dteske2013-06-021-0/+39
| | | | | | | | | | and f_dialog_default_fetch(). Operating similar to functions introduced by SVN r251236 and r251242, these functions operate as a pair for helping track the default-item data (for the --menu, --checklist, and --radiolist widgets). This replaces the direct usage of a global to store the data with an abstract method for readability and to centralize the code.
* Similar to r251236, improve the portion of dialog(1) API in dialog.subrdteske2013-06-024-64/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | responsible for retrieving stored input (for the --inputbox and --password widgets). When we (Ron McDowell and I) developed the first version of bsdconfig, it used temporary files to store responses from dialog(1). That hasn't been true for a very long time, so the need to always execute some clean-up function is long-deprecated. The function that used to perform these clean- up routines for these widgets was f_dialog_inputstr(). We really don't need f_dialog_inputstr() for its originally designed purpose as all dialog invocations no longer require temporary files. Just as in r251236, redesign f_dialog_inputstr() in the following four ways: 1. Rename f_dialog_inputstr() to f_dialog_inputstr_fetch() 2. Introduce the new first-argument of $var_to_set to reduce forking 3. Create a corresponding f_dialog_inputstr_store() to abstract storage 4. Offload the sanitization to a new function, f_dialog_line_sanitize() It should be noted that f_dialog_line_sanitize() -- unlike its cousin from SVN r251236, f_dialog_data_sanitize() -- trims leading/trailing whitespace from the user's input. This helps prevent errors and common mistakes caused by the fact that the new cdialog implementation allows the right-arrow cursor key to go beyond the last byte of realtime input (adding whitespace at the end of the typed value). While we're centralizing the sanitization, let's rewrite f_dialog_input() while we're here to likewise reduce forking. The f_dialog_input() function now expects the first argument of $var_to_set instead of producing results on standard-out. These changes greatly improve readability and also improve performance.
* Improve portion of the dialog(1) API in dialog.subr responsible fordteske2013-06-018-85/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | retrieving stored data (for the --menu, --calendar, --timebox, --checklist, and --radiolist widgets). When we (Ron McDowell and I) developed the first version of bsdconfig, it used temporary files to store responses from dialog(1). That hasn't been true for some very long time, so the need to always store the return status of dialog(1) and then call some function to clean-up is long-deprecated. The function that used to do the clean-up was f_dialog_menutag(). We really don't need f_dialog_menutag() for its originally designed purpose, as all dialog invocations (even when in a sub-shell) do not use temporary files anymore. However, we do need to keep f_dialog_menutag() around because it still fills the need of being able to abstract the procedure for fetching stored data provided by functions that display the aforementioned widgets. In re-designing f_dialog_menutag(), four important changes are made: 1. Rename f_dialog_menutag() to f_dialog_menutag_fetch() 2. Introduce the new first-argument of $var_to_set to reduce number of forks 3. Create a corresponding f_dialog_menutag_store() to abstract the storage 4. Offload the sanitization to a new function, f_dialog_data_sanitize() NOTE: That last one is important. Not all functions need to store their data for later fetching, meanwhile every invocation of dialog should be sanitized (as we learned early-on in the i18n-effort -- underlying libraries will spit warnings to stderr for bad values of $LANG and since dialog outputs its responses to stderr, we need to sanitize every response of these warnings). These changes greatly improve readbaility and also improve performance by reducing unnecessary forking.
* Fix a regression in the packages module introduced by recent r251190.dteske2013-06-011-37/+46
| | | | I somehow neglected this module in merging that API change.
* Improve portion of the dialog(1) API in dialog.subr responsible fordteske2013-05-316-840/+1129
| | | | | | | | | | | | | | | | | | | | calculating widget sizes. Instead of forking a sub-shell to calculate the optimum size for a widget, use a byRef style call-out to set variables in the parent namespace. For example, instead of: size=$( f_dialog_buttonbox_size title btitle msg ) $DIALOG --title title --backtitle btitle --msgbox msg $size The new API replaces the above with the following: f_dialog_buttonbox_size height width title btitle msg $DIALOG --title title --backtitle btitle --msgbox msg $height $width This reduces the number of forks, improves performance, and makes the code more readable by revealing the argument-order for widget sizing. It also makes performing minor adjustments to the calculated values easier as you no longer have to split-out the response (which required knowledge of ordering so was counter-intuitive).
* Fix a typo in a comment.dteske2013-05-161-1/+1
|
* Add a handy function for truncating variables to a specific byte-length. Itdteske2013-05-161-0/+20
| | | | | | should be noted that newlines are both preserved and included in said byte- count. If you want to truncate single-line values without regard to line termination, there's always f_substr() which already exists herein.
* Centralize standard getopts arguments, both for convenience and to correctdteske2013-05-142-5/+31
| | | | | | | | | a bug in which certain combinations of arguments produced unexpected results such as `-dX' (now properly produces debugging and X11), `-XS' (now properly produces X11 in secure mode), `-df-' (enables debugging when reading a script from standard-input, etc. Multi-word variations such as `-d -X', `-X -S', `-d -f-', `-d -f -', etc. also work as expected. Also tested were variations in argument order, which are now working as expected.
* Comment.dteske2013-05-121-1/+1
|
* Fix i18n violations in the package management module. A few words likedteske2013-05-122-12/+28
| | | | `packages', `installed', and `selected' were not internationalized.
* Remove duplicated string.dteske2013-05-121-1/+1
|
* Comments.dteske2013-05-121-1/+5
|
* Whitespace.dteske2013-05-121-2/+2
|
* Fix a bug that would cause the category menu to display the wrong valuedteske2013-05-091-4/+4
| | | | | for number of packages available in the "All" category. Problem caused by re-using a variable that was still needed; fixed by variable name change.
* Commit first portion of package module -- this includes the ability to viewdteske2013-05-078-1/+1238
| | | | | | | | | | categories, view packages, mark packages for installation, de-installation, or re-installation, calculate and track dependencies, as well as ability to review selections. Still to come is the actual processing of selections (performing the various actions associated with the user's selections, such as installing dependencies first, then selections, etc.).
* Re-organize and add missing installVarDefaults and mediaSetDirectory.dteske2013-05-071-15/+31
|
* Add f_isset() utility subroutine for checking if a variable is set but indteske2013-05-071-0/+10
| | | | a more readable fashion.
* Properly sanitize --menu results (guards against Gtk library warnings fromdteske2013-04-262-1/+8
| | | | | | | | | X11 side of things from bleeding into Xdialog(1) stderr output). It should be duely noted that such errors are not a by-product of anything in the Xdialog(1) utility or API, but optional libraries that it can link against (such as Gtk1 versus Gtk2; if you compile xdialog from ports against Gtk2 AND misconfigure your fonts or generally make Gtk2 unhappy, these warning messages can bleed into the captured stderr -- that is we we sanitize!).
* Comments.dteske2013-04-261-1/+1
|
* Add missing include.dteske2013-04-231-0/+1
|
* Preserve debugFile preference across the exec boundary.dteske2013-04-221-0/+1
|
* Partially uncommit r249779. The changes to share/common.subr were gooddteske2013-04-223-54/+12
| | | | | while the remaining changes were part of a much larger ``secret sauce'' involved in an up-coming commit that I'm still laboring on.
* Fix "-D file" to automagically enable debugging if not explicitly disabled.dteske2013-04-224-29/+69
|
* New helper functions for common widgets.dteske2013-04-221-0/+136
|
* Proper fix for copy/paste error (first attempt r249756).dteske2013-04-221-2/+2
|
* Fix a copy/paste error.dteske2013-04-221-2/+2
|
* Update comment for accuracy.dteske2013-04-221-3/+3
|
* Style nit (to be consistent across project).dteske2013-04-221-2/+2
|
* UI improvements. First, implement --default-item whenever and whereverdteske2013-04-222-0/+102
| | | | | | | | possible to save keystrokes. Second, overhaul startup/rcdelete for much improved performance. Last, but not least, kill-off useage of --clear and implement --keep-tite in harmony to minimize jarring transitions. Also, fix local variable names where necessary while we're here with other minor comment-enhancements/typo-corrections.
* Add new flags `-d' (sets debug=1) and `-D file' (sets debugFile) anddteske2013-04-222-22/+67
| | | | | | improve debugging initialization. Also fixup USAGE statements while we're here. Also, change initialization of main program to _not_ change working directory, allowing the debugFile to be relative without confusion.
* Remove some more references to legacy ATA.mav2013-04-041-5/+1
| | | | Submitted by: Dmitry Luhtionov <dmitryluhtionov@gmail.com>
* Import media selection/preparation framework (sysinstall inspired). Makesdteske2013-02-2522-20/+6332
| | | | | | | | | | | | | | | | | | | | | | | | | | | accessing files from various types of media nice and abstracted away from the wet-work involved in preparing, validating, and initializing those types of media. This will be used for the package management system module and other modules that need access to files and want to allow the user to decide where those files come from (either in a scripted fashion, prompted fashion, or any combination thereof). Heavily inspired by sysinstall and even uses the same reserved words so that scripts are portable. Coded over months, tested continuously through- out, and reviewed several times. Some notes about the changes: - Move network-setting acquisition/validation routines to media/tcpip.subr - The options screen from sysinstall has been converted to a dialog menu - The "UFS" media choice is renamed to "Directory" to reflect how sysinstall treats the choice and a new [true] "UFS" media choice has been added that acts on real UFS partitions (such as external disks with disklabels). - Many more help files have been resurrected from sysinstall (I noticed that some of the content seems a bit dated; I gave them a once-over but they could really use an update). - A total of 10 media choices are presented (via mediaGetType) including: CD/DVD, FTP, FTP Passive, HTTP Proxy, Directory, NFS, DOS, UFS, Floppy, USB - Novel struct/device management layer for managing the issue of passing more information than can comfortably fit in an argument list.
* Backward compatibility fix: treat cmds loaded as a script as nonInteractivedteske2013-01-201-2/+17
|
* Don't use f_show_msg() unless printf(1) syntax is required (this reduces thedteske2013-01-142-3/+3
| | | | number of unnecessary forks).
* Add new f_yesno/f_noyes wrapper functions (which take printf(1) syntax).dteske2013-01-141-0/+44
|
* Update copyright following last commit.dteske2013-01-071-1/+1
|
* Add nonInteractive support to f_dialog_yesno/noyes().dteske2013-01-071-0/+7
|
* Add support for scripting (sysinstall style).dteske2013-01-054-1/+350
| | | | Reviewed by: jilles
* Comments.dteske2013-01-031-0/+6
|
* Comments.dteske2012-12-291-1/+4
|
* Add missing enforcement of height restriction after minor adjustment.dteske2012-12-291-0/+1
|
* Add support for running without a controlling terminal (for example, whendteske2012-12-291-8/+21
| | | | running as an rvalue to a pipe).
* Allow debug output to be logged to a file (set $debugFile to target pathname)dteske2012-12-281-0/+24
| | | | or both stdout and a file (precede $debugFile pathname with a plus-sign, `+').
* Add more debugging to help with diagnosis of program-flow when needed.dteske2012-12-255-12/+47
|
* Change axiom for initialization. Including script can disable (default)dteske2012-12-211-1/+4
| | | | automatic initialization by setting appropriate variable to particular value.
* New f_show_info() function for dialog(1) --infobox using printf(1) syntax.dteske2012-12-211-0/+21
|
* Use f_show_help() where printf(1) syntax is desired.dteske2012-12-211-4/+2
|
* Improve the debugging abilities and clean up debug messages. In most cases,dteske2012-12-212-7/+33
| | | | | all one has to do is set the environment variable DEBUGGING to get the debug messages to appear on the console.
* Add much-needed dialog(1) --inputbox function for simplifying the process ofdteske2012-12-211-2/+48
| | | | requesting input from the user.
OpenPOWER on IntegriCloud