makewhatis: make output reproducible
The mandoc search database generation uses each page's inode number as
a hash key to index hard linked pages only once. However, it also
processed the pages ordered by hash key resulting in effectively non-
deterministic output.
Instead:
- provide fts_open() with a comparison function to process directories and files in a deterministic order
- in addition to the existing hash, insert pages into a linked list which will be sorted (by virtue of 1)
- iterate over pages by the list in 2, instead of hash order
I will work on upstreaming this change.
Reviewed by: bapt
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D8213