makewhatis(8): change index build logic
authorFranco Fichtner <franco@lastsummer.de>
Sun, 8 Dec 2013 13:38:50 +0000 (13:38 +0000)
committerFranco Fichtner <franco@lastsummer.de>
Sun, 8 Dec 2013 17:01:18 +0000 (18:01 +0100)
commitcec6bace6f63efabea4dc51d478f002ab8b1d66a
treeaffedb52e12b316b206c31fc7550c636a9b702f8
parent4aa71e733e0c8f67d002173194017ba9814b9069
makewhatis(8): change index build logic

This commit reflects on issues brought up by swildner.  The idea
behind this change is simple:  track each manual page via
its inode and append all alternative names to the same struct.
The former logic missed references across sections, so the
manual page indexing now covers all sections before creating
the whatis database.

The index now only reflects the layout of /usr/share/man (or
the specified path), and *not* the contents of a manual page,
except for its description.

As a consequence, all MLINKS are now properly referenced in
the apropos(1) output.

I wanted to have the `real' file as the first name, but it's
better to keep the style consistent with `SEE ALSO' sections
by sorting per section, then per name.  Output as follows:

    # apropos vcd
    vcd(4), vkd(4), vke(4), vkernel(7) - virtual kernel architecture
usr.sbin/makewhatis/makewhatis.8
usr.sbin/makewhatis/makewhatis.c