Hi,

Raf Czlonka wrote on Tue, Sep 22, 2015 at 04:24:20PM +0100:

> Adding /usr/ports/infrastructure/bin to PATH is trivial, but I was
> wondering how do you deal with adding /usr/ports/infrastructure/man to
> the manpath?
> 
> Given that, currently, man.conf is not required to be present at all and,
> moreover, not having it is equal to:
> 
> manpath /usr/share/man
> manpath /usr/X11R6/man
> manpath /usr/local/man
> 
> Creating /etc/man.conf and adding:
> 
> manpath /usr/ports/infrastructure/man
> 
> will make 'man dpb' work - however, this will make all the default
> implied manpaths stop working.
> 
> The only way this is going to work is if we create /etc/man.conf with
> the below content:
> 
> manpath /usr/share/man
> manpath /usr/X11R6/man
> manpath /usr/local/man

So far, that's just copy and paste from the man.conf(5) manual.

> manpath /usr/ports/infrastructure/man
> 
> Not having man.conf at all to begin with, and wanting to add only a
> single manpath, we have ended up with four - that doesn't seem terribly
> efficient way to accomplish that.
> 
> Is there any other way to have the same result without copying the
> implied manpaths to the newly created file? Anything in the works?

I had no plans and don't feel strongly about it, but if people
like it, committing the following is easy enough, and it doesn't
seem that much bloat.

Any OKs?  Any concerns?
  Ingo


Index: man.conf.5
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/man.conf.5,v
retrieving revision 1.3
diff -u -r1.3 man.conf.5
--- man.conf.5  27 Mar 2015 21:17:16 -0000      1.3
+++ man.conf.5  22 Sep 2015 21:46:22 -0000
@@ -49,6 +49,8 @@
 .Xr makewhatis 8 .
 It can be used multiple times to specify multiple paths,
 with the order determining the manual page search order.
+The default path can be included at the desired place by specifying
+.Ic manpath Cm default .
 .Pp
 Each path is a tree containing subdirectories
 whose names consist of the strings
Index: manpath.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/manpath.c,v
retrieving revision 1.15
diff -u -r1.15 manpath.c
--- manpath.c   7 May 2015 12:07:29 -0000       1.15
+++ manpath.c   22 Sep 2015 21:46:22 -0000
@@ -201,7 +201,11 @@
                        *ep = '\0';
                        /* FALLTHROUGH */
                case 0:  /* manpath */
-                       manpath_add(&conf->manpath, cp, 0);
+                       if (strcmp(cp, "default"))
+                               manpath_add(&conf->manpath, cp, 0);
+                       else
+                               manpath_parseline(&conf->manpath,
+                                   manpath_default, 0);
                        *manpath_default = '\0';
                        break;
                case 1:  /* output */

Reply via email to