Commit Graph

311 Commits

Author SHA1 Message Date
Devin Teske
4e918fd37b Sort function output on name of the function. 2013-11-30 23:47:18 +00:00
Devin Teske
41166e501a Fix an issue where additional lines of a function definition didn't line
up with the primary (leading) line of syntax.
2013-11-29 04:09:25 +00:00
Devin Teske
1c707e42a9 Fix an issue where the leading `+' sign before a function name was not
displayed unless color was requested.
2013-11-29 04:08:21 +00:00
Devin Teske
84dfba8d18 Sort messages. 2013-11-25 20:37:53 +00:00
Devin Teske
1833362dc3 Add missing newline to printf format string. 2013-11-25 20:29:26 +00:00
Devin Teske
f18d3c4116 Add missing $' before variable name pgm'. Unnoticed unless running
parallel concurrent copies of `bsdconfig syscons_ttys'.
2013-11-25 20:28:39 +00:00
Devin Teske
2cc6c69d05 Improve network device scanning in the netdev module. First, make it use the
`device.subr' framework (improving performane and reducing sub-shells). Next
improve the `device.subr' framework itself. Make use of the `flags' device
struct member for network interfaces to indicate if an interface is Active,
Wired Ethernet, or 802.11 Wireless. Functions have been added to make checks
against the `flags' bit-field quick and efficient. Last, add function for
rescanning the network to update the device registers. Remove an unnecessary
local (ifn) while we're here (use already provided local `if').
2013-11-22 00:32:32 +00:00
Devin Teske
de7b456e59 f_die() (see `bsdconfig includes -dF die') uses a dialog box (and has been
documented as such; I just forgot). These utilities are command-line only
and as such should stick to either using f_die without arguments or printf)
2013-11-21 19:43:45 +00:00
Devin Teske
329a440f43 Remove unused line -- cruft left over from SVN r258360. 2013-11-21 17:49:56 +00:00
Devin Teske
4128cd31c1 Quote the interface name for good measure. 2013-11-21 03:22:13 +00:00
Devin Teske
c5f2a20e13 Update function description for API tool:
bsdconfig includes -dF f_validate_hostname
2013-11-20 22:12:21 +00:00
Devin Teske
630c6be951 Make -d' implicitly enable -f' for simplification. 2013-11-20 22:11:42 +00:00
Devin Teske
924d459045 Add a `-d' flag for printing the description of each function. 2013-11-20 21:05:33 +00:00
Devin Teske
ad8f8a1f5e Add new `includes' module for exploring the bsdconfig(8) API. 2013-11-20 20:37:21 +00:00
Devin Teske
721819bedb Whitespace, style, sub-shells, and standardize variable name
(s/interfaces/menu_list/).
2013-11-20 00:17:57 +00:00
Tom Rhodes
4c9e27bd0a "Tim trailing" -> "Trim trailing" 2013-11-19 19:55:41 +00:00
Devin Teske
ebd672f58f Fix package installation from physical media such as DVD.
Discussed with:	re (gjb)
MFC after:	3 days
2013-11-17 17:53:55 +00:00
Devin Teske
6ef6ba9950 Always shutdown the media when we're exiting the packages module (prevents
errors on re-entry for physical media). Also, while we're here, stop
ejecting the CDROM when we're done with it (but leave the functions for
later use so that we could perhaps -- from the installer standpoint -- use
it to eject the media after an install).

MFC after:	3 days
2013-11-17 17:48:55 +00:00
Devin Teske
ee5ef711b7 Improve debugging with f_eval_catch() introduced by SVN r257784 and also
fix a bug where "pkg update" was not getting the value of PACKAGESITE.
NB: PACKAGESITE needs to be explicitly exported in support of children.

MFC after:	3 days
2013-11-17 17:42:15 +00:00
Devin Teske
673b5bb7f7 Kick an unused orphan to the curb ;) 2013-11-17 17:35:51 +00:00
Devin Teske
84873facb2 Move function name declaration to top of function (where it is closest to
the value it needs to be), s/fname/funcname/g, and move function name usage
to within printf format string.

MFC after:	3 days
2013-11-17 17:31:07 +00:00
Devin Teske
b2b4a04e9e Comments. 2013-11-12 04:02:51 +00:00
Devin Teske
eee23b7cff Remove the env(1) but keep the var. 2013-11-11 02:02:05 +00:00
Glen Barber
6e12e3646d Unbreak the installer on head/:
When bsdinstall(8) sources the bsdconfig(8) common.subr file,
  PKG_ABI is set by calling 'pkg -vv' and searching for the ABI
  pkg(8) will use.

  When pkg(8) is run for the first time, the bootstrap process
  is run, which prompts for 'y/N' input from stdin if running with
  TERM set.

  Since TERM is set and it is the first time pkg(8) is run, which
  happens automatically, bsdinstall(8) hangs waiting for user input
  which is never displayed since a specific line is expected by
  awk(1), and stdin is expected by pkg(8).

  Set ASSUME_ALWAYS_YES=1, which will cause pkg(8) to assume the
  '-y' flag is also used for the bootstrap process, allowing
  bsdinstall(8) to proceed to the keymap lookup, otherwise
  bsdinstall(8) appears to hang after selecting 'Install' from the
  menu on first boot from CDROM.
2013-11-11 01:42:59 +00:00
Devin Teske
29b5dbe844 Use `pkg -vv' to obtain ABI for validating a chosen media server (done
prior to diving head-long into a pkg-update(8), et. al). This should
also be more future-proof than what was being done just before this.
2013-11-07 21:38:46 +00:00
Devin Teske
6451dd7e0f Fix cosmetic typos (since the typo's in the variable names were copied
and pasted, it wasn't noticed).
2013-11-07 21:16:32 +00:00
Devin Teske
632d9a080c Replace pkg-tools with pkgng. 2013-11-07 12:40:42 +00:00
Devin Teske
3d5fedd33e Fix an off-by-one error that was causing menus to look funny. 2013-11-07 11:20:50 +00:00
Devin Teske
1c6d60de93 Comments. 2013-11-07 10:48:00 +00:00
Devin Teske
0efb8b7a98 Add f_sprintf() and f_vsprintf() to go along with previously added
f_snprintf() and f_vsnprintf() (size-constraint) functions.
2013-11-07 10:47:12 +00:00
Devin Teske
62c7db8a8a Fix a bug where a format with leading `-' could be mistaken for printf
getopts argument(s).
2013-11-07 10:45:25 +00:00
Devin Teske
f1d6beba07 Comments. 2013-11-07 10:44:24 +00:00
Devin Teske
ebee96b642 Add some helpful debugging (showing the resolved host address). 2013-11-07 10:40:19 +00:00
Devin Teske
e9bd9b3f19 Fix a silly bug that would result in attempting to fetch (literally) the
URI "httpDirectory" (oops).
2013-11-07 10:36:24 +00:00
Devin Teske
91d20ba0f7 Use dialog(1) to obtain maximum-size; stty fails when running in a pipe-
chain. This allows dialogs to reach full size even when executed as an
rvalue operand to a pipe (e.g., cat file | bsdconfig -f-).
2013-11-07 10:30:20 +00:00
Devin Teske
bdf4b1764e Add an f_eval_catch() function for debugging individual commands in a
series of commands. Accepts the `-d' flag as a first argument to skip
displaying messages in a dialog box. The command is logged as it
appears to the shell prior to the first pass of parameter expansion to
allow copy/pasting into a real shell (opposed to simply echo'ing the
command which would produce debug output that has undergone at least one
pass of parameter expansion, thus no-longer copacetic for copy/paste).
Takes printf(1) style syntax and a utility identifier for error messages.
2013-11-07 10:28:12 +00:00
Devin Teske
8a316c0005 Add an f_show_err() function -- acts pretty much the same as f_show_msg()
except it stylizes the msgbox widget to indicate an Error has occurred by
setting an appropriate title and default message.
2013-11-07 10:23:37 +00:00
Devin Teske
57f3f6ee5d Add global DEBUG_INITIALIZE_FILE environment variable for controlling
whether the debugFile is truncated upon initialization (useful for when
children implicitly re-initialize debugging and you want children to
append to your existing debugFile).
2013-11-07 10:20:19 +00:00
Devin Teske
3e8cb79d0a Comments. Replace a funny syntax with f_isset() while here. 2013-11-07 10:14:40 +00:00
Devin Teske
9e2c4ab64f Whitespace. 2013-11-07 10:09:01 +00:00
Devin Teske
0a9f7376ad Fix a bug that resulted in spurious error message "f_media_shutdown_http:
not found" from /usr/libexec/bsdconfig/030.packages/packages.
2013-11-06 18:43:16 +00:00
Devin Teske
4b939b1160 Add support for dereferencing SRV records via f_host_lookup(). Takes the
media choice into consideration for determining the appropriate SRV records
to query (e.g., _http._tcp, _ftp._tcp, _nfs.tcp, _nfs.udp, etc.).
2013-11-06 18:26:38 +00:00
Devin Teske
9acbeddc57 Fix signed integer overflow detection in f_expand_number() of strings.subr.
Approved by:	re (glebius)
2013-10-12 19:52:27 +00:00
Devin Teske
a96ea66f3d Add new f_expand_number() (shadowing expand_number(3)).
Approved by:	re (glebius)
2013-10-11 20:12:30 +00:00
Devin Teske
1bd2b932a5 Store descriptions for DEVICE_TYPE_DISK and fix static-defaults mapping.
Add a default description for bhyve block disk device while we're here.

Approved by:	re (glebius)
2013-10-11 20:10:41 +00:00
Devin Teske
0c20fe6fda Add $VAR_ZFSINTERACTIVE (zfsInteractive) and new f_zfsinteractive() for
determining when a script wants to be nonInteractive but selectively
wants ZFS operations to be *interactive* (this is analgous to already
existing $VAR_NETINTERACTIVE (netInteractive) and f_netinteractive()
used for the same purpose (script wants to be nonInteractive but wants
network operations to be *interactive*).

Approved by:	re (glebius)
2013-10-11 20:08:34 +00:00
Devin Teske
efa13f7e0b Fix a bug that would occur in application death when debugging was enabled
if you ended up in f_dialog_*_constrain() (indirectly, of course) with a
purposefully-set NULL height, width, or rows parameter (because you didn't
care to have that attribute calculated). Fix typo in a comment while here.

Approved by:	re (glebius)
2013-10-11 20:07:04 +00:00
Devin Teske
3636c2354e Add keymap.subr for presenting custom keymap dialogs (with X11 support).
Approved by:	re (glebius)
2013-10-11 18:21:05 +00:00
Devin Teske
5bd5e0c398 Add a USE_DIALOG global (analogous to USE_XDIALOG); useful for inserting
text into a prompt or command syntax iff dialog(1) is in-use.

Approved by:	re (glebius)
2013-10-11 18:14:49 +00:00
Devin Teske
fcaed0c1a5 Fix a minor bug; if strings.subr was included by itself it may not have
access to f_dprintf from common.subr -- fix this by including common.subr.

Approved by:	re (glebius)
2013-10-11 17:54:22 +00:00