tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Cc: jmc@openbsd.org
Subject: Re: chdir() in mandocdb
Date: Sat, 10 Dec 2011 15:11:31 +0100	[thread overview]
Message-ID: <20111210141131.GD6375@iris.usta.de> (raw)
In-Reply-To: <4EE07044.4070605@bsd.lv>

Hi Kristaps,

Kristaps Dzonsons wrote on Thu, Dec 08, 2011 at 09:07:32AM +0100:
> Ingo Schwarze wrote:
>> Kristaps Dzonsons wrote:

>>> I notice that the chdir() for mandocdb()'s OP_NEW is into the base
>>> directory of the manuals (e.g., /usr/share/man).  However, when I
>>> run mandocdb over OpenBSD 5.0, I see a few inconsistencies:
>>>
>>>   /usr/X11R6/man/man3/XUngrabDevice.3

>> That was a bug in Xenocara, i fixed it here:
>>
>> http://www.openbsd.org/cgi-bin/cvsweb/xenocara/lib/libXi/man/ \
>>   XIUngrabDevice.man

[...]
>>> All of these have an `so' in the current directory.  Looking at
>>> roff(7) for `so', this is the correct behaviour.

>> No; the roff(7) manual muddles the point.
>> What it says is correct, but only makes sense
>> when you already know that man(1) does a chdir(2)
>> to the root of the tree.

> Can we disambiguate roff(7) to this effect, assuming that the man(1)
> behaviour is consistent across operating systems?

Well, it has to be, X manuals enforce that consistency.

Hence, OK for the following patch?
  Ingo


Index: roff.7
===================================================================
RCS file: /cvs/src/share/man/man7/roff.7,v
retrieving revision 1.17
diff -u -r1.17 roff.7
--- roff.7	23 Nov 2011 02:12:22 -0000	1.17
+++ roff.7	10 Dec 2011 14:06:50 -0000
@@ -870,6 +870,22 @@
 .Qq ../
 and
 .Qq /.. .
+.Pp
+This request requires
+.Xr man 1
+to change to the right directory before calling
+.Xr mandoc 1 ,
+per convention to the root of the manual tree.
+Typical usage looks like:
+.Pp
+.Dl \&.so man3/Xcursor.3
+.Pp
+As the whole concept is rather fragile, usage of
+.Sx \&so
+is discouraged.
+Use
+.Xr ln 1
+instead.
 .Ss \&ta
 Set tab stops.
 This line-scoped request can take an arbitrary number of arguments.
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2011-12-10 14:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-07 11:11 Kristaps Dzonsons
2011-12-08  1:34 ` Ingo Schwarze
2011-12-08  8:07   ` Kristaps Dzonsons
2011-12-10 14:11     ` Ingo Schwarze [this message]
2011-12-10 16:08       ` Kristaps Dzonsons

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20111210141131.GD6375@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=jmc@openbsd.org \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).