Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

man.conf(5) _subdir search order

2 views
Skip to first unread message

Ingo Schwarze

unread,
Jul 12, 2013, 11:52:43 AM7/12/13
to te...@openbsd.org, Jérémie Courrèges-Anglas, Jan Stary
Hi,

i'm moving this thread from misc@ to tech@ because i propose a patch.
When replying, please make sure you do not cross-post.

Jérémie Courrèges-Anglas wrote on Fri, Jul 12, 2013 at 02:05:48PM +0200:
> Jan Stary <ha...@stare.cz> writes:

>> The mdoc(7) manpage says about .Bl that
>>
>> The -width and -offset arguments accept scaling widths
>> as described in roff(7) or use the length of the given string.
>>
>> The words "width" or "offset" do not appear anywhere in roff(7).

> You're looking at the roff(7) manpage that comes with groff.
> Your pager probably prints "/usr/local/man/cat7/roff.0" at the
> bottom of your screen.

To find out how man(1) resolves your query string to a manual page file,
you can also use

$ man -w roff
/usr/local/man/cat7/roff.0
/usr/share/man/man7/roff.7

Without the -w, man(1) will display the first one.
That's the ordering resulting from the default man.conf(5):
ports override the base system.
I consider that a bug, thanks for reporting it!

> You could use man -a and then enter ":n" to get the base manpage.

Much easier:

$ man 7 roff

..

Doubtless, now you wonder why explicitly specifying the section
gives you the other (correct) ordering, but indeed it does:

$ man -w 7 roff
/usr/share/man/man7/roff.7
/usr/local/man/cat7/roff.0

To understand what's going on here, let's look at the default
file /etc/man.conf. When explicitly specifying the section,
the following entry takes effect:

7 /usr/{share,X11R6,local}/man/{cat,man}7

That expands to, as it should:

/usr/share/man/cat7
/usr/share/man/man7
/usr/X11R6/man/cat7
/usr/X11R6/man/man7
/usr/local/man/cat7
/usr/local/man/man7

When not specifying the section, the following entries take effect:

_subdir ... cat7 man7 ...
_default /usr/{share,X11R6,local,ports/infrastructure}/man/

That *first* expands to

/usr/{share,X11R6,local,ports/infrastructure}/man/cat7
/usr/{share,X11R6,local,ports/infrastructure}/man/man7

and *then* to

/usr/share/man/cat7
/usr/X11R6/man/cat7
/usr/local/man/cat7
/usr/ports/infrastructure/man/cat7
/usr/share/man/man7
/usr/X11R6/man/man7
/usr/local/man/man7
/usr/ports/infrastructure/man/man7

which is the wrong ordering.


Here is the fix, making sure that section 1 from ports still
overrides section 6 from base, but cat from ports does *not*
override man from base.

OK?

Yours,
Ingo


Index: man.conf
===================================================================
RCS file: /cvs/src/etc/man.conf,v
retrieving revision 1.17
diff -u -r1.17 man.conf
--- man.conf 11 Apr 2011 14:45:41 -0000 1.17
+++ man.conf 12 Jul 2013 15:25:14 -0000
@@ -9,7 +9,7 @@
_whatdb /usr/X11R6/man/whatis.db

# Subdirectories for paths ending in '/', IN SEARCH ORDER.
-_subdir cat1 man1 cat8 man8 cat6 man6 cat2 man2 cat3 man3 cat5 man5 cat7 man7 cat4 man4 cat9 man9 cat3p man3p cat3f man3f catn mann
+_subdir {cat,man}1 {cat,man}8 {cat,man}6 {cat,man}2 {cat,man}3 {cat,man}5 {cat,man}7 {cat,man}4 {cat,man}9 {cat,man}3p {cat,man}3f {cat,man}n

# Files typed by suffix and their commands.
# Note the order: .Z must come after .[1-9n].Z, or it will match first.

David Coppa

unread,
Jul 12, 2013, 12:14:08 PM7/12/13
to Ingo Schwarze, te...@openbsd.org, Jérémie Courrèges-Anglas, Jan Stary
On Fri, Jul 12, 2013 at 5:51 PM, Ingo Schwarze <schw...@usta.de> wrote:

> Here is the fix, making sure that section 1 from ports still
> overrides section 6 from base, but cat from ports does *not*
> override man from base.

Definitely makes sense.

> OK?

Ok with me.

> Yours,
> Ingo
>

ciao,
David

Jérémie Courrèges-Anglas

unread,
Jul 13, 2013, 8:06:01 AM7/13/13
to David Coppa, Ingo Schwarze, te...@openbsd.org, Jan Stary

Hi,

David Coppa <dco...@gmail.com> writes:

> On Fri, Jul 12, 2013 at 5:51 PM, Ingo Schwarze <schw...@usta.de> wrote:
>
>> Here is the fix, making sure that section 1 from ports still
>> overrides section 6 from base, but cat from ports does *not*
>> override man from base.
>
> Definitely makes sense.
>
>> OK?
>
> Ok with me.

I thought the ports -> base manpages order was on purpose, but I don't
like that situation. ok jca@

>> Yours,
>> Ingo
>>
>
> ciao,
> David
>
>> Index: man.conf
>> ===================================================================
>> RCS file: /cvs/src/etc/man.conf,v
>> retrieving revision 1.17
>> diff -u -r1.17 man.conf
>> --- man.conf 11 Apr 2011 14:45:41 -0000 1.17
>> +++ man.conf 12 Jul 2013 15:25:14 -0000
>> @@ -9,7 +9,7 @@
>> _whatdb /usr/X11R6/man/whatis.db
>>
>> # Subdirectories for paths ending in '/', IN SEARCH ORDER.
>> -_subdir cat1 man1 cat8 man8 cat6 man6 cat2 man2 cat3 man3 cat5 man5 cat7 man7 cat4 man4 cat9 man9 cat3p man3p cat3f man3f catn mann
>> +_subdir {cat,man}1 {cat,man}8 {cat,man}6 {cat,man}2 {cat,man}3 {cat,man}5 {cat,man}7 {cat,man}4 {cat,man}9 {cat,man}3p {cat,man}3f {cat,man}n
>>
>> # Files typed by suffix and their commands.
>> # Note the order: .Z must come after .[1-9n].Z, or it will match first.
>>
>

--
Jérémie Courrèges-Anglas
PGP Key fingerprint: 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494

Pascal Stumpf

unread,
Jul 13, 2013, 4:11:28 PM7/13/13
to Ingo Schwarze, te...@openbsd.org, Jérémie Courrèges-Anglas, Jan Stary
On Fri, 12 Jul 2013 17:51:56 +0200, Ingo Schwarze wrote:
> Here is the fix, making sure that section 1 from ports still
> overrides section 6 from base, but cat from ports does *not*
> override man from base.
>
> OK?

This has bothered me for some time already. Please go ahead, ok
pascal@.
0 new messages