Commit Graph

447 Commits

Author SHA1 Message Date
Devin Teske
f589320a0e Rewrite usermgmt -- hooking it into the scripting system with dispatch
commands addUser, deleteUser, and editUser. Getting rid of the awkward-
to-use `userinput' bolt-on which Ron and I talked about rewriting.
2014-03-14 03:42:05 +00:00
Devin Teske
b00c7d1aa2 Add protection against input containing single-quotes (e.g., i18n-users). 2014-03-14 03:37:08 +00:00
Devin Teske
863bb16483 For non-interactive scripts, forgot to check we were given an argument
before proceeding.
2014-03-14 03:34:43 +00:00
Devin Teske
faae0586c2 Fix a bug preventing errors from pw(8) from filtering up to a dialog.
Programs running as rvalue to pipe cannot access current namespace.
2014-03-14 03:33:03 +00:00
Devin Teske
160c413360 Reduce the sleep cycle when using dialog(1) to 1-second. 2014-03-14 03:28:21 +00:00
Devin Teske
7bac4bd22a Fix comments and whitespace. 2014-03-14 03:25:33 +00:00
Devin Teske
072b47f31c Fix a code-typo that prevented auto-sizing of the dialog. 2014-03-14 03:15:02 +00:00
Devin Teske
2fb115122e Point hat! Fix a broken f_isinteger(). 2014-03-14 03:00:02 +00:00
Devin Teske
bc3f5ec90b Remove useless NULL string '' in compound strings. Look very closely. 2014-03-14 02:56:49 +00:00
Devin Teske
ad40259ce6 Fix future namespace issues for functions taking $var_to_set -- functions
taking a variable to set need to make sure they protect their locals; if
$var_to_set positional argument coincides with a local the expected call
to `setvar' will fail to reach outside of the function's namespace. When
such collisions are experienced (as I did in the rewrite of usermgmt) the
solution is to append a full or abbreviated version of the function name
to the local (ultimately eliminating collisions). This is rarely needed
and only occurs when you have a lot of like-named functions that pass
very similar $var_to_set positional arguments to each other (such as-is
the case with an expansive library such as `dialog.subr').
2014-03-14 02:50:32 +00:00
Devin Teske
4328ca3e04 Update copyright. 2014-03-14 02:40:52 +00:00
Devin Teske
96f88f0f56 Comments. 2014-03-14 02:39:42 +00:00
Devin Teske
c4364d0177 Add debug statement just before attempting to exec a module. 2014-03-14 02:38:56 +00:00
Devin Teske
83e449a35a Remove indexfile from debug statement as it is already logged by
f_index_menusel_command() used just-prior to this debug statement.
Also, log the arguments being passed to the resword.
2014-03-14 02:37:39 +00:00
Devin Teske
931e2be620 Remove vestigial global, no-longer used since SVN r262904. 2014-03-10 21:37:40 +00:00
Devin Teske
bfb8efd0ed Whitespace. 2014-03-10 21:35:27 +00:00
Devin Teske
073972f1a9 Take a group name on the command-line if available. 2014-03-07 22:29:00 +00:00
Devin Teske
e86ab4813c Fix copy/paste error in a comment. 2014-03-07 22:24:53 +00:00
Devin Teske
9aab41b1c2 Change dipatch words from group* to *Group to backward compatible with
ye-olden sysinstall(8).
2014-03-07 22:17:35 +00:00
Devin Teske
27c43fe1f3 Rewrite groupmgmt -- hooking it into the scripting system with dispatch
commands groupAdd, groupDelete, and groupEdit. Getting rid of the awkward-
to-use `groupinput' bolt-on which Ron and I talked about rewriting.
2014-03-07 20:44:19 +00:00
Devin Teske
33db33a752 Comment -- to go with NL global introduced (but not mentioned) by r262901 2014-03-07 20:32:26 +00:00
Devin Teske
05a0a04aee s/__number/__num/ for code clarify but more to prevent localization of
__number if passed as the var_to_set argument.
2014-03-07 20:29:19 +00:00
Devin Teske
4bed406fb7 Centralize function name. Update a comment while here. 2014-03-07 20:24:59 +00:00
Devin Teske
67602532c3 Make f_show_err non-fatal. 2014-03-07 20:20:27 +00:00
Devin Teske
2a2674499e Fix incorrect return status if var_to_set and var_to_get are the same. 2014-03-07 20:18:39 +00:00
Devin Teske
9680f649c5 Fix a typo in a comment. 2014-03-07 20:15:52 +00:00
Devin Teske
a51550b4d6 Add missing local declaration. 2014-03-07 20:15:08 +00:00
Devin Teske
e5cb2e6913 Allow dispatched reswords to carry arguments. Fix a comment while here. 2014-03-07 20:12:59 +00:00
Devin Teske
3405870c3d Dummy commit (s/__num/__number/) in f_expand_number() to describe that the
previous commit here (SVN r260894) was [in-part] from Submitted-by:
Christoph Mallon <christoph.mallon@gmx.de>

MFC after: 3 days
2014-01-20 03:31:16 +00:00
Devin Teske
ae978c3682 Optimize f_expand_number(), improving performance.
MFC After:	3 days
2014-01-19 21:02:24 +00:00
Glen Barber
547c099adb Export 'REPOS_DIR' when the selected source medium for package
installation is cdrom.  This enables bsdconfig(8) to make use
of the on-disc pkg(8) repository configuration, which fixes
package selection and installation from the dvd installer.

MFC after:	3 days
M-MFC-With:	r259426
X-MFC-Before:	-RC3
Sponsored by:	The FreeBSD Foundation
2013-12-15 20:47:27 +00:00
Devin Teske
59d9c9e1c6 Fix failed attempt to send pkg(8) stderr to /dev/null
MFC after:	3 days
2013-12-09 01:30:20 +00:00
Devin Teske
d4ae33f072 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
2013-12-07 00:31:01 +00:00
Glen Barber
b24db45b3f Fix PKG_ABI detection in bsdconfig(8) after pkg-1.2 is released, since
the format of 'pkg -vv' output has changed.

MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2013-12-02 19:02:58 +00:00
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
Simon J. Gerraty
3caf0790a8 Merge head@256284 2013-10-13 02:35:19 +00:00
Simon J. Gerraty
4fd0d10e0f New dependencies 2013-10-13 00:22:44 +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
Devin Teske
6bfa4a638c Add support for obtaining the capacity of disks. Add comment while here.
Approved by:	re (glebius)
2013-10-11 17:52:43 +00:00
Devin Teske
f677a9e267 Introduce centralized [X]dialog(1) exit codes to `dialog.subr' and make-use
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)
2013-10-09 08:12:26 +00:00
Gavin Atkinson
582071bd52 Remove ftp5.se.f.o, as per request to -hubs@
Approved by:	re (glebius)
MFC after:	3 days
2013-09-28 13:58:21 +00:00
Brad Davis
59ecdf43de - Remove the is (Iceland) mirror per mail from the admins.
Approved by:	re
With hat: clusteradm@
2013-09-27 11:25:37 +00:00
Devin Teske
cda7fc92b7 Fix a bug in HTTP checking/fetching.
Fix a bug in HTTP checking/fetching. Add Main Site to HTTP menu. Add new
example script browse_packages_http.sh and move existing example script
browse_packages.sh -> browse_packages_ftp.sh

Reviewed by:	gjb, brd
Approved by:	re (gjb), clusteradm (brd)
MFC after:	3 days
2013-09-23 16:47:52 +00:00
Devin Teske
05f7eb31a2 Remove unnecessary mediaClose (FTP operations are done with either ftp(1)
or fetch(1), neither of which are stateful, compared to how sysinstall(8)
did FTP operations, maintaining an open session until mediaClose).
2013-09-07 03:27:13 +00:00
Devin Teske
7e9ed73522 Long URLs don't always appear even with autosizing and other tricks. So,
add some whitespace to put the URL on a line by itself, maximizing view.
2013-09-07 03:24:22 +00:00
Gavin Atkinson
9c99f4d7e7 Remove ftp2.tr.freebsd.org, it is out of date.
MFC after:	3 days
2013-07-23 12:20:27 +00:00
Devin Teske
d99d4be64a Sync-up with bsdinstall(8) FTP mirrorselect changes.
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
2013-07-22 13:56:35 +00:00
Devin Teske
dde7be41df Re-implement $probe_only aspect of f_media_get_TYPE() (where TYPE is cdrom,
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.
2013-07-14 03:08:52 +00:00
Devin Teske
c0adcdb9c1 Introduce a new [yet unused] function for [efficiently] getting the path to
an executable by-name without forking or using externals.

In a performance benchmark of 10,000 runs on circa 2006 hardware, f_which
out-performed `which' with an average completion time of ~2.5 seconds versus
~56 seconds.

This should be handy for future use (not that I make it a habit to call
`which' in a loop 10,000 times).
2013-07-10 22:45:07 +00:00
Devin Teske
8a86b3cb2c Adjust comments to fit within 80-columns. 2013-07-09 23:21:57 +00:00
Devin Teske
4f8a4fa5f9 Fix conditional (der should match the comment above it).
MFC after:	1 day
2013-07-09 22:01:05 +00:00
Devin Teske
7d3a5a3b09 Do two things: First, don't obscure the backtitle. Second, read ~/.dialogrc
if it exists to determine if use_shadow is true (ON) or false (OFF).

The purpose of determining the value of use_shadow is to know how many lines
to subtract from the maximum height value in assuring that the backtitle is
not obscured.

The detriment of obscuring the backtitle is that it provides information
that is not easily obtained elsewhere. That is the command-line shortcut
used to access the current menu. As you navigate from one dialog to the
next, invariably transparently corssing module boundaries, the backtitle
represents the command-line argument used to get there. Obscuring this
information with a widget that is too-tall and/or too-wide would see that
data go unnoticed (leaving few other ways to get that information in the
same helpful context).

So despite the fact that this change reduces the standard maximum height for
all widgets, there is a trap-door to prevent this calculation. If you want
to utilize the full screen height on the terminal (remember, this adjustment
is not made for Xdialog(1)) you can set $NO_BACKTITLE to 1 (or any non-NULL
value for that matter) and this calculation will be skipped. You will be
able to draw a widget that partially obscures the backtitle if-necessary.

MFC after:	1 day
2013-07-09 21:53:57 +00:00
Devin Teske
8e37a7c8b9 Fix typos in the BSD License. 2013-07-07 18:51:44 +00:00
Devin Teske
dfe61b44b0 Be consistent with other usr.sbin programs w/respect to the copyright
wording ("All rights reserved."); I had the casing wrong on many instances.
2013-07-07 18:34:36 +00:00
Devin Teske
f8ea072a54 Be consistent with other usr.sbin programs w/respect to the copyright
wording ("All rights reserved."); I had the casing wrong on many instances.
2013-07-07 18:21:30 +00:00
Devin Teske
39c229261f Don't prevent the user from hanging their system by changing network
settings while NFS mounts are active; but DO warn them and make the
default action to do nothing. (thanks julian)
2013-07-05 23:16:56 +00:00
Devin Teske
636621d9d9 Check for INDEX file first before anything else when processing modules. 2013-07-05 22:25:40 +00:00
Devin Teske
4b97e14f62 Check menuitem before calculating tag. 2013-07-05 22:24:43 +00:00
Devin Teske
52d41f916e Add the necessary code to reinstall packages. Both scripted access
(packageReinstall) and UI access have been tested successfully with a
variation of different situations including:
+ Reinstall a package for which no other packages depend
+ Purposefully do thinks like reinstall a package that is not installed
+ Try to reinstall a package which other installed packages still depend

NOTE: There is no "force" used; if a package is required by other packages,
it will not be uninstalled (and therefore no reinstall is done).
2013-07-05 21:40:31 +00:00
Devin Teske
4254e87dbc Remove superfluous continue at end of loop. (pointy-hat) 2013-07-05 21:32:54 +00:00
Devin Teske
1da51566d5 Add support for processing add-on modules from /usr/local/libexec/bsdconfig
(this is designed to allow new modules to be installed via ports/packages).

To prevent conflict with itself (sysutils/bsdconfig) as a port (which
installs its base modules to the above directory, it was long-ago decided
that so-called `base' modules would look different than now-defined `add-on'
modules. The structure of the contents for each is the same, but the naming
convention for the module directory must be different.

Base modules are named `[0-9][0-9][0-9].*' to allow SysV-style organization
while add-on modules must avoid this naming style and are simply listed in
alphabetical order by their module directory.

For example, a hypothetical port named `bsdconfig-jails' could install
/usr/local/libexec/bsdconfig/jails and provide `bsdconfig jails' as well as
a new menu entry in the main-menu.

Add-on modules are listed in the main-menu (when bsdconfig is executed with-
out arguments) below a separator after the last base-module.

In `bsdconfig -h' output, add-on modules are listed right alongside base
modules (sorted alphabetically in columnar fashion; left-to-right).

If a base module declares a keyword used by an add-on module, the base
module will always win when given `bsdconfig keyword' syntax.

Add-on modules should avoid declaring any keyword found in `script.subr' as
a reserved-word (`Resword') since bsdconfig also supports `bsdconfig resword'
as a fall-back if no keyword is found to be declared by any module.
2013-07-05 20:13:00 +00:00
Devin Teske
c6470c75f5 Oops, r252833 was not supposed to touch this file. Back-out and recommit
this file with the rest of the files it was supposed to go with.
2013-07-05 20:01:07 +00:00
Devin Teske
e363bf2b1d Don't calculate the tag until we know that we're going to make a new menu
item entry. Also join simple NULL assignments into a single line.
2013-07-05 19:57:40 +00:00
Devin Teske
52c2fbe8a9 Oops, r252810 forgot to hook the new example file (browse_packages.sh) into
the Makefile.
2013-07-05 18:50:17 +00:00
Devin Teske
fc20233076 Adhere to 80-column width. 2013-07-05 18:31:26 +00:00
Devin Teske
e153f92628 Document remaining undocumented modules (and remove my silly place-holder
thing at the top, which I was using as a way to make sure I didn't forget
to document any modules).
2013-07-05 18:30:43 +00:00
Devin Teske
f9b9df7f0e Make a correction to the description of invocation with-versus-without
arguments, making things a bit more clear [hopefully].
2013-07-05 18:29:09 +00:00
Devin Teske
37b6146ea3 Document new -d' and -D file' debugging options. 2013-07-05 18:03:00 +00:00
Devin Teske
2a5bf6db9a Change default FTP server (s/ftp-archive/ftp/). 2013-07-05 17:56:15 +00:00
Devin Teske
f0157ce528 Add example shell script for creating a local INDEX file that can be
accessed quickly for browsing a list of available packages.
2013-07-05 17:54:08 +00:00
Devin Teske
b7df1596cf Update HISTORY. 2013-07-05 17:45:54 +00:00
Devin Teske
2902415180 Rest in peace Ron (Ron McDowell Jul.12, 1955 - Aug.26, 2012).
I'll carry-on from here. Thank you so much for your hard work.
2013-07-05 17:44:53 +00:00
Devin Teske
071e3e3997 Update e-mails. 2013-07-05 17:38:54 +00:00
Devin Teske
8c1a61f605 Since r251908, bsdconfig(8) has no direct ties to sade(8) (instead uses
`bsdinstall partedit'). Update references (s/sade/bsdinstall/) and change
the BUGS section to be based on reality.
2013-07-05 17:35:13 +00:00
Devin Teske
318645e0d2 Don't refer to a port manual. 2013-07-05 17:31:05 +00:00
Devin Teske
01dc132c3a mdoc: begin sentences on a new line. 2013-07-05 17:27:55 +00:00
Devin Teske
b07efdb566 Update date on the back of r252802. 2013-07-05 17:23:00 +00:00
Devin Teske
39346a432d Fix a typo. 2013-07-05 17:22:10 +00:00
Devin Teske
a504f1acf5 Whitespace. 2013-07-05 17:21:40 +00:00
Devin Teske
7079fc4e02 Use f_show_msg() instead of f_dialog_msgbox() where appropriate. The main
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.
2013-07-05 16:00:01 +00:00
Devin Teske
542dd84bad Add the necessary code to uninstall packages (re-install still pending).
Both scripted access (packageDelete) and UI access have been tested
successfully with a variation of different situations including:
+ Uninstall a package which no other installed package depends
+ Uninstall multiple packages which no other installed packages depend
+ Uninstall multiple packages which depend on each other
+ Similar to above but when ordered removal requires tracing dependencies
+ Purposefully do things like uninstall a package that is not installed
+ Try to uninstall a package which other installed packages still depend
+ Try to uninstall multiple packages which other installed packages depend
+ And many more.
2013-07-05 06:52:07 +00:00
Devin Teske
12a9a52070 Add minor debugging. 2013-07-05 06:46:11 +00:00
Devin Teske
384190f25b Prevent f_package_add() from re-performing f_package_detect_installed()
even though f_package_config() may have already detected the installed
packages.
2013-07-05 06:24:18 +00:00
Devin Teske
35925de7b6 Don't deselect a package right after installing it (this went unnoticed
because [currently] we exit after performing requests actions -- if we
ever change this to returning to the package selection screen, this would
have made an impact).
2013-07-05 06:22:25 +00:00
Devin Teske
02af913fc1 Minor debugging changes/additions. 2013-07-05 06:20:01 +00:00
Devin Teske
60fefd1e17 Fix a typo in a comment. 2013-07-05 03:12:29 +00:00
Devin Teske
38ae478b58 Add the beginnings of the old networking services functionality of
sysinstall(8). The UI for this will come later while this exposes the
functionality to the scripted interface. Tested successfully to first
install the pcnfsd package from the `Latest' repository, and second to
configure mountd_flags="-n" in rc.conf(5).
2013-07-05 01:49:20 +00:00
Devin Teske
31185df0d3 Add the necessary code to install packages (uninstall and re-install still
pending). Both scripted access (packageAdd) and UI access have been tested
successfully with a variation of different situations including:
+ Install a package with no dependencies
+ Install a package with dependencies that are already installed
+ Install a package with dependencies where some are already installed
+ Repeat each of the above from FTP and local Directory
+ Purposefully do things like try to install a package that does not exist
+ Try to install a package for which a dependency could not be loaded
+ Try to install a package that is in the INDEX bot not on the media
+ And many more.
2013-07-05 01:44:59 +00:00
Devin Teske
f687c95d86 Add debugging for each of the initialized default variables. 2013-07-05 01:38:42 +00:00
Devin Teske
0e30bd5b2e Add mustberoot.subr to the list of includes for scripts, exposing the helper
function f_mustberoot_init() to make it easy to write scripts that can more
easily transition to the super-user via sudo(8).
2013-07-05 01:37:35 +00:00
Devin Teske
dbc750a529 Remove separate processing of dependent packages from the "Review" screen
since f_package_add (packageAdd resword) processes dependencies itself.
NOTE: This is in preparation for incoming package management code.
2013-07-05 01:32:39 +00:00
Devin Teske
447dfc41b5 Get rid of place-holder in preparation for incoming package mgmt code. 2013-07-05 01:30:13 +00:00
Devin Teske
996caf2185 Comments. 2013-07-05 01:28:30 +00:00
Devin Teske
76ab5f3d5a Allow global default as general fall-back for package management routines. 2013-07-05 01:21:01 +00:00
Devin Teske
a0f49bbab3 Set name of device to directory path (displayed during package operations). 2013-07-05 01:18:54 +00:00
Devin Teske
424d0bad55 Implement $probe_only for the media access modules. sysinstall(8) was
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.
2013-07-04 20:12:12 +00:00
Devin Teske
c9c67103c3 More whitespace. 2013-06-24 20:58:54 +00:00
Devin Teske
b19b201996 Whitespace. 2013-06-24 20:39:07 +00:00
Devin Teske
edc9198c33 Add a newline character to the end of the "Check URL again" error message
because long URLs do not induce extra height despite wrapping by dialog(1).
NOTE: For even longer lines, the cursor up/down keys work to scroll through
2013-06-23 10:51:26 +00:00
Devin Teske
47b73aa2c1 Merge r248313 from stable/9 sysinstall(8) to head bsdconfig(8):
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).
2013-06-23 10:48:26 +00:00
Devin Teske
5ffdcd4c61 Implement the $probe_only parameter (previously unimplemented). 2013-06-23 10:04:23 +00:00
Devin Teske
6a18711a00 Fine-tune the parsing of the URL. Re-order, comment, and add debugging to
each case of unique URL format.
2013-06-23 09:41:47 +00:00