summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Removing INSECURE mode. This is a work in progress! Logic forKristaps Dzonsons2011-11-274-110/+96
| | | | formatting manpages is now linked into man.cgi.
* Sync to OpenBSD, mostly gratuitous and whitespace differences,Ingo Schwarze2011-11-266-54/+61
| | | | | | | | | but a few serious things as well: * -M overrides MANPATH * -m prepends to the path * put back database close calls that got lost in mandocdb * missing sys/types.h in manpath.c, needed for size_t ok kristaps@
* Rename manup(8) to catman(8), which Linux already uses for a similar tool.Kristaps Dzonsons2011-11-262-3/+3
|
* Store page titles in the correct case, and by default, onlyIngo Schwarze2011-11-262-38/+201
| | | | | | put stuff into the database that man(1) will be able to retrieve. However, support an option to use all directories and files. feedback and ok kristaps@
* I say that mandocdb(8) uses "man(1)'s method", but it doesn't. It just usesKristaps Dzonsons2011-11-241-1/+1
| | | | | the configuration file and ignores MANPATH. Everybody else uses MANPATH (being apropos and man), so why shouldn't we?
* Make a small manual for how to run man.cgi.Kristaps Dzonsons2011-11-242-0/+79
| | | | | | This exists almost entirely to document that /tmp must exist in a jailed Apache directory for dbopen() not to fail. This was a massive headache to track down.
* Let man.cgi run in two modes:Kristaps Dzonsons2011-11-241-27/+90
| | | | | | | | | | | | | (1) Insecure. This means that we're operating over the full file-system with access to mandoc(1). In this mode, mandocdb entries are formatted on-the-fly. The $INSECURE environment variable must be passed to man.cgi for this mode to work. (2) Secure. Manuals are assumed to be pre-formatted in a cache directory, which may be set with $CACHE_DIR but default to /cache/man.cgi. This mode works with manup(8), which updates the cached pages from outside of the jail. man.cgi simply locates the manual file and outputs it to stdout.
* Have manup(8) put relative paths in its output man.conf. This lets usKristaps Dzonsons2011-11-241-2/+17
| | | | have arbitrarily-located cache directories for man.cgi.
* Allow man.conf file to be assignable.Kristaps Dzonsons2011-11-242-4/+4
|
* Export the manpath_manconf() function, slightly reorderng manpath.c whileKristaps Dzonsons2011-11-242-13/+21
| | | | | doing so. This will be used by a jailed man.cgi, as the cache built by manup(8) creates a man.conf for it to use.
* Add manup(8). This runs through mandocdb(8) databases (in the same way thatKristaps Dzonsons2011-11-243-2/+635
| | | | | | | apropos(1) does so) and updates an HTML fragment cache for use by man.cgi. Right now man.cgi is "online" in that it requires mandoc(1) in its path, but this doesn't work for, say, OpenBSD's apache chroot(1). This allows a cache to be maintained.
* Add pkgsrc to downstream. Ok'd Thomas Klausner.Kristaps Dzonsons2011-11-231-0/+6
|
* Fix whitespace in manuals.Kristaps Dzonsons2011-11-232-3/+2
|
* man.cgi works for the non-jailed case.Kristaps Dzonsons2011-11-231-80/+421
| | | | | | | In other words, if you smash this into a cgi-bin directory, it will Just Work for your system's manuals (it of course needs access to mandoc(1) and your file-system, hence "non-jailed"). The notion of a jailed case is much more subtle and being worked on now.
* Adjust Makefile for manpath.{c,h} linking.Kristaps Dzonsons2011-11-231-11/+16
|
* Let apropos_db.h export the volume of manpages for a parsed record.Kristaps Dzonsons2011-11-232-6/+12
| | | | | | | | | This is necessary since an array of records can have duplicate record numbers in different mandoc.index files. The volume [right now] is just the index of the parsed mandoc.index in the manpaths. This is sensible because the order of the manpath is significant (it's the order of duplicate-named manuals displayed by man(1)) and is thus not likely to change.
* Have mandocdb(8) take advantage of manpath.h.Kristaps Dzonsons2011-11-232-5/+32
| | | | | This brings it in line with makewhatis(8), which, like apropos(1), will use man.conf (or manpath(1)) if no manpath entries are provided.
* Have apropos(1) take advantage of manpath.h instead of doing the workKristaps Dzonsons2011-11-231-133/+4
| | | | itself.
* Support for Open/NetBSD's /etc/man.conf and others' manpath(1).Kristaps Dzonsons2011-11-232-0/+206
| | | | | Most of this code (except the manpath part) written by schwarze@. This isn't hooked into anything yet.
* typo reported by Steffen Daode Nurpmeso <sdaoden at googlemail dot com>Ingo Schwarze2011-11-231-2/+2
| | | | and remove a trailing blank noticed by jmc@
* Update historical record to be historical and not made-up. Data fromKristaps Dzonsons2011-11-211-7/+15
| | | | | <manpages.bsd.lv/history.html>. Ok schwarze@ (with modifications) and Jason McIntyre.
* Initial support for man.conf/makepath(1).Kristaps Dzonsons2011-11-203-11/+108
|
* Clarify some behaviour, bringing schwarze@'s patch and mine closer togetherKristaps Dzonsons2011-11-203-53/+50
| | | | | | | | | | | | | | | | (although I still don't have -M, which is a big piece). First, the default search path is the cwd. This will change to use -M once I look over that code. If MANPATH is specified, this replaces the cwd. Both of these are augmented by -m. If paths don't exist or don't have databases, they're silently ignored. This makes perfect sense: you may be given a superset of possible paths. The corner case of no paths (where, say, MANPATH consists of bogus paths or the cwd is unreadable) simply means that no paths are searched.
* Ooops... tiny type error slipped in.Kristaps Dzonsons2011-11-201-1/+1
|
* Integrate a moderately-patched version of schwarze@'s support for multipleKristaps Dzonsons2011-11-204-81/+186
| | | | | | | | | | | directories containing mandocdb(8) databases. Some changes follow: (1) don't support -M yet; (2) fall back to cwd if no prior manpath has been specified; (3) resolve manpages using realpath() to prevent consecutive chdir()'s over relative paths; (4) note where further error-reporting is required; (5) fix leaking memory on exit in several cases.
* Fix white-space in apropos_db.c to make merging cleaner.Kristaps Dzonsons2011-11-201-39/+39
|
* Merge schwarze@'s work for 64-bit types. This is based on a tweaked patchKristaps Dzonsons2011-11-204-56/+114
| | | | | | | submitted to tech@ on 16/11/2011, 01:39. It has been updated to account for the logical-operator functions and to avoid keeping a live pointer into the DBT value, which is not guaranteed to be consistent across calls into the bdb library.
* Improve misleading comment:Ingo Schwarze2011-11-191-1/+5
| | | | | | | | * Not sure there were any text nodes, might have been other stuff instead. * Not sure it was just one node, maybe several were deleted. * No problem if some nodes were deleted, as long as some valid ones are left. * We do not leave early, but after cleaning out all the crap. * We are not "bailing", but we consider the block valid after cleanup.
* Fix condition. Not enough tea.Joerg Sonnenberger2011-11-181-1/+1
|
* Don't depend on snprintf to handle NULL strings. Deal with missing date.Joerg Sonnenberger2011-11-181-2/+4
|
* Don't crash if the date can't be extracted. Don't depend on snprintfJoerg Sonnenberger2011-11-181-4/+6
| | | | handling NULL strings.
* Slightly adjust last: return successful as some times the correct errorJoerg Sonnenberger2011-11-181-1/+1
| | | | is raised later.
* Convert an assert into an explicit check. man_unscope can be triggeredJoerg Sonnenberger2011-11-181-1/+2
| | | | on unknown macros.
* Bail out explicitly on invalid .Rs content like:Joerg Sonnenberger2011-11-181-0/+4
| | | | | | | | .Rs plain text .Re This avoids a crash on invalid.
* Evaluation with logical subexpressions. This allows support for arbitrary,Kristaps Dzonsons2011-11-184-197/+450
| | | | nested logical subexpressions with AND (-a) and OR (-o) support.
* using undefined macros or strings should define them to be emptyIngo Schwarze2011-11-171-0/+3
|
* Guard mandocdb.h inclusion.Kristaps Dzonsons2011-11-171-0/+4
|
* Correctly handle constructs likeJoerg Sonnenberger2011-11-161-2/+7
| | | | | .TP 8 .SH foo
* Add lots of information about special characters that's actually neededIngo Schwarze2011-11-141-40/+175
| | | | | | in practice, and discourage using fancy characters in manuals. Text about "Dashes and Hyphens" by jmc@. Feedback and ok jmc@, grudgingly ok kristaps@.
* Have exprcomp() accept a string instead of an array-pointer. Also, collapseKristaps Dzonsons2011-11-143-9/+36
| | | | | the arguments in apropos(1) into a single string passed to exprcomp(). Ok schwarze@.
* Make the man(7) page footer the same as in groff.Ingo Schwarze2011-11-131-9/+16
|
* typo: overful -> overfull; thanks to jmc@Ingo Schwarze2011-11-131-1/+1
|
* Make the default left text margin configurable from the command line,Ingo Schwarze2011-11-135-23/+38
| | | | | | | just like the default right margin already is. This may be useful for people with expensive screen real estate. Besides, it helps automated man(7) to mdoc(7) output comparisons to validate -Tman output. ok kristaps@ on an earlier version
* Rewrite the expression parser for a more concise syntax:Ingo Schwarze2011-11-133-65/+54
| | | | | | | | | | | | | apropos [search_type[,...]=]substring apropos search_type[,...][,i]~regex ... and expression evaluation must take the search type into account. This allows to: * drop the global -I option and * drop the enum match, just using a boolean int. "go ahead" kristaps@
* Inventing new keywords for mostly the same thing when a well-establishedIngo Schwarze2011-11-136-69/+74
| | | | | | | | | | set of keywords already exists is a bad idea, so reuse the mdoc(7) macro names as apropos(1) search types. This is a gain in brevity as well. Some time ago, kristaps@ agreed in principle. The search type bit field constants are used by both mandocdb(8) and apropos(1) and should better stay in sync, so give them their own header file.
* Less misleading file names; ok kristaps@.Ingo Schwarze2011-11-135-9/+9
|
* another detail to implement;Ingo Schwarze2011-11-131-0/+3
| | | | long live the tricky exceptions!
* Fix two crashes that occur when walking very large (i.e. real-world) trees:Ingo Schwarze2011-11-131-4/+4
| | | | | | 1) Avoid excessive, needless recursion, lest you overflow the stack; 2) Close all dir file descriptors, lest you run out of descriptors. ok kristaps@
* Use proper infix expressions and provide a default. (Exact match.)Kristaps Dzonsons2011-11-091-11/+24
|
* Make apropos's lookup use a find(1)-like expression. I'll write more onKristaps Dzonsons2011-11-094-84/+146
| | | | | | | | | | this when it completes; this is to keep it in-tree. Right now this uses prefix notation. Ignore it. I'll make this into infix notation real soon. The goal of this (exprcomp and exprexec) is to have arbitrary logical expressions.