Commit Graph

160 Commits

Author SHA1 Message Date
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