Re: MANPATH not handled correctly

2017-03-10 Thread Steve Kargl
On Sat, Mar 11, 2017 at 07:34:40AM +0100, Baptiste Daroussin wrote:
> On Sun, Jan 08, 2017 at 11:26:33AM -0800, Steve Kargl wrote:
> > MANPATH is not handled correctly.  According to the documentation
> > in apropos(1) and whatis(1):
> > 
(snip)
> 
> Sorry it took time, but it is now fixed. the issue was we have kept our man(1)
> when importing mandoc and I have not noticed that mandoc had that feature.
> 
> I implemented it in our man(1)
> 
> While here I removed the painful warning
> 

Thank you!
Thank you!
Thank you!

-- 
Steve
20161221 https://www.youtube.com/watch?v=IbCHE-hONow
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: MANPATH not handled correctly

2017-03-10 Thread Baptiste Daroussin
On Sun, Jan 08, 2017 at 11:26:33AM -0800, Steve Kargl wrote:
> MANPATH is not handled correctly.  According to the documentation
> in apropos(1) and whatis(1):
> 
>   MANPATH   The standard search path used by man(1) may be changed by
> specifying a path in the MANPATH environment variable.  Invalid
> paths, or paths without manual databases, are ignored.
> Overridden by -M.  If MANPATH begins with a colon, it is
> appended to the default list; if it ends with a colon, it is
> prepended to the default list; or if it contains two adjacent
> colons, the standard search path is inserted between the
> colons.  If none of these conditions are met, it overrides the
> standard search path.
> 
> I have a manpage named mkpic in $HOME/man/man1.  I also have the FreeBSD
> installed manpages, e.g., /usr/share/man/man1/cat.1.gz.  If I have
> 'setenv MANPATH :$HOME/man' in my .cshrc file, then the following occurs:  
> 
> % setenv | grep MANPATH
> MANPATH=:/home/kargl/man
> % apropos mkpic
> (Warning: MANPATH environment variable set)
> mkpic(1) - construct a contour image in MIFF image format
> % apropos cat
> (Warning: MANPATH environment variable set)
> matrix(3) - Array and matrix allocation for FFT library
> 
> So, the above description of MANPATH is incorrect as :/home/kargl/man
> should have been appended to the default MANPATH.
> 
> Interestingly, manpath(1) seems to described what actually happens
> (long lines wrapped):
> 
> % unsetenv MANPATH
> % manpath
> /home/kargl/man:/usr/local/man:/usr/share/man:/usr/share/openssl/man:\
>/usr/local/lib/perl5/site_perl/man:/usr/local/lib/perl5/5.20/perl/man:\
>/usr/local/share/xpdf/man
> % setenv MANPATH :$HOME/sman
> % manpath
> (Warning: MANPATH environment variable set)
> :/home/kargl/man
> 
> The expected result according apropos(1) and whatis(1) for last command is
> 
> % manpath
> /home/kargl/man:/usr/local/man:/usr/share/man:/usr/share/openssl/man:\
>/usr/local/lib/perl5/site_perl/man:/usr/local/lib/perl5/5.20/perl/man:\
>/usr/local/share/xpdf/man:/home/kargl/man

Sorry it took time, but it is now fixed. the issue was we have kept our man(1)
when importing mandoc and I have not noticed that mandoc had that feature.

I implemented it in our man(1)

While here I removed the painful warning

Best regards,
Bapt


signature.asc
Description: PGP signature


Re: MANPATH not handled correctly

2017-01-10 Thread Simon J. Gerraty
Steve Kargl  wrote:
> Well, yes, it is the manpage that gets installed.
> 
> > usr.bin/man/apropos.1
> > 
> > is the one that matches apropos(1)

I should have said "in 10.x" ;-)
In current, MK_MANDOCDB defaults yes, so you are right.

So the script needs an update.
Is there a PR filed?
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: MANPATH not handled correctly

2017-01-10 Thread Baptiste Daroussin
On Sun, Jan 08, 2017 at 11:26:33AM -0800, Steve Kargl wrote:
> MANPATH is not handled correctly.  According to the documentation
> in apropos(1) and whatis(1):
> 
>   MANPATH   The standard search path used by man(1) may be changed by
> specifying a path in the MANPATH environment variable.  Invalid
> paths, or paths without manual databases, are ignored.
> Overridden by -M.  If MANPATH begins with a colon, it is
> appended to the default list; if it ends with a colon, it is
> prepended to the default list; or if it contains two adjacent
> colons, the standard search path is inserted between the
> colons.  If none of these conditions are met, it overrides the
> standard search path.
> 
> I have a manpage named mkpic in $HOME/man/man1.  I also have the FreeBSD
> installed manpages, e.g., /usr/share/man/man1/cat.1.gz.  If I have
> 'setenv MANPATH :$HOME/man' in my .cshrc file, then the following occurs:  
> 
> % setenv | grep MANPATH
> MANPATH=:/home/kargl/man
> % apropos mkpic
> (Warning: MANPATH environment variable set)
> mkpic(1) - construct a contour image in MIFF image format
> % apropos cat
> (Warning: MANPATH environment variable set)
> matrix(3) - Array and matrix allocation for FFT library
> 
> So, the above description of MANPATH is incorrect as :/home/kargl/man
> should have been appended to the default MANPATH.
> 
> Interestingly, manpath(1) seems to described what actually happens
> (long lines wrapped):
> 
> % unsetenv MANPATH
> % manpath
> /home/kargl/man:/usr/local/man:/usr/share/man:/usr/share/openssl/man:\
>/usr/local/lib/perl5/site_perl/man:/usr/local/lib/perl5/5.20/perl/man:\
>/usr/local/share/xpdf/man
> % setenv MANPATH :$HOME/sman
> % manpath
> (Warning: MANPATH environment variable set)
> :/home/kargl/man
> 
> The expected result according apropos(1) and whatis(1) for last command is
> 
> % manpath
> /home/kargl/man:/usr/local/man:/usr/share/man:/usr/share/openssl/man:\
>/usr/local/lib/perl5/site_perl/man:/usr/local/lib/perl5/5.20/perl/man:\
>/usr/local/share/xpdf/man:/home/kargl/man
> 
> Instead of (un)fixing the documentation for apropos(1) and whatis(1), it
> would be preferable to fix manpath to match the description in those
> manpages.  In addition, the Warning should be removed or at least an
> option should be available to suppress the (useless/annoying) Warning.
> This would restore man(1), apropros(1), and whatis(1) to its historical
> behavior prior to svn revision 213317.
> 
> If the documentation for apropos(1) and whatis(1) is unfixed, then manpath(1)
> should have HISTORY and BUGS sections.  The BUGS section should explicitly
> not that MANPATH is no longer a changeable environmental variable by a
> user without incurring the Warning.
> 

Sounds like a bug, I will have a look as soon as I can

Thanks for reporting,
Best regards,
Bapt


signature.asc
Description: PGP signature


Re: MANPATH not handled correctly

2017-01-10 Thread Steve Kargl
On Mon, Jan 09, 2017 at 10:26:16PM -0800, Simon J. Gerraty wrote:
> Steve Kargl  wrote:
> 
> > On Mon, Jan 09, 2017 at 05:19:01PM -0800, Simon J. Gerraty wrote:
> > > Steve Kargl  wrote:
> > > 
> > > > MANPATH is not handled correctly.  According to the documentation
> > > > in apropos(1) and whatis(1):
> > > 
> > > Can you clarify where you are seeing this documentation?
> > > I don't see it in 7.x 10.x or current.
> > > 
> > 
> > This an unaltered FreeBSD-current at r311832.
> > 
> > The text I quoted can be seen at 
> > 
> > https://svnweb.freebsd.org/base/head/contrib/mdocml/apropos.1?revision=294113&view=markup
> > 
> 
> But that isn't the man page that gets installed.
> 

Well, yes, it is the manpage that gets installed.

> usr.bin/man/apropos.1
> 
> is the one that matches apropos(1)
> 

>From src/usr.bin/man/Makefile

.if ${MK_MANDOCDB} == no
LINKS+= ${BINDIR}/man ${BINDIR}/apropos \
${BINDIR}/man ${BINDIR}/whatis
MAN+=   apropos.1
MLINKS= apropos.1 whatis.1
.endif

I have not set or unset MK_MANDOCDB.  From src.opt.mk

__DEFAULT_YES_OPTIONS = \
...
MANDOCDB \
...

% svn blame src.opts.mk | grep MANDOC
283777   bapt MANDOCDB \
% svn log -r 283777

r283777 | bapt | 2015-05-30 10:41:37 -0700 (Sat, 30 May 2015) | 11 lines

Switch to mandoc's version of makewhatis(8), whatis(1), apropos(1) utilities.

This change among other things improve search capabilities over the manpages
allowing fine grain query.

A new build option WITHOUT_MANDOCDB has been added to keep the ancient version
of the database and the tools. The plan is to entirely remove this option before
11.0-RELEASE.

Differential Revision:  https://reviews.freebsd.org/D2603

-- 
Steve
20161221 https://www.youtube.com/watch?v=IbCHE-hONow
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: MANPATH not handled correctly

2017-01-10 Thread Steve Kargl
On Mon, Jan 09, 2017 at 05:19:01PM -0800, Simon J. Gerraty wrote:
> Steve Kargl  wrote:
> 
> > MANPATH is not handled correctly.  According to the documentation
> > in apropos(1) and whatis(1):
> 
> Can you clarify where you are seeing this documentation?
> I don't see it in 7.x 10.x or current.
> 

This an unaltered FreeBSD-current at r311832.

The text I quoted can be seen at 

https://svnweb.freebsd.org/base/head/contrib/mdocml/apropos.1?revision=294113&view=markup

starting at line 346 and ending at 362.

The Makefile in /usr/src/usr.bin at line 93 points at the 
directory mandoc.  The Makefile in /usr/src/usr.bin/mandoc
points at ../../contrib/mdocml.

-- 
Steve
20161221 https://www.youtube.com/watch?v=IbCHE-hONow
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: MANPATH not handled correctly

2017-01-09 Thread Simon J. Gerraty
Steve Kargl  wrote:

> On Mon, Jan 09, 2017 at 05:19:01PM -0800, Simon J. Gerraty wrote:
> > Steve Kargl  wrote:
> > 
> > > MANPATH is not handled correctly.  According to the documentation
> > > in apropos(1) and whatis(1):
> > 
> > Can you clarify where you are seeing this documentation?
> > I don't see it in 7.x 10.x or current.
> > 
> 
> This an unaltered FreeBSD-current at r311832.
> 
> The text I quoted can be seen at 
> 
> https://svnweb.freebsd.org/base/head/contrib/mdocml/apropos.1?revision=294113&view=markup
> 

But that isn't the man page that gets installed.

usr.bin/man/apropos.1

is the one that matches apropos(1)

Note, not saying the behavior you describe shouldn't be implemented,
but it does not appear to be the claimed behavior.

> starting at line 346 and ending at 362.
> 
> The Makefile in /usr/src/usr.bin at line 93 points at the 
> directory mandoc.  The Makefile in /usr/src/usr.bin/mandoc
> points at ../../contrib/mdocml.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: MANPATH not handled correctly

2017-01-09 Thread Simon J. Gerraty
Steve Kargl  wrote:

> MANPATH is not handled correctly.  According to the documentation
> in apropos(1) and whatis(1):

Can you clarify where you are seeing this documentation?
I don't see it in 7.x 10.x or current.

Eg, in 10.2 apropos(1) says only:

ENVIRONMENT
 The following environment variables affect the execution of
 apropos:

 MANLOCALES, MANPATH, PATH
 Used to find the location of the whatis database
 files. See manpath(1) for additional information.

 PAGER  Program used to display files.  If unset, more -s is used.


> 
>   MANPATH   The standard search path used by man(1) may be changed by
> specifying a path in the MANPATH environment variable.  Invalid
> paths, or paths without manual databases, are ignored.
> Overridden by -M.  If MANPATH begins with a colon, it is
> appended to the default list; if it ends with a colon, it is
> prepended to the default list; or if it contains two adjacent
> colons, the standard search path is inserted between the
> colons.  If none of these conditions are met, it overrides the
> standard search path.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


MANPATH not handled correctly

2017-01-09 Thread Steve Kargl
MANPATH is not handled correctly.  According to the documentation
in apropos(1) and whatis(1):

  MANPATH   The standard search path used by man(1) may be changed by
specifying a path in the MANPATH environment variable.  Invalid
paths, or paths without manual databases, are ignored.
Overridden by -M.  If MANPATH begins with a colon, it is
appended to the default list; if it ends with a colon, it is
prepended to the default list; or if it contains two adjacent
colons, the standard search path is inserted between the
colons.  If none of these conditions are met, it overrides the
standard search path.

I have a manpage named mkpic in $HOME/man/man1.  I also have the FreeBSD
installed manpages, e.g., /usr/share/man/man1/cat.1.gz.  If I have
'setenv MANPATH :$HOME/man' in my .cshrc file, then the following occurs:  

% setenv | grep MANPATH
MANPATH=:/home/kargl/man
% apropos mkpic
(Warning: MANPATH environment variable set)
mkpic(1) - construct a contour image in MIFF image format
% apropos cat
(Warning: MANPATH environment variable set)
matrix(3) - Array and matrix allocation for FFT library

So, the above description of MANPATH is incorrect as :/home/kargl/man
should have been appended to the default MANPATH.

Interestingly, manpath(1) seems to described what actually happens
(long lines wrapped):

% unsetenv MANPATH
% manpath
/home/kargl/man:/usr/local/man:/usr/share/man:/usr/share/openssl/man:\
   /usr/local/lib/perl5/site_perl/man:/usr/local/lib/perl5/5.20/perl/man:\
   /usr/local/share/xpdf/man
% setenv MANPATH :$HOME/sman
% manpath
(Warning: MANPATH environment variable set)
:/home/kargl/man

The expected result according apropos(1) and whatis(1) for last command is

% manpath
/home/kargl/man:/usr/local/man:/usr/share/man:/usr/share/openssl/man:\
   /usr/local/lib/perl5/site_perl/man:/usr/local/lib/perl5/5.20/perl/man:\
   /usr/local/share/xpdf/man:/home/kargl/man

Instead of (un)fixing the documentation for apropos(1) and whatis(1), it
would be preferable to fix manpath to match the description in those
manpages.  In addition, the Warning should be removed or at least an
option should be available to suppress the (useless/annoying) Warning.
This would restore man(1), apropros(1), and whatis(1) to its historical
behavior prior to svn revision 213317.

If the documentation for apropos(1) and whatis(1) is unfixed, then manpath(1)
should have HISTORY and BUGS sections.  The BUGS section should explicitly
not that MANPATH is no longer a changeable environmental variable by a
user without incurring the Warning.

-- 
Steve
20161221 https://www.youtube.com/watch?v=IbCHE-hONow
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"