1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00
freebsd/usr.sbin/bsdconfig
Devin Teske fd962ac699 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
..
console Improve portion of the dialog(1) API in dialog.subr responsible for 2013-06-01 23:58:44 +00:00
diskmgmt Centralize standard getopts arguments, both for convenience and to correct 2013-05-14 03:21:13 +00:00
docsinstall Centralize standard getopts arguments, both for convenience and to correct 2013-05-14 03:21:13 +00:00
dot Explicitly track "script.subr" which wasn't showing up in the graph because 2013-05-07 04:47:56 +00:00
examples Improve the debugging abilities and clean up debug messages. In most cases, 2012-12-21 19:26:17 +00:00
include Fix i18n violations in the package management module. A few words like 2013-05-12 00:46:18 +00:00
mouse Improve portion of the dialog(1) API in dialog.subr responsible for 2013-06-01 23:58:44 +00:00
networking Improve portion of the dialog(1) API in dialog.subr responsible for 2013-06-01 23:58:44 +00:00
packages Centralize standard getopts arguments, both for convenience and to correct 2013-05-14 03:21:13 +00:00
password Improve portion of the dialog(1) API in dialog.subr responsible for 2013-05-31 19:07:17 +00:00
security Improve portion of the dialog(1) API in dialog.subr responsible for 2013-06-01 23:58:44 +00:00
share Improve portion of the dialog(1) API in dialog.subr responsible for 2013-06-01 23:58:44 +00:00
startup Improve portion of the dialog(1) API in dialog.subr responsible for 2013-06-01 23:58:44 +00:00
timezone Improve portion of the dialog(1) API in dialog.subr responsible for 2013-06-01 23:58:44 +00:00
ttys Centralize standard getopts arguments, both for convenience and to correct 2013-05-14 03:21:13 +00:00
usermgmt Improve portion of the dialog(1) API in dialog.subr responsible for 2013-06-01 23:58:44 +00:00
bsdconfig Improve portion of the dialog(1) API in dialog.subr responsible for 2013-06-01 23:58:44 +00:00
bsdconfig.8 Update copyrights and dates following last commit. 2013-01-06 18:18:09 +00:00
Makefile Commit first portion of package module -- this includes the ability to view 2013-05-07 05:40:20 +00:00
USAGE Add new flags -d' (sets debug=1) and -D file' (sets debugFile) and 2013-04-22 05:02:34 +00:00