help / color / mirror / Atom feed
From: Ingo Schwarze <>
To: Baptiste Daroussin <>
Subject: Re: Allow gzipped .so and search .so in manpath
Date: Sat, 29 Nov 2014 19:14:39 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Hi Baptiste,

Baptiste Daroussin wrote on Sat, Nov 29, 2014 at 06:54:08PM +0100:

> Shouldn't the look up for .so links be done in the manpath.

No.  That might end up including completely unrelated files
that happen to be in the manpath before the intended file.
It has to include the file in the *same* manpath directory.

> For example I have the WindowMaker manpage (which should really
> be a link in that case :D) installed here:
> /usr/local/man/man1/WindowMaker.1x.gz
> The content is the following:
> .so man1/wmaker.1x.gz
> If I run:
> ./mandoc /usr/local/man/man1/WindowMaker.1x.gz

User error.

> mandoc: man1/wmaker.1x: SYSERR: No such file or directory
> mandoc: man1/wmaker.1x:1:19: FATAL: .so request failed: .so man1/wmaker.1x
> If I trace it it tries to open man1/wmaker.1x then man1/wmaker.1x.gz
> but in the directory where I run the command.

Yes.  The man(1) command is responsible for changing the directory
before running the formatter.  If you run the formatter manually,
you need to specify the directory manually, too:

  $ (cd /usr/local/man && mandoc man1/WindowMaker.1x.gz)

That's one of the reasons .so links are so fragile.

Oh.  Now that i explain how it's supposed to work, i realize
that i could do something about it.  The makewhatis(8) utility
already contains (relatively simple) code to split absolute
filenames into a manpath (/usr/local/man) and a local file
path (man1/WindowMaker.1x[.gz]).  I might try to reuse that
code in mandoc(1) = man -l  to:

 * figure out the manpath for each absolute path given
 * try to chdir(2) there
    - if it fails, be silent about it
    - if it succeeds, remember the original working dir
 * open the file, run the parsers and formatters
 * return to the original working dir
 * proceed to the next file

I'll think about it.

Thanks for asking the question,
 To unsubscribe send an email to

      reply	other threads:[~2014-11-29 18:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24 14:36 Baptiste Daroussin
2014-11-26 20:10 ` Ingo Schwarze
2014-11-26 20:24   ` Baptiste Daroussin
2014-11-27  0:12     ` Ingo Schwarze
2014-11-27  2:03       ` Ingo Schwarze
2014-11-29 17:54       ` Baptiste Daroussin
2014-11-29 18:14         ` Ingo Schwarze [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).