This is Gentoo 2.2 (4.4.6-gentoo x86_64).
The system manpages seem to be bzipped as in
/usr/share/man/man1/ls.1.bz2

Why is that? Is there any benefit to compressing the manpages nowadays?
IMHO it only adds a layer of complexity, for very questionable benefit
(i.e. disk space): how much of the overal system do _manpages_ take?

The particular problem I am having is that http://mdocml.bsd.lv/ ,
my manpage formatter of choice, does deliberately not support bzip
(or any other outside decompressors for that matter).

Would you please consider distributing plain *.{123456789} manpages
and getting rid of the bzip layer?

        Thank you

                Jan



> I am using mdocml on other systems beside OpenBSD.
> On most linuxes, it works just fine, including gzipped manpages
> such as /usr/share/man/man1/ls.1.gz od Debian.
> 
> Now I found myself on a Gentoo linux, where manpages are bzipped,
> like /usr/share/man/man1/ls.1.bz2; on this system man(1) displays
> what seems to be the verbatim 'bz2' file, unbziped (attached).
> See below for the out put of 'man ls'.
> 
> Is it because mdocml does not support bzip?

Yes.  Neither does it support piping through external unpackers.

> If so, should man rather fail than display the page?

No.  It's a feature that mandoc(1) and man(1) never fail, no matter
what the input is.  It is a convenience for arbitrary, very serious
bugs in otherwise half-sane manuals.  I spent a lot of time archieving
that feature.  It is not a security risk even when you do garbage
in - garbage out.  It still doesn't write to disk, it still doesn't
access arbitrary files, it still doesn't print control codes to the
terminal - you see all those harmless question marks in there?

> I don't know why any system would bzip it's manpages,
> but apparently Gentoo does.

Exactly.  It is completely stupid nowadays.  Just tell them to stop
doing such nonsense and install uncompressed.  Manual pages are small
compared to libraries:

schwarze@isnote $ du -sk /usr/share/man                                        
40472   /usr/share/man
schwarze@isnote $ du -sk /usr/lib       
229516  /usr/lib
schwarze@isnote $ du -sk /usr/local/man 
50022   /usr/local/man
schwarze@isnote $ du -sk /usr/local/lib 
2576778 /usr/local/lib

That's *uncompressed* mind you, and extensive, high quality OpenBSD
manuals.  Tell me, which system is unable to afford 100 Megabyte
of disk space for manual pages?  In this day and age?  An embedded
system?  Right, you certainly have manual pages there.

Compressing that stuff just makes life harder for absolutely no benefit
whatsoever.

> Are there any plans to support bzip beside the ubuquituous gzip?
> (I understand if you don't want that in your code.)

No plans, and some opposition to trying.

Even supporting *.gz is kind of stupid, but that stupidy is widespread
enough that i bowed to the pressure.  It's implemented in the safest
possible way by linking directly against the time proven and no
longer much changing libz.  I'm very reluctant to resurrect the
code to spawn external decompressors - even in portable mandoc.
It is messy and potentially risky.


So, you want to hear something constructive?  Your best option is to
just decompress that stuff on your system.  (Gentoo is famous for
its excessive configurability - maybe there is even an option?)
Otherwise, you can set up a small shell script to recursive run
bunzip2(1) across the directories in question and run it whenever
you are shown garbage after installing new stuff.  Bonus:  Manuals
never get deleted even after uninstalling stuff, so you can still
look things up to find out whether it might be worth reinstalling
a package that you once had.

If you are unable or unwilling to do that, just use a different
man(1) implementation and use mandoc(1) the traditional way as a
groff drop-in replacement.  All you lose that way is apropos(1).

Yours,
  Ingo

Reply via email to