Commit Graph

23 Commits

Author SHA1 Message Date
jdolecek 534dd161ea If called without arguments, parse /etc/man.conf and regenerate the whatis
databases specified there. By default, the individual databases
are actually generated by forked children in this case, for
performance reasons. This feature can be switched off by new -f flag.
If the configuration file can't be parsed or doesn't contain any
_whatdb entries, the code falls back to /usr/share/man as before.

Added -C, which allows to specify alternate configuration file. This
  is compatible with apropos(1) and whatis(1) flag of same name.

Update manpage accordingly and document behaviour a bit better.
Also add a HISTORY section, hopefully correct (done using CVS logs).

This solves toolchain/5231 by Tim Rightnour and bin/7696 by Allen Briggs.
2002-03-08 21:59:07 +00:00
jdolecek c8c145f7da Make the whatis enties prefixed with man subdirectory the manpage
appears in, as commonly used for architecture-specific manpages.
The subdirectory is deliberately printed such that the entry is suitable
for cut&paste for man(1).

Fixes bin/9744 by John Hawkinson and misc/14997 by Hiramatsu Yoshifumi.
2002-03-07 20:37:14 +00:00
tv 9fbd88883c Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
  sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
2002-01-31 22:43:33 +00:00
tv a328e34106 Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
2002-01-29 10:20:28 +00:00
tron ace258d3b2 Handle ".Xr" commands with text after the section number probably.
This fixes PR bin/15253 by Thomas Klausner.
2002-01-21 12:21:31 +00:00
christos 94faea123b - fix whitespace nits.
- change error checking philosophy: instead of returning errors to the
  upper layer only to fail silently and exit there, or die of unexpected
  NULL pointers bail out and print an error immediately. Add emalloc/estrdup
  to simplify. This change removed a bunch of code.
- fix size_t/int confusion
- cast argument to isspace(3) to unsigned char
- ? : statement is not an lvalue, so don't take its address.
- unlink the file before we open it, because we chmod it to readonly.
- misc KNF
2002-01-11 18:33:03 +00:00
tron 04a7d6cb3e Avoid strange error message in case of corrupted manual page files. 2001-11-23 13:18:54 +00:00
tron 37dcd07159 Strip overstrike characters from input lines while searching for a "NAME"
section in a formatted manual page. "makewhatis" now recognizes and indexes
the OpenSSL manual pages properly. Fixes PR bin/12390 by Hubert Feyrer.
2001-04-10 21:00:00 +00:00
tron 3849906202 Abort parsing and invoke "nroff" if an unsupported macro is found in the
description section of an unformatted manual page. While this makes the
"makewhatis" two times slower in avoids creation of several incorrect
entries in the "whatis.db" database. This fixes PR bin/12535 by
Thomas Klausner.
2001-04-08 14:49:32 +00:00
tron fd7e4484fc - Use ".TH" lines in unformatted manual pages to find correct section
number.
- Always invoke "nroff" if builtin parser for unformatted manual pages
  fails and try to parse formatted manual page.
2001-04-08 14:27:50 +00:00
cgd 65a1026492 convert to use getprogname() 2001-02-19 22:43:42 +00:00
tron 7cae32ff49 Invoke "nroff" with "-S" (safer mode) option because "makewhatis" is
usually invoked by "root".
2000-07-13 06:45:22 +00:00
tron 714c921491 Kill "nroff" process and wait for its terminiation if we can't setup
the "libz" file handle.
2000-07-13 06:29:43 +00:00
tron b238c131ce Optimize invokation of "nroff":
- Redirect standard error to "/dev/null" because "nroff" error messages
  for temporary files aren't really useful.
- Don't let "nroff" open temporary file. Use its file descriptor as
  standard input.
2000-07-13 06:15:03 +00:00
tron e6f40b0f96 Check exit code returned from "nroff" if it is used to convert
unformatted manual pages.
2000-07-10 08:11:31 +00:00
tron 93cb6f8300 Invoke "nroff" and parse its output if an unformatted manual page uses
macros. Fixes PR bin/9083 by Geoff C. Wing.
2000-07-09 23:07:14 +00:00
tron 91e1f3f01b Don't write leading white spaces and directory names to whatis file. 2000-01-24 23:03:54 +00:00
tron e9a72ad0a3 Accept all kind of whitespaces when searching for the end of a nroff
macro.
1999-12-31 14:50:16 +00:00
tron 3434166ef3 Correct and improve nroff macro stripping. Partially fixes PR bin/9083
by Geoff C. Wing.
1999-12-31 14:28:03 +00:00
tron a0ed22ea5f Recognize manual page sections "l" and "n" used by the package system.
This fixes PR bin/8977 by Thilo Manske.
1999-12-11 20:30:30 +00:00
tron 9cc91f68f9 Set file modes of whatis.db database file to 444 like the old script did. 1999-09-25 21:40:58 +00:00
tron a834c2ce72 Fix incorrect error check after writing database file. 1999-09-25 21:25:55 +00:00
tron ceb9bcabf8 Replace shell script for creating whatis.db database with a C program
which is a little bit faster.
1999-09-25 21:17:37 +00:00