Commit graph

14080 commits

Author SHA1 Message Date
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
Devin Teske f416c89cb3 Fix a typo introduced by r251190. 2013-06-01 22:12:53 +00:00
Devin Teske 367a23a787 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
Devin Teske 74036c4de9 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
Jung-uk Kim a9c007f1f2 Fix a long standing logic bug introduced in r167814. The code was added to
get RSDP from loader(8) hint via kenv(2) but the bug nullified the new code
and we always fell back to the previous method, i. e., sysctlbyname(3).

MFC after:	3 days
2013-05-31 17:23:38 +00:00
Xin LI 9417953e08 Convert Makefile to have only one file for each line, while I'm there, sort
SRCS to ease future upgrades.
2013-05-30 21:24:33 +00:00
Xin LI d03c0883ad MFV: tcpdump 4.4.0.
MFC after:	4 weeks
2013-05-30 20:51:22 +00:00
Mark Johnston dd3368997e - Fix wording. [1]
- Improve the descriptions in the FILES section. [2]

Reported by:	Jason McIntyre [1]
Obtained from:	NetBSD [2]
MFC after:	3 days
2013-05-28 13:54:26 +00:00
Garance A Drosehn 137076c5f7 Change the closeallfds() routine to use closefrom() when it is
available (closefrom() was added to FreeBSD in 8.0-release).
The selection is made at compile-time, as I still compile a
FreeBSD-based version of lpr&friends on other platforms.

While testing I out that (at least on my system) lpd has been
closing 11095 fd's, when there are only 6 fd's open.  The old
code took 120 times more clocktime than calling closefrom().
(although that was still less than 2/1000-ths of a second!)

Reviewed by:	jilles
MFC after:	2 weeks
2013-05-27 22:19:01 +00:00
Mark Johnston 601848d2b2 Include descriptions of the flags and fields printed when dumping the
IPv6 prefix list.

Reviewed by:	hrs
MFC after:	1 week
2013-05-23 19:50:36 +00:00
Mark Johnston dcc8e5487b Correct the description of the -a option: rtsol(d) -a will in fact send out
router solicitations on multiple interfaces.

Reviewed by:	hrs
MFC after:	1 week
2013-05-23 19:47:35 +00:00
Jung-uk Kim 9c5a52cf88 Work around build breakages with GCC 4.2.
Reported by:	tinderbox
2013-05-23 05:42:35 +00:00
Peter Wemm 41b886b61c Don't mess with /etc/localtime if it is a symlink. 2013-05-22 19:00:05 +00:00
Jung-uk Kim a9d8d09c46 Merge ACPICA 20130517. 2013-05-20 23:52:49 +00:00
Bryan Drewery a261d76121 Update location to ports INDEX file.
PR:		bin/164561
Approved by:	bapt
2013-05-18 19:18:03 +00:00
Konstantin Belousov 5d6787cfb2 Decode new HT 3.00 and 3.10 capabilities.
Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>
MFC after:	1 week
2013-05-17 14:05:31 +00:00
Dag-Erling Smørgrav 75f75375d4 Add a -N option that prints the jail name rather than its number.
MFC after:	3 weeks
2013-05-17 08:48:16 +00:00
Devin Teske f82ca17bbe Fix a typo in a comment. 2013-05-16 16:51:52 +00:00
Devin Teske 60d8a2b517 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
Devin Teske c3755aa30c 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
Marcel Moolenaar a92b168892 Set st_nlink in the stat structure within the inode to 1 as well.
The cd9660 file system uses that field for the link count and it
was 0. This impacts pwd_mkdb(8) as it checks for st_nlink not being
0 as part of closing a race.
2013-05-13 18:34:33 +00:00
Joel Dahl 37b983c09b mdoc sweep 2013-05-13 18:13:50 +00:00
Mark Johnston 252d859338 Add a remark to the effect that a manually started relearn will always
result in the battery being completely drained, even in transparent learning
mode.

MFC in:		3 days
Sponsored by:	Sandvine Inc.
2013-05-13 15:00:36 +00:00
Joel Dahl 2710751bc3 mdoc sweep. 2013-05-12 22:22:12 +00:00
Mikolaj Golub e0505d2826 Revert r250394, which disabled snmp_hast due to libl dependency issue --
the dependency has been removed in r250503.
2013-05-12 13:42:49 +00:00
Mark Johnston 3cc26586e6 Some filesystems (NFS in particular) do not fill out the d_type field when
returning directory entries through readdir(3). In this case we need to
obtain the file type ourselves; otherwise newsyslog -t will not be able to
find archived log files and will fail to both delete old log files and to
do interval-based rotations properly.

Reported by:	jilles
Reviewed by:	jilles
MFC after:	2 weeks
2013-05-12 01:58:04 +00:00
Devin Teske 20b371f541 Comment. 2013-05-12 00:50:18 +00:00
Devin Teske 5cf9b06b6b 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
Devin Teske cfde4beeda Remove duplicated string. 2013-05-12 00:44:40 +00:00
Devin Teske a104b9056a Comments. 2013-05-12 00:40:49 +00:00
Devin Teske 4f82901ca5 Whitespace. 2013-05-12 00:39:25 +00:00
Eitan Adler ffa7c28828 Teach wpa_supplicant to properly compute wireless signal strength.
PR:		bin/170631
Submitted by:	Daan Vreeken <Daan@vitsch.nl>
Reviewed by:	adrian
2013-05-11 20:55:14 +00:00
Antoine Brodin 290b7b224a Add some missing DPADD. 2013-05-11 13:46:05 +00:00
Eitan Adler a8de143c02 The M_VESA_MODE_MAX is latest valid mode - not the first invalid.
Permit its use in vidcontrol -i

PR:		bin/119483
Submitted by:	Dan Lukes <dan@obluda.cz>
Arrival-Date:	Wed Jan 09 10:30:01 UTC 2008
Reviewed by:	ed
MFC after:	3 days
2013-05-11 13:32:38 +00:00
Gleb Smirnoff 5d81d09598 Rate limit the number of remotely triggered ARP log messages
to 1 log message per second.
2013-05-11 10:51:32 +00:00
Mikolaj Golub 1df892f44c Get rid of libl dependency. We needed it only to provide yywrap. But
yywrap is not necessary when parsing a single hast.conf file.

Suggested by:	kib
Reviewed by:	pjd
2013-05-11 09:51:44 +00:00
Eitan Adler 1bfbcedae9 Permit relative paths with mergemaster -m
Reviewed by:	dim, brooks
MFC after:	3 days
2013-05-10 17:42:13 +00:00
Eitan Adler 7a2b450ff8 Fxi a bunch of typos.
PR:	misc/174625
Submitted by:	Jeremy Chadwick <jdc@koitsu.org>
2013-05-10 16:41:26 +00:00
Jaakko Heinonen 4343d321e2 Check the return value of sbuf_finish().
MFC after:	1 week
2013-05-10 09:58:32 +00:00
Devin Teske a28232e303 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
Brooks Davis 43e8dbd316 Remove duplicated copies of various NetBSD compatibility shims used by
makefs and use libnetbsd, contrib/mtree, and contrib/mknod instead.

Sponsored by:	DARPA, AFRLo
MFC after:	1 month
2013-05-09 14:43:36 +00:00
Mikolaj Golub 198ee3001d Move snmp_hast manual to section 3, where all other manual pages for
bsnmp modules are located.

Section 3 (Library Functions) looks wrong for this manual page, which
contains only module description, that is why initially it was located
to section 8 (System Manager's Manual).  On the other hand manual
pages for all other bsnmpd modules are already located in the section
3, and having all pages in one section looks more consistent.  Also,
currently, similarly to manuals for other modules, snmp_hast manual
contains LIBRARY section, which is not good style for section 8.

Requested by:	joel
X-MFC with:	r250379
2013-05-09 11:10:46 +00:00
Peter Wemm 35fdad8420 Unbreak build - this can only build on i386 as-is due to use of libl in
a .so file, and we currently (intentionally) only build libl.a.
2013-05-08 23:30:24 +00:00
Mikolaj Golub 7297a2ff53 HAST module for bsnmpd(1).
Reviewed by:	harti, pjd
MFC after:	2 weeks
2013-05-08 20:03:37 +00:00
Devin Teske 87c1627502 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
Devin Teske 7f6380ef8d 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
Devin Teske 8f1dd43b55 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
Devin Teske 7de72ac1f8 Remove unused variables. 2013-05-07 04:40:57 +00:00
Devin Teske a185dd378c Alphabetize strings by variable names. 2013-05-07 04:23:50 +00:00
Devin Teske 24e8d2827a Re-organize and add missing installVarDefaults and mediaSetDirectory. 2013-05-07 04:03:59 +00:00