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 <h...@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.

Reply via email to