summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share
Commit message (Collapse)AuthorAgeFilesLines
* Merge r248313 from stable/9 sysinstall(8) to head bsdconfig(8):dteske2013-06-237-16/+660
| | | | | | | | | | | | Add support for installation directly via HTTP. While we're here, remove the menu-item for Passive FTP (since moving to ftp(1) and switching FTPMODE to `auto' by default -- see r251613 -- the single remaining FTP menu-item works for both ftp.f.o and ftp-archive.f.o; previously each requiring separately active versus passive both work with the `auto' setting). In scripting you still have mediaSetFTPActive and mediaSetFTPPassive but the remaining FTP menu-item uses mediaSetFTP which defaults to `auto' (aforementioned SVN r251613).
* Implement the $probe_only parameter (previously unimplemented).dteske2013-06-231-3/+8
|
* Fine-tune the parsing of the URL. Re-order, comment, and add debugging todteske2013-06-232-17/+66
| | | | each case of unique URL format.
* Fix a code typo that prevented the probing of the current defaultrouterdteske2013-06-221-1/+1
| | | | in-order to pre-populate the editor.
* Oops, previous revision (r252084) broke non-full-path resolution (e.g.,dteske2013-06-221-1/+1
| | | | | ftp://ftp.freebsd.org or ftp://ftp.freebsd.org/). Now both full-path and non-full resolution is working regardless of trailing-slash.
* Trim the trailing `/' from the ftp_dir when validating that the directorydteske2013-06-221-1/+4
| | | | | | exists on the FTP server. This now means that when you specify a full-path to the repository on the FTP server that it doesn't matter whether you have a trailing `/' or not.
* Take advantage of the fact that f_getvar evaluates the $var_to_get parameterdteske2013-06-222-6/+5
| | | | | within braces, allowing all manner of parameter expansions (properly quoted or escaped, of course).
* Add missing local declaration.dteske2013-06-211-1/+1
|
* Remove unused library include.dteske2013-06-211-1/+0
|
* Alphabetize library includes.dteske2013-06-2114-26/+26
|
* Style.dteske2013-06-212-18/+10
|
* Typo and grammar fixes to comments.dteske2013-06-212-2/+2
|
* Fix a code typo in a case-statement match expression that prevented IPv6dteske2013-06-201-1/+1
| | | | URLs with port designator from working properly (e.g. http://[::1]:80/).
* Alphabetize reserved-word (resword) registration.dteske2013-06-191-4/+4
|
* Alphabetize includes.dteske2013-06-191-1/+1
|
* Change the f_dialog_{yesno,noyes}() function-arguments in `dialog.subr' todteske2013-06-181-6/+6
| | | | | | | | | | | accomodate an $hline value for overriding the default. This change does not effect any current modules as it turns out that not one single usage of either f_dialog_yesno() or f_dialog_noyes() relied on accepting more than a first argument (read: all occurrences quoted the first parameter; so $* was never depended upon). This will allow some custom invocations of --yesno and --noyes to roll over to these functions (for example, in `timezone/timezone').
* Change the f_dialog_msgbox() arguments in `dialog.subr' to accomodate andteske2013-06-181-3/+4
| | | | | | | | | | $hline argument for setting the --hline parameter value. This change does not effect any current modules as it turns out that not one single usage of f_dialog_msgbox() relied on accepting more than a first argument (read: all occurrences quoted the first parameter; so $* was never depended upon). This will allow some custom invocations of --msgbox to roll over to this function (for example, in `mouse/disable').
* Add skeleton processing of selected packages in the order in which theydteske2013-06-141-7/+42
| | | | | | should be processed. De-select each package as we "process" (actual processing still pending) each package so that if we get an error, we can return to an accurate state of selected packages.
* Make the default choice for FTP media access use "auto".dteske2013-06-112-2/+2
|
* Use f_shell_escape() instead of forking to awk. In this case, thedteske2013-06-042-5/+4
| | | | | | replacement comes with a great performance increase (as f_shell_escape() uses the built-in based f_replaceall() which out-performs forking to awk(1)). This should also improve readability slightly.
* Similar to r251236, r251242, and r251244. Introduce new function-pair todteske2013-06-042-5/+44
| | | | | | | | | | | | | | | | | dialog(1) API in dialog.subr responsible for retrieving menu-choice data (for the --menu widget). Add f_dialog_menuitem_store()/f_dialog_menuitem_fetch() for storing and retrieving the menuitem (not the tag) from a --menu widget result. The dialog --menu widget returns the `tag' from the tag/item pair of choices for a menu list. Because the menu list is often local to the function that is displaying it, the ability to dereference this into the item is not possible unless you use a global. This changes things so the function (upon successful return of dialog) dereferences the tag into the item and stores it for later retrieval using these functions. NOTE: Tags are dereferenced into items using f_dialog_menutag2item().
* Fix a code typo (missing `eval') which lead to improperly-sized menu whendteske2013-06-041-1/+1
| | | | | displaying packages (menu was always maximum height). The problem was introduced by SVN r251232.
* Fix menu accenting for the package category list. The single-space indentdteske2013-06-041-5/+5
| | | | | for duplicate initial-characters was removed for making comparisons but was not put back.
* Whitespace and comments.dteske2013-06-041-3/+3
|
* Improve debugging for f_dialog_*_constrain() to print constrained ratherdteske2013-06-041-2/+15
| | | | than unconstrained values.
* Like r250701, introduce another handy function for truncating variables to adteske2013-06-021-0/+35
| | | | specific byte-length. Works like vsnprintf(3).
* Fix a bug in which the user's choice to Cancel was not recognized. This wasdteske2013-06-021-1/+2
| | | | | | | | | caused by the standard (and correct) behavior of the shell to discard the return status of lvalue-operands in a pipe-chain. The solution is to not pipe the file-acquisition directly into sort(1) but instead store the output (allowing immediate testing of the return status) and later sort it.
* Fix a bug that would cause a spurious warning to appear to appear in andteske2013-06-021-0/+2
| | | | | | | | | | | | edge-case. The case was that you have been through the FTP setup once before and on the second time through, you cancel at the re-selection of a new FTP server. The spurious warning was "device_media: not found" and was caused because the underlying call to f_device_network_down() did not check to see if the network device existed before attempting to shut it down. Add checks to make sure we don't forge ahead unless the device exists.
* Fix a bug in which the user's choice to Cancel was not properly recognized.dteske2013-06-021-1/+5
|
* Fix a copy/paste error within a comment.dteske2013-06-021-1/+1
|
* Add some additional debugging to the common media library.dteske2013-06-021-1/+9
|
* Standardize NULL initialization to be consistent.dteske2013-06-022-2/+2
|
* Use f_isset() (introduced by r250317) instead of `f_quietly f_getvar ...'.dteske2013-06-023-9/+10
|
* Make proper use of locals in f_dialog_init().dteske2013-06-021-5/+4
|
* Improvements to whitespace and comments.dteske2013-06-023-15/+16
|
* Fix option processing from the library layer to address unexpecteddteske2013-06-022-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior(s); e.g., `-Xd' versus `-dX' did not produce the same results. The libraries common.subr and dialog.subr automatically process the arguments passed to the program and enable/disable functionality without the need to process the arguments within your program. For example, if "$@" contains `-d', common.subr will see this and enable debugging regardless of whether you process "$@" yourself or not (this automatic processing can easily be disabled for custom scripts that don't want it; see the afore- mentioned scripts for additional details). NOTE: common.subr stores a copy of "$@" in $ARGV for convenient (and repeated) processing by libraries such as dialog.subr which provide such transparent functionality for the consuming script(s). However, the libraries don't know if a program wants to accept `extra' options. Flags are not really a problem, because the library can be programmed to silently ignore unknown flags. The trouble comes into play when the program wants to define an option that takes an argument. For example: bsdconfig -D logfile -X In the above example, the library uses getopts to process $ARGV and if it doesn't know that `-D' takes an argument, the option processing will prematurely terminate on `logfile' (this is standard/correct behavior for getopts but is undesired in our situation where we have partially off-loaded main argument processing). The problem is solved by allowing the program to define an extra set of options to be included in each library's handling of $ARGV. Only options that require arguments are truly necessary to be pre-specified in this new manner.
* 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
|
OpenPOWER on IntegriCloud