Commit Graph

436 Commits

Author SHA1 Message Date
dteske
c6b0e83324 Oops, r252810 forgot to hook the new example file (browse_packages.sh) into
the Makefile.
2013-07-05 18:50:17 +00:00
dteske
ac5f747c8f Adhere to 80-column width. 2013-07-05 18:31:26 +00:00
dteske
bf2d3ad14c 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
dteske
e1f42e69a1 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
dteske
d7e39ec70b Document new -d' and -D file' debugging options. 2013-07-05 18:03:00 +00:00
dteske
c0a4877d72 Change default FTP server (s/ftp-archive/ftp/). 2013-07-05 17:56:15 +00:00
dteske
96610810d3 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
dteske
75276888a5 Update HISTORY. 2013-07-05 17:45:54 +00:00
dteske
d861b88db5 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
dteske
08639ea4ac Update e-mails. 2013-07-05 17:38:54 +00:00
dteske
d00c81143b 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
dteske
5c5880a226 Don't refer to a port manual. 2013-07-05 17:31:05 +00:00
dteske
71f71d97c3 mdoc: begin sentences on a new line. 2013-07-05 17:27:55 +00:00
dteske
3057277318 Update date on the back of r252802. 2013-07-05 17:23:00 +00:00
dteske
d8c69f1ae5 Fix a typo. 2013-07-05 17:22:10 +00:00
dteske
68e775341d Whitespace. 2013-07-05 17:21:40 +00:00
dteske
0ac55ea171 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
dteske
f53995138b 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
dteske
d9933606bc Add minor debugging. 2013-07-05 06:46:11 +00:00
dteske
3ce89a7979 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
dteske
e6d392abc6 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
dteske
6d30095d01 Minor debugging changes/additions. 2013-07-05 06:20:01 +00:00
dteske
8e6b84b998 Fix a typo in a comment. 2013-07-05 03:12:29 +00:00
dteske
92088d5133 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
dteske
af1e83ac6e 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
dteske
4b3ea1b62b Add debugging for each of the initialized default variables. 2013-07-05 01:38:42 +00:00
dteske
30085c64d0 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
dteske
7b1053a0cd 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
dteske
88c7fca8dc Get rid of place-holder in preparation for incoming package mgmt code. 2013-07-05 01:30:13 +00:00
dteske
9a0edc7cfe Comments. 2013-07-05 01:28:30 +00:00
dteske
38518412eb Allow global default as general fall-back for package management routines. 2013-07-05 01:21:01 +00:00
dteske
9e8c439119 Set name of device to directory path (displayed during package operations). 2013-07-05 01:18:54 +00:00
dteske
d22cbd9996 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
dteske
b023066a1d More whitespace. 2013-06-24 20:58:54 +00:00
dteske
8cfebcfd45 Whitespace. 2013-06-24 20:39:07 +00:00
dteske
c553e460ee 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
dteske
f6abdf341e 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
dteske
0af114bd22 Implement the $probe_only parameter (previously unimplemented). 2013-06-23 10:04:23 +00:00
dteske
b9bf1edc0c 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
dteske
0c17385f8d Fix a code typo that prevented the probing of the current defaultrouter
in-order to pre-populate the editor.
2013-06-22 03:54:17 +00:00
dteske
68a4ce1f3f Oops, previous revision (r252084) broke non-full-path resolution (e.g.,
ftp://ftp.freebsd.org or ftp://ftp.freebsd.org/). Now both full-path and
non-full resolution is working regardless of trailing-slash.
2013-06-22 03:50:14 +00:00
dteske
29cd5ea9df Trim the trailing `/' from the ftp_dir when validating that the directory
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.
2013-06-22 03:44:49 +00:00
dteske
172bc62ff0 Take advantage of the fact that f_getvar evaluates the $var_to_get parameter
within braces, allowing all manner of parameter expansions (properly quoted
or escaped, of course).
2013-06-22 02:57:52 +00:00
dteske
70fc88c567 Fix a regression introduced by r251967, resulting in:
/usr/libexec/bsdconfig/110.mouse/mouse: 134:
Syntax error: ";;" unexpected (expecting "fi")
2013-06-22 02:51:22 +00:00
dteske
1c4c4f02ae Fix a regression introduced by r251967, resulting in:
/usr/libexec/bsdconfig/080.console/console: 136:
Syntax error: ";;" unexpected (expecting "fi")
2013-06-22 02:47:54 +00:00
dteske
ef5284d910 Add missing local declaration. 2013-06-21 23:21:16 +00:00
dteske
a463f986b4 Remove unused library include. 2013-06-21 23:18:29 +00:00
dteske
ddfb5b732f Alphabetize library includes. 2013-06-21 23:13:55 +00:00
dteske
ce72a91142 Style. 2013-06-21 22:53:51 +00:00
dteske
e3578808e0 Typo and grammar fixes to comments. 2013-06-21 22:47:31 +00:00
dteske
10da02bc8d Fix a code typo in a case-statement match expression that prevented IPv6
URLs with port designator from working properly (e.g. http://[::1]:80/).
2013-06-20 07:29:42 +00:00
dteske
6dd0be38a0 When the fall-back of a case-statement is the last thing executed in a
while-loop _and_ all prior matches in the same case-statement either break
or continue, we can safely break the fall-back out of the case-statement.
This should improve readability and allow for longer-lines by reducing the
level of indentation by-one for the fall-back case.
(a continuation of SVN r252019)
2013-06-20 05:51:44 +00:00
dteske
1a1d811a61 When the fall-back of a case-statement is the last thing executed in a
while-loop _and_ all prior matches in the same case-statement either break
or continue, we can safely break the fall-back out of the case-statement.
This should improve readability and allow for longer-lines by reducing the
level of indentation by-one for the fall-back case.
2013-06-20 05:48:08 +00:00
dteske
8fb422656d Remove pedanticism and consolidate some logic. 2013-06-20 05:42:21 +00:00
dteske
511962e186 Add debugging (for a case that shouldn't arise, but makes it more obvious
if a menu addition is made in one plce but forgotten in another).
2013-06-20 05:40:11 +00:00
dteske
77503946ef Style -- no ;; needed on fallback clause within case-statement. 2013-06-19 18:44:55 +00:00
dteske
4eff756ffc Whitespace. 2013-06-19 18:32:18 +00:00
dteske
9bd5d55beb Whitespace and comments. 2013-06-19 18:13:58 +00:00
dteske
c3cd626b8a Alphabetize reserved-word (resword) registration. 2013-06-19 17:14:59 +00:00
dteske
f6dbe45c92 Alphabetize includes. 2013-06-19 17:13:16 +00:00
dteske
b7a85ee10e Remove extra whitespace lines. 2013-06-19 00:24:08 +00:00
dteske
2ebb6eda77 Change a humongous if-statement at the end of f_install_zoneinfo_file() into
an early return, allowing a huge chunk of code to be indented one-level less
2013-06-19 00:13:54 +00:00
dteske
ed69dff380 Take advantage of newly updated f_dialog_{yesno,noyes}() functions from
SVN r251977 (adding an $hline parameter).
2013-06-19 00:09:21 +00:00
dteske
8e52ea64a4 When I first wrote the timezone module, it was in sysutils/tzdialog and it
pre-dates bsdconfig. Update the code to take advantage of f_dialog_msgbox().
2013-06-19 00:08:29 +00:00
dteske
2e3674feb1 Change the f_dialog_{yesno,noyes}() function-arguments in `dialog.subr' to
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').
2013-06-18 23:48:05 +00:00
dteske
3b16a818c5 Perform some code consolidation and replace nested case-statements with
more logical if-else statements for each menu selection.
2013-06-18 23:18:32 +00:00
dteske
c7bd392051 Fix a regression introduced by r251967, resulting in:
/usr/libexec/bsdconfig/140.startup/startup: 130:
Syntax error: ";;" unexpected (expecting "fi")
2013-06-18 23:14:45 +00:00
dteske
fc42de2e99 Whitespace. 2013-06-18 23:11:36 +00:00
dteske
e1afea6c7e Perform some code consolidation and add some additional error
checking/reporting. (similar to SVN revisions 251919 and 251928)
2013-06-18 21:44:35 +00:00
dteske
0f13adb175 Comments. 2013-06-18 21:35:38 +00:00
dteske
71046be318 Comments and whitespace. 2013-06-18 09:54:09 +00:00
dteske
3b53c257c7 Comments. 2013-06-18 09:45:10 +00:00
dteske
4e50a558f9 Perform some code consolidation and add some additional error
checking/reporting. (similar to SVN revision 251919)
2013-06-18 09:43:10 +00:00
dteske
c6e53d8f4e Whitespace and comments. 2013-06-18 09:41:34 +00:00
dteske
8b99254b09 Perform some code consolidation and add some additional error
checking/reporting. (similar to SVN revisions 251905 and 251915)
2013-06-18 09:28:49 +00:00
dteske
953191168e Remove unnecessary loops, perform some code consolidation, and add some
additional error checking/reporting. (same thing going on here as SVN
r251905 -- just this time for the mouse module instead of console)
2013-06-18 09:19:59 +00:00
dteske
f0b4d51977 Whitespace. 2013-06-18 09:05:08 +00:00
dteske
1000e60f83 Use newly enhanced f_dialog_msgbox() from SVN r251912. 2013-06-18 08:59:47 +00:00
dteske
2228493c00 Change the f_dialog_msgbox() arguments in `dialog.subr' to accomodate an
$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').
2013-06-18 08:54:02 +00:00
dteske
fc69930cba Comments. 2013-06-18 08:40:16 +00:00
dteske
7834e82563 Comments. 2013-06-18 08:35:44 +00:00
dteske
c0f3f1621c Fix a typo in a comment. 2013-06-18 08:30:31 +00:00
dteske
be5da34b48 Switch bsdconfig Disk Management' from sade(8) to bsdinstall partedit'. 2013-06-18 08:28:03 +00:00
dteske
601ac9fa2e Oops, in SVN r251905 I forgot that f_die takes the return code as the first
argument (not the format).
2013-06-18 08:22:51 +00:00
dteske
78fd2f6d07 Improve the INDEX format. Whitespace improvements, format improvements, typo
and grammatical fixes.
2013-06-18 08:15:56 +00:00
dteske
e2fc9f90d3 Remove unnecessary loops, perform some code consolidation, and add some
additional error checking/reporting.
2013-06-18 07:36:09 +00:00
dteske
9f82df651a Whitespace improvements. 2013-06-18 07:33:45 +00:00
dteske
b95c459e18 Style/comments. 2013-06-15 13:38:21 +00:00
dteske
eb35645bcc Add skeleton processing of selected packages in the order in which they
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.
2013-06-14 19:35:30 +00:00
dteske
9b3ee4394f Make the default choice for FTP media access use "auto". 2013-06-11 03:37:29 +00:00
dteske
685cb19de6 Fix a bug introduced by r251236; product of bug was the following error in
"Startup"->"View/Edit Startup Configuration"->"Add New"->"Add From List":

[: -eq: unexpected operator

NOTE: Previously mentioned in r251557

Problem caused by removal of $retval to capture exit status of call to
f_dialog_input_rclist().

While we're here, enhance f_dialog_input_rclist() to accept a default-item
to make selecting multiple values to-add more efficient.
2013-06-09 15:36:13 +00:00
dteske
57d593bf79 Fix a bug introduced with r251190, in which a small hunk was forgotten in
the performance conversion process.

The effect of this was the following error when selecting the menu
"Startup"->"View/Edit Startup Configuration"->"Add New"->"Add From List":

[: -eq: unexpected operator

By running `bsdconfig -d' as root to enable debugging, this turns into:

DEBUG: f_getvar: var=[text] value=[
Error: Expected a number for token 4 of --menu.
Use --help to list options.] r=0
[: -eq: unexpected operator

Indicating that the fourth token for --menu which should be $height was
instead a string (the first item of $menu_list) because it was using the
old size-calculation method and $size was now null (needed to use instead
the new size variables of $height $width and $rows).
2013-06-08 21:45:32 +00:00
dteske
cf6da5ffd1 Fix a bug introduced with r249751, in which a small hunk was forgotten in
the performance conversion process.

The effect of this was, when your /etc/defaults/rc.conf file changed
(based on md5(1)) and re-generating the file startup_rcconf_map.cache in
/var/run/bsdconfig/ you would get a screen-dump of its contents before the
menu would appear.
2013-06-08 21:33:09 +00:00
dteske
7d8e34db14 Fix a typo in comments. 2013-06-08 21:11:26 +00:00
dteske
92ffc0ff59 Don't silently ignore errors (found while
testing with `chflags schg /etc/ttys).
2013-06-08 20:47:43 +00:00
dteske
f8a485d655 Prevent getting hung-up on the following prompt (found while testing with
`chflags schg /etc/ttys'):

override rw-r--r--  root/wheel for /etc/ttys? (y/n [n])

Simply by adding `-f' flag to mv(1).
2013-06-08 20:43:13 +00:00
dteske
cac59a27d8 Fix a one-character typo. The effects of which were "Console"->"Ttys" menu
would not launch (and gave no error). This was easily diagnosed by running
`bsdconfig -d' as root and seeing the following error right after selecting
the "Ttys" sub-menu:

DEBUG: f_getvar: var=[text] value=[
Error: Expected at least 6 tokens for --menu, have 4.
Use --help to list options.] r=0

Typo was introduced by SVN r251361.
2013-06-08 20:27:16 +00:00
dteske
8c2b3ff783 Add a prompt to the "Add User" and "Add Group" sub-menu items (under the
"Login Management" module): Use default values for all account details?

If you select "Yes" (the default is "No"), you'll jump past all the prompts
and jump straight to the review screen with all-default values.

Makes adding a lot of users/groups faster/easier if you don't need to
customize more than one or two different values from their defaults.
2013-06-08 19:13:49 +00:00
dteske
cdb2b25b55 Curb another regression (this one introduced by r251545, itself trying to
fix the regression introduced by r251544; which was trying to make things
consistent w/respect to ESC versus YES versus NO in the password disable
prompt in "Login Management".

(need stronger coffee; very sorry for the churn)

With this revision, the "YES", "NO", and implied ESC options all work as-
expected. Choosing "YES" allows you to proceed and the password will be
disabled. Choosing "NO" will bring back around to enter a password for the
account. Pressing ESC will drop you out of either user or group input and
back to the usermgmt screen.
2013-06-08 18:23:41 +00:00
dteske
90602f8fb4 Fix a regression introduced by r251544; if user chooses "NO" when being
asked if they would like to disable password authentication for the account,
loop back to prompt them for the password again.
2013-06-08 18:13:42 +00:00
dteske
cbf1a17fa6 Check for ESC as a separate choice from "NO" when asking if the operator
would like to disable password management for an account while adding either
a user or group. When being prompted to answer questions while adding a
group or user, two things are trow:

1. You can hit ENTER to blast through all the questions and in the end, the
   group or user is created with sensible defaults for all values.

2. You can press ESC during any prompt to cancel the operation as a whole.

This fix is shoring up an inconsistency in the latter (#2).
2013-06-08 18:08:17 +00:00
dteske
a84a4d50b2 Track defaultitem in the password and account expiry menus; if the user
presses ESC or chooses Cancel/No in any of the sub-menus, we want to return
to the expiry menu with that item selected.
2013-06-08 17:46:39 +00:00
dteske
f088cbc9d3 Fix a regression in the "Login Management" module introduced by r251242 in
which choosing to cancel the manual input of expiration time (in seconds
since the UNIX epoch) for either account expiration or password expiration
would see the original value lost.
2013-06-08 17:36:31 +00:00
dteske
4c3e94bc91 Reduce verbosity in the "Console"->"Saver" module (bsdconfig syscons_saver)
by replacing the infinitive [verb] phrase "Simply blank the screen" with a
simple description of what you get; "Blank screen".

PR:		ports/169316
2013-06-08 16:49:19 +00:00
dteske
fad4917469 Remove extraneous characters ('<<<') from `Exit' menutag in the "Security"
and "Startup"->"Misc" modules to make the menus appear more consistent with
the numerous other modules and look a little cleaner.

PR:		ports/169316
2013-06-08 16:28:08 +00:00
dteske
7261ab4254 Shift Console->Saver menu items to place the default item at the top, making
this menu consistent with Console->Repeat, Console->Font, Console->Screenmap
and many others which place the default choice at the top.

NOTE: SVN r249751 changed things so that these menus highlight the active
selection, so the idea that the default choice (now at top) "can be selected
immediately by hitting ENTER" is not possible unless the default choice is
the currently active setting (e.g., on first visit to the menu). However, it
is still warranted to have the default choice at the top of the menu.

PR:		bin/169316
2013-06-04 17:08:26 +00:00
dteske
92d614c6c1 Lessen verbosity of "Exit" menutag items to appear more consistent across
menus from one module to the next.

Replacing "Exit this menu (returning to previous)" with "Exit this menu".

PR:		ports/169316
2013-06-04 16:48:23 +00:00
dteske
209fc7d0b7 Use f_shell_escape() instead of forking to awk. In this case, the
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.
2013-06-04 03:47:21 +00:00
dteske
3f33ca8345 Use a case-statement instead of multiple (separate even) if-statements. 2013-06-04 03:38:16 +00:00
dteske
ec08ad3fe7 Comments. 2013-06-04 03:37:35 +00:00
dteske
5bc8f8ca23 Similar to r251236, r251242, and r251244. Introduce new function-pair to
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().
2013-06-04 03:30:44 +00:00
dteske
6b6c46b522 Fix a code typo (missing `eval') which lead to improperly-sized menu when
displaying packages (menu was always maximum height). The problem was
introduced by SVN r251232.
2013-06-04 00:42:31 +00:00
dteske
b381972ac3 Fix menu accenting for the package category list. The single-space indent
for duplicate initial-characters was removed for making comparisons but was
not put back.
2013-06-04 00:38:19 +00:00
dteske
aa9af606b3 Whitespace and comments. 2013-06-04 00:35:57 +00:00
dteske
01acd11dfd Improve debugging for f_dialog_*_constrain() to print constrained rather
than unconstrained values.
2013-06-04 00:30:05 +00:00
dteske
5845db6f8d Like r250701, introduce another handy function for truncating variables to a
specific byte-length. Works like vsnprintf(3).
2013-06-02 23:25:27 +00:00
dteske
3ce2625557 Fix a typo. In this case, the typo caused the f_noyes() invocation to
display a global instead of the passed-argument; however since the global
always has the same value as the passed argument, it made no difference in
the realtime operation.
2013-06-02 23:23:29 +00:00
dteske
2c5a7d3879 Fix a bug in which the user's choice to Cancel was not recognized. This was
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.
2013-06-02 23:20:46 +00:00
dteske
2d62c22a99 Fix a bug that would cause a spurious warning to appear to appear in an
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.
2013-06-02 23:18:27 +00:00
dteske
0d6301c0f9 Fix a bug in which the user's choice to Cancel was not properly recognized. 2013-06-02 23:15:12 +00:00
dteske
8e41e7110a Change the name of a couple of functions in `usermgmt/user_input.subr' to
make their purpose more clear by their names:

	f_dialog_input_change() and
	f_dialog_input_expire()

Are now (respectively):

	f_dialog_input_expire_password() and
	f_dialog_input_expire_account()

Upon revisit to this portion of code, the former names were too confusing.
2013-06-02 23:12:32 +00:00
dteske
12134e26ca Fix a copy/paste error within a comment. 2013-06-02 23:08:21 +00:00
dteske
db6026d0e2 Add some additional debugging to the common media library. 2013-06-02 23:06:33 +00:00
dteske
64cf1a541d Make some obvious consolidations in local declaration for readability. 2013-06-02 23:05:01 +00:00
dteske
ad505a174d Standardize NULL initialization to be consistent. 2013-06-02 23:02:56 +00:00
dteske
2bc44622b3 Use f_isset() (introduced by r250317) instead of `f_quietly f_getvar ...'. 2013-06-02 22:54:36 +00:00
dteske
6ece0c7e99 Make proper use of locals in f_dialog_init(). 2013-06-02 22:45:54 +00:00
dteske
6ffb8bc7f6 Improvements to whitespace and comments. 2013-06-02 22:34:40 +00:00
dteske
9d0ce61896 Fix option processing from the library layer to address unexpected
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.
2013-06-02 22:04:39 +00:00
dteske
e9cea34539 Standardize the way functions build their arguments leading up to a dialog
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.
2013-06-02 20:02:50 +00:00
dteske
373aa5232d Improve the dialog(1) API in dialog.subr by adding f_dialog_default_store()
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.
2013-06-02 09:02:12 +00:00
dteske
5b05f06765 Similar to r251236, improve the portion of dialog(1) API in dialog.subr
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.
2013-06-02 05:45:25 +00:00
dteske
9e2431c34d Improve portion of the dialog(1) API in dialog.subr responsible for
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.
2013-06-01 23:58:44 +00:00
dteske
2201176ef9 Fix a typo introduced by r251190. 2013-06-01 22:12:53 +00:00
dteske
14eaccaa34 Fix a regression in the packages module introduced by recent r251190.
I somehow neglected this module in merging that API change.
2013-06-01 21:29:53 +00:00
dteske
a0eece4606 Improve portion of the dialog(1) API in dialog.subr responsible for
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).
2013-05-31 19:07:17 +00:00
dteske
32fe2f0aca Fix a typo in a comment. 2013-05-16 16:51:52 +00:00
dteske
ced8469d7c Add a handy function for truncating variables to a specific byte-length. It
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.
2013-05-16 16:46:02 +00:00
dteske
7c4460149d Centralize standard getopts arguments, both for convenience and to correct
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.
2013-05-14 03:21:13 +00:00
dteske
df35570eb7 Comment. 2013-05-12 00:50:18 +00:00
dteske
98359e968c Fix i18n violations in the package management module. A few words like
`packages', `installed', and `selected' were not internationalized.
2013-05-12 00:46:18 +00:00
dteske
04e3ea4515 Remove duplicated string. 2013-05-12 00:44:40 +00:00
dteske
8eca6f86f2 Comments. 2013-05-12 00:40:49 +00:00
dteske
1cc44f2008 Whitespace. 2013-05-12 00:39:25 +00:00
dteske
ce591b770b Fix a bug that would cause the category menu to display the wrong value
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.
2013-05-09 16:09:39 +00:00
dteske
01469a1863 Commit first portion of package module -- this includes the ability to view
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.).
2013-05-07 05:40:20 +00:00
dteske
10fa20ef4f Explicitly track "script.subr" which wasn't showing up in the graph because
it's not used by anything within bsdconfig nor any modules (rather, the
script.subr include is designed to be used externally -- nonetheless we
want to track it in the modular graph outputs showing includes).
2013-05-07 04:47:56 +00:00
dteske
dd7d8328e3 Recursively calculate includes. This solves the problem of some includes
missing from the graph, but it also unfortunately forces yet another bug
in graphviz dot(1) to appear. When edge labels are enabled (using '\T')
with this many edges, dot(1) will do bad things in init_rank() and often
crash. So while we're here, let's disable edge labels for the include-
relationship graph feature.
2013-05-07 04:46:08 +00:00
dteske
3876e4f11c Remove unused variables. 2013-05-07 04:40:57 +00:00
dteske
428a9704d2 Alphabetize strings by variable names. 2013-05-07 04:23:50 +00:00
dteske
242810308a Re-organize and add missing installVarDefaults and mediaSetDirectory. 2013-05-07 04:03:59 +00:00
dteske
26fb28c83e Add f_isset() utility subroutine for checking if a variable is set but in
a more readable fashion.
2013-05-07 03:57:45 +00:00
dteske
d1ece6874f Properly sanitize --menu results (guards against Gtk library warnings from
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!).
2013-04-26 21:28:24 +00:00
dteske
8d0cd52a54 Comments. 2013-04-26 21:19:05 +00:00
dteske
a574fde5d5 Fix copy/paste error. 2013-04-24 03:15:55 +00:00
dteske
aed82e9e48 Add missing include. 2013-04-23 22:55:59 +00:00
dteske
7d6b520e24 Prevent device.subr from auto-loading in the nameservers module.
This module doesn't need device support (but device.subr is loaded
indirectly through media/tcpip.subr which contains resolv stuff).
2013-04-23 00:10:33 +00:00
dteske
198c9cae20 Preserve debugFile preference across the exec boundary. 2013-04-22 21:19:44 +00:00
dteske
68006a3d42 Partially uncommit r249779. The changes to share/common.subr were good
while the remaining changes were part of a much larger ``secret sauce''
involved in an up-coming commit that I'm still laboring on.
2013-04-22 21:11:27 +00:00
dteske
1a05c430de Fix "-D file" to automagically enable debugging if not explicitly disabled. 2013-04-22 21:03:44 +00:00
dteske
8e151bb482 Clarify to the user the amount of time required to load the menus for
each view in the details dialog.
2013-04-22 06:30:29 +00:00
dteske
f87348f820 New helper functions for common widgets. 2013-04-22 06:28:45 +00:00
dteske
55ba192b5b Proper fix for copy/paste error (first attempt r249756). 2013-04-22 06:27:14 +00:00
dteske
6b10ce1ca9 Fix a copy/paste error. 2013-04-22 06:20:34 +00:00
dteske
bd5972fc3a Update comment for accuracy. 2013-04-22 06:13:30 +00:00
dteske
41ba2f30cd Style nit (to be consistent across project). 2013-04-22 06:12:22 +00:00
dteske
6776c629e5 Fix two bugs when setting up a plip interface. First, dhcp status was not
being properly cleared each iteration of the loop. Second, values weren't
properly quoted when sent to the editor function.
2013-04-22 06:10:27 +00:00
dteske
8f385d0e89 UI improvements. First, implement --default-item whenever and wherever
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.
2013-04-22 05:52:06 +00:00
dteske
2cbbbe9342 Use new f_getvar for clarity and general code follow-up to r249746. 2013-04-22 05:32:27 +00:00
dteske
6089bf07c7 Add new flags -d' (sets debug=1) and -D file' (sets debugFile) and
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.
2013-04-22 05:02:34 +00:00
mav
e24314009c Remove some more references to legacy ATA.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
2013-04-04 12:03:30 +00:00
dteske
1f658c88be Import media selection/preparation framework (sysinstall inspired). Makes
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.
2013-02-25 19:55:32 +00:00
dteske
7d5f9c1825 Fix typo and update copyright. 2013-02-25 19:14:06 +00:00
dteske
df32e67985 Remove NO_OBJ from Makefiles that generate manuals because this causes the
GZIP compressed manuals to appear in ./src instead of the appropriate obj dir.

PR:		conf/175844
Submitted by:	Dominique Goncalves <dominique.goncalves@gmail.com>
2013-02-08 11:14:01 +00:00
dteske
dfd83d50c4 Backward compatibility fix: treat cmds loaded as a script as nonInteractive 2013-01-20 17:48:56 +00:00
dteske
9bcfc5995d Don't use f_show_msg() unless printf(1) syntax is required (this reduces the
number of unnecessary forks).
2013-01-14 21:03:34 +00:00
dteske
45e98a4654 Add new f_yesno/f_noyes wrapper functions (which take printf(1) syntax). 2013-01-14 01:15:25 +00:00
dteske
1e25b1497a Add missing dialog(1) arguments to internationalize "Help"-button label. 2013-01-14 01:09:23 +00:00
dteske
46b98d7f74 Update copyright following last commit. 2013-01-07 00:18:03 +00:00
dteske
b9b77b44df Add nonInteractive support to f_dialog_yesno/noyes(). 2013-01-07 00:15:52 +00:00
dteske
90eed83cac Update copyrights and dates following last commit. 2013-01-06 18:18:09 +00:00
dteske
57018d79b2 Add support for scripting (sysinstall style).
Reviewed by:	jilles
2013-01-05 02:08:47 +00:00
dteske
d69819c426 Comments. 2013-01-03 15:48:00 +00:00
dteske
5a7a099d47 Comments. 2012-12-29 00:30:30 +00:00
dteske
d79ae35098 Add missing enforcement of height restriction after minor adjustment. 2012-12-29 00:06:26 +00:00
dteske
7b627c0586 Add support for running without a controlling terminal (for example, when
running as an rvalue to a pipe).
2012-12-29 00:01:24 +00:00
dteske
34882b31ed Allow debug output to be logged to a file (set $debugFile to target pathname)
or both stdout and a file (precede $debugFile pathname with a plus-sign, `+').
2012-12-28 23:49:17 +00:00
dteske
b91b6fc81b Whitespace. 2012-12-28 23:40:13 +00:00
dteske
ff855cec66 Fix incorrect function name. s/[[:<:]]dialog_clear/f_&/ 2012-12-28 23:27:17 +00:00
dteske
29c6e27591 Comments and fit to 80-columns. 2012-12-27 07:52:50 +00:00
dteske
aa703b25c0 Add more debugging to help with diagnosis of program-flow when needed. 2012-12-25 10:47:45 +00:00
dteske
2646f7c5d8 Remove unnecessary duplicate initialization of the dialog(1) API (automatically
bootstrapped on-include unless DIALOG_SELF_INITIALIZE is set to NO before-hand)
2012-12-25 09:30:25 +00:00
dteske
777c7fa05d Split dialog(1)-based validators for hostname/netmask into two, providing
transparent validators that can be used free of dialog(1) where needed.

Syntax/return of the original dialog(1)-based validators remains unchanged.
2012-12-21 21:33:47 +00:00
dteske
ddf809931f Remove unused include. 2012-12-21 21:03:34 +00:00
dteske
9f0941e667 Change axiom for initialization. Including script can disable (default)
automatic initialization by setting appropriate variable to particular value.
2012-12-21 20:46:58 +00:00
dteske
2bedb4fa3d Remove erroneous use of "local" (not in a function). 2012-12-21 20:36:12 +00:00
dteske
ea3604ca08 New f_show_info() function for dialog(1) --infobox using printf(1) syntax. 2012-12-21 20:29:28 +00:00
dteske
9edf4bc88d Use f_show_help() where printf(1) syntax is desired. 2012-12-21 20:11:41 +00:00
dteske
10fd5103d0 Improve the debugging abilities and clean up debug messages. In most cases,
all one has to do is set the environment variable DEBUGGING to get the debug
messages to appear on the console.
2012-12-21 19:26:17 +00:00
dteske
5e7ea05b1a Add much-needed dialog(1) --inputbox function for simplifying the process of
requesting input from the user.
2012-12-21 18:58:19 +00:00
dteske
72035ea1e4 Allow setting of NULL titles with f_dialog_[back]title().
Approved by:	adrian (co-mentor) (implicit)
2012-11-27 22:14:22 +00:00
dteske
996ec077c4 Change self-initialization to occur when loaded versus the previous behavior
which was to self-initialize during the first function-call. This didn't work
so well because the first call was may or may-not be within a sub-shell
(which prevented proper setup of the pass-thru file descriptor, resulting in
dialogs that would not display).

Approved by:	adrian (co-mentor) (implicit)
2012-11-27 22:11:53 +00:00
dteske
f0cd99e6f6 Comments.
Approved by:	adrian (co-mentor) (implicit)
2012-11-27 22:05:01 +00:00
dteske
048b913826 Split IP address validation routines and improve error detection for dotted-
quad notation in IPv6 addresses.

Approved by:	adrian (co-mentor) (implicit)
2012-11-25 10:37:10 +00:00
dteske
1b9b8a999d Whitespace.
Approved by:	adrian (co-mentor) (implicit)
2012-11-24 07:02:31 +00:00
dteske
4df3510526 Add IPv6 address-validation routine.
Approved by:	adrian (co-mentor) (implicit)
2012-11-24 06:27:46 +00:00
dteske
71e5cb8556 Replicate a feature from sysinstall documented in
stable/9/usr.sbin/sysinstall/help/shortcuts.hlp (reproduced below):

If /usr/sbin/sysinstall is linked to another filename, say
`/usr/local/bin/configPackages', then the basename will be used
as an implicit command name.

To get a list of modules you can link to, see `bsdconfig -h' output.

Approved by:	adrian (co-mentor) (implicit)
2012-11-16 00:59:11 +00:00
dteske
61892356da Resurrect and integrate stable/9/usr.sbin/sysinstall/help/usermgmt.hlp
Approved by:	adrian (co-mentor) (implicit)
2012-10-26 03:20:04 +00:00
dteske
713eda73ba Remove unnecessary quotation to clean things up.
Approved by:	adrian (co-mentor) (implicit)
2012-10-26 02:50:14 +00:00
dteske
66f986a463 Don't mask fwe(4) lp(4) or plip(4) devices from ifconfig(8) list.
Approved by:	adrian (co-mentor) (implicit)
2012-10-26 02:49:12 +00:00
dteske
48d14074ad Resurrect and integrate stable/9/sysinstall/help/tcp.hlp
Approved by:	adrian (co-mentor) (implicit)
2012-10-26 02:45:29 +00:00
dteske
5bb808b28d Tighten-up displays that use a NULL prompt (e.g., networking and usermgmt).
Approved by:	adrian (co-mentor) (implicit)
2012-10-26 01:47:59 +00:00
dteske
0f431e422c Fix copy/paste error.
Approved by:	adrian (co-mentor) (implicit)
2012-10-26 00:46:09 +00:00
dteske
28676bbae2 Switch from using a msgbox to display help files to a textbox instead. The
problem with using a msgbox was one of truncation in the case of Xdialog(1)
and lack of screen real-estate (since the msgbox is not scrollable in X11
while a textbox is).

The textbox renders the text much better and is more appropriate for this
type of data display.

Approved by:	adrian (co-mentor) (implicit)
2012-10-26 00:31:25 +00:00
dteske
6e396e7bb6 When Xdialog(1) is passed a NULL argument to its `--help' option, Xdialog(1)
acts like dialog(1) in that it returns exit status 2 when the help button is
chosen.

Approved by:	adri (co-mentor) (implicit)
2012-10-25 21:04:11 +00:00
dteske
83ab66c211 Resurrect usage.hlp and securelevel.hlp from sysinstall(8) and integrate them
into bsdconfig(8).

Approved by:	adrian (co-mentor) (implicit)
2012-10-22 18:01:38 +00:00
dteske
2b4f8b4cff More-accurately replicate the help system from sysinstall(8). However, also
improve upon the system by giving the user a "Help" button instead of requiring
the user to press F1.

NOTE: In FreeBSD-9 and higher, dialog(1) does not support the F1 hook, so the
      mechanism for providing help to the user had to be changed to a button.

This now means we can resurrect *.hlp files from usr.sbin/sysinstall/help/ as-
is and reusing them as-needed in bsdconfig (holding to the goal of losing as
little functionality from sysinstall as possible).

Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-10-18 18:43:54 +00:00
dteske
08df5b7fb0 Fix a bug where blank lines were not being counted (because awk's split()
function returns zero when $0 is the NULL string).

Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-10-18 17:09:45 +00:00
dteske
5427f0b2a0 Fix typo.
Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-10-18 07:55:09 +00:00
dteske
6defc54cbd Ask to become root via sudo(8) and give user ability to save this preference.
Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-10-17 21:48:45 +00:00
dteske
1388f55af3 SVN r240684 broke the ability of the dot module to map include dependencies.
Teach the dot module about the new location these includes moved to (as part
of r240684) and clean things up a bit.

Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-10-13 03:56:33 +00:00
joel
e9b754bcb5 Minor mdoc fixes. 2012-10-07 19:53:04 +00:00
dteske
ae42961686 Import sysutils/sysrc from the ports tree (current version 5.1). Importing
disconnected under the WITH_BSDCONFIG flag (a good idea since this version of
sysrc(8) indeed requires the `sysrc.subr' module installed by bsdconfig(8)).

Multiple reasons sysrc should not simply continue to live in ports. The most
important being that it is tightly coupled with the base.

Approved by:	adrian (co-mentor)
2012-10-03 02:32:47 +00:00
dteske
e094bc67f5 Allow deferred word-splitting via f_sysrc_get() by allowing $IFS in the
"clean-room" environment used to query rc.conf(5) parameters.

This brings bsdconfig(8)'s sysrc.subr in-line with both the sysrc(8) manual
[provided by sysutils/sysrc] and sysrc(8)'s own sysrc.subr (now identical to
bsdconfig(8)'s sysrc.subr as of this patch).

Finally, this will allow a clean import of sysutils/sysrc (sans sysrc.subr,
already provided here).

Reviewed by:	jilles
Approved by:	adrian (co-mentor)
2012-09-29 03:41:21 +00:00
dteske
8f5dd3a88f Sanitize varname argument in f_sysrc_find. This is as much for security as it
is for sanity.

Reviewed by:	jilles
Approved by:	adrian (co-mentor)
2012-09-28 01:39:25 +00:00
dteske
5a93cdb01d Always use RC_CONFS when set, even if NULL. Previously only used if non-NULL.
Reviewed by:	jilles, adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-09-23 17:47:01 +00:00
dteske
ec17dd03e0 jilles accurately advises that, in the context of shell redirection, the `:'
builtin is processed specially and thus the `: > file' syntax for example
will cause premature termination of the current shell on redirection-error.

The `true' builtin on the other-hand is not included in this special
processing (for compatibility reasons to satisfy legacy scripts programmed
for systems where `true' is not a builtin).

Change bare `: > file' syntax into `true > file' syntax to prevent premature
shell termination in the event of redirection-error.

NOTE: Instances of `: > file' that appear within a sub-shell have been left
unmodified as these will not cause premature termination of the main script.

Reviewed by:	jilles, adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-09-22 22:16:07 +00:00
dteske
a74ee85809 Replace "( : ${var?} )" syntax with better "[ ${var+set} ]" syntax.
Reviewed by:	jilles, adrian (co-mentor)
Approved by:	jilles, adrian (co-mentor)
2012-09-22 04:04:02 +00:00
dteske
0552e7d2c3 Spelling and whitespace corrections.
Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-09-22 03:11:35 +00:00
dteske
5bd90f70ae Reverse SVN r240770 -- jilles@ made a suggestion that allowed us to redesign
our embedded rescue environment to support /dev/null making r240770 obsolete.

Reviewed by:	jilles, adrian (co-mentor)
Approved by:	jilles, adrian (co-mentor)
2012-09-21 19:03:25 +00:00
dteske
36137540d6 Replace redirections to /dev/null with "close file-descriptor" syntax (>&-).
Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-09-21 01:36:20 +00:00
dteske
f628c47944 Change all invocations of dialog(1) to no-longer require temporary files.
This allows bsdconfig to -- like bsdinstall -- operate from read-only media.

Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-09-20 23:44:13 +00:00
dteske
282d6b7f2c Move major includes into /usr/share/bsdconfig for easy external access.
Reviewed by:	adrian (co-mentor)
Approved by:	adrian (co-mentor)
2012-09-18 22:28:42 +00:00
eadler
8600cbb5b6 Correct double "the the"
Approved by:	cperciva
MFC after:	3 days
2012-09-14 21:28:56 +00:00
joel
197aac3869 Mdoc and whitespace fixes. 2012-07-14 06:17:17 +00:00
dteske
3981b9b76a Import bsdconfig(8) as a replacement for the post-install abilities of
deprecated sysinstall(8). NOTE: WITH_BSDCONFIG is currently required.

Submitted by:	Devin Teske (dteske), Ron McDowell <rcm@fuzzwad.org>
Reviewed by:	Ron McDowell <rcm@fuzzwad.org>
Approved by:	Ed Maste (emaste)
2012-07-14 03:16:57 +00:00