summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsdconfig/share/media/ftp.subr
Commit message (Collapse)AuthorAgeFilesLines
* MFC r264840: Implement GEOM based media device classification.dteske2014-05-171-14/+15
|
* MFC r259054:dteske2014-01-151-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Performance and debugging enhancements: + Remove UNAME_P=$(...) from startup/misc -- already supplied by common.subr + Use f_getvar instead of $(eval echo \$$var) -- f_getvar is sub-shell free + Add `-e' and `-k var' options to f_eval_catch -- increasing use-cases + Use f_eval_catch to display errors on failure -- reducing duplicated code + Use f_eval_catch when we need output from a command -- improving debugging + Optimize f_isinter of strings.subr for performance -- now sub-shell free + Improve error checking on pidfiles -- using f_eval_catch and f_isinteger + Use $var_to_set arg of f_ifconfig_{inet,netmask} -- eliminate sub-shells + Use f_sprintf instead of $(printf ...) -- consolidate sub-shells + Use $var_to_set arg of f_route_get_default -- eliminate sub-shells + Add f_count to replace $(set -- ...;echo $#) -- eliminate sub-shells + Add f_count_ifs to replace $(IFS=x;set -- ...;echo $#) -- no sub-shells + Replace var="$var${var:+ }..." in loops with var="$var ..." with a follow- up var="${var# }" to trim leading whitespace -- optimize loops + Use $var_to_set arg of f_resolv_conf_nameservers -- eliminate sub-shells + Comments for the f_eval_catch function + Remove a duplicate `local ... desc ...' in f_device_get_all of device.subr + Use $var_to_set arg of f_device_capacity -- eliminate sub-shells + Whitespace fixes in f_dialog_init of dialog.subr + Optimize f_inet_atoi of media/tcpip.subr for performance -- sub-shell free + In several cases, send stderr to /dev/null -- clean up runtime execution + Change f_err of common.subr to go to program stderr not terminal stderr, allowing redirection of output from functions that use f_err + Disable debugging when using f_getvar to get variable argument to f_startup_rcconf_map_expand of startup/rcconf.subr + Use f_replace_all instead of $(echo ... | tr | sed) -- performance + Add a $var_to_set option to f_index_{file,menusel_{command,keyword}} of common.subr -- centralize sub-shells
* Introduce centralized [X]dialog(1) exit codes to `dialog.subr' and make-usedteske2013-10-091-3/+3
| | | | | | | | | | throughout the bsdconfig(8) code. While we're here, add an explicit argument to lvalue-seeking invocations of "return" that previously had no argument. Also, consolidate a single instance of double-newline and remove some comments that are no longer required (given increased readability with new exit codes). Approved by: re (glebius)
* Remove ftp5.se.f.o, as per request to -hubs@gavin2013-09-281-1/+0
| | | | | Approved by: re (glebius) MFC after: 3 days
* - Remove the is (Iceland) mirror per mail from the admins.brd2013-09-271-1/+0
| | | | | Approved by: re With hat: clusteradm@
* Remove ftp2.tr.freebsd.org, it is out of date.gavin2013-07-231-1/+0
| | | | MFC after: 3 days
* Sync-up with bsdinstall(8) FTP mirrorselect changes.dteske2013-07-221-45/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | SVN r224656: Add back ftp4, a new machine has taken its place. ftp2 and ftp8 are both IPv6 capable mirrors. cvsup4/ftp4 have already been added to the handbook. NOTE: Except put IPv6 entries in IPv6 section at the top of the list SVN r225467: Add ftp4.se.freebsd.org to the IPv4 and IPv6 mirror lists. SVN r235228: Add the IPv6 tag to ftp4.fr.freebsd.org. NOTE: Except dup entry into IPv6 section. SVN r243832: - Remove snapshots.se.freebsd.org [1] - Add ftp6.se.freebsd.org SVN r243854: Remove snapshots.jp.freebsd.org. It stopped working years ago. SVN r253543: Update mirror list to more closely match http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/mirrors-ftp.html MFC after: 1 week
* Re-implement $probe_only aspect of f_media_get_TYPE() (where TYPE is cdrom,dteske2013-07-141-8/+11
| | | | | | | | | | | | | | | | | | | | | | | nfs, ftp, http, httpproxy, etc.) and f_device_get() (abstract method for calling aforementioned f_media_get_TYPE()). Previously, if $probe_only was present and non-NULL, the TYPE functions would check for $file and exit with an appropriate error status (success if the file exists and readable, failure otherwise). While this has been retained, a pair of globals has been introduced: $PROBE_EXIST and $PROBE_SIZE (see `/usr/share/bsdconfig/media/common.subr') The $PROBE_EXIST global can be used where you need the functionality of simply testing for existence (previously the _only_ functionality). Meanwhile, the new $PROBE_SIZE global can be used to cause the TYPE function to print the size of the file (in bytes) on standard-out (or -1) if not found or an error occurs. NOTE: If an error occurs, it is logged with the dprintf function, which is visible with `-d' flag or debug=1. In many cases, where you need to get the size of a file _and_ check for its existence, you can use the return status of a $PROBE_SIZE call.
* Fix typos in the BSD License.dteske2013-07-071-2/+2
|
* Be consistent with other usr.sbin programs w/respect to the copyrightdteske2013-07-071-1/+1
| | | | wording ("All rights reserved."); I had the casing wrong on many instances.
* Use f_show_msg() instead of f_dialog_msgbox() where appropriate. The maindteske2013-07-051-3/+2
| | | | | | | | | | | | difference between these two functions: Usage: f_show_msg() $format_string [ $format_args ... ] Usage: f_dialog_msgbox() $text [ $hline ] The former lends itself well to displaying the $msg_* i18n text, prompts, etc. While the latter is better for text you do not control (error strings captured as a response from external commands) -- or if you have to control the hline.
* Implement $probe_only for the media access modules. sysinstall(8) wasdteske2013-07-041-2/+13
| | | | | | | | | | | | | | | | allowed to ignore the probe_only argument of its member functions solely because in the C language, the file accessor methods open and return a file descriptor and reading of the data is optional. In shell, the file accessor methods return data on stdout and that data should not be ignored (large files could block execution). So, we must adhere to the probe_only flags and in some cases (in the case of FTP, for example) change the `get' strategy to simply test existence and return an appropriate status. This was required because the up-coming package management stuff makes heavy use of the probe_only argument to try different package suffixes. Every media access module must implement $probe_only for the `get' accessor.
* Fine-tune the parsing of the URL. Re-order, comment, and add debugging todteske2013-06-231-11/+46
| | | | each case of unique URL format.
* 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-221-3/+2
| | | | | 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-211-4/+4
|
* Typo and grammar fixes to comments.dteske2013-06-211-1/+1
|
* 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.
* Standardize the way functions build their arguments leading up to a dialogdteske2013-06-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 portion of the dialog(1) API in dialog.subr responsible fordteske2013-06-011-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Improve portion of the dialog(1) API in dialog.subr responsible fordteske2013-05-311-8/+9
| | | | | | | | | | | | | | | | | | | | 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).
* Style nit (to be consistent across project).dteske2013-04-221-2/+2
|
* Import media selection/preparation framework (sysinstall inspired). Makesdteske2013-02-251-0/+893
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.
OpenPOWER on IntegriCloud