Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 09 Sep 2010 23:48:37 +0400
From:      Anonymous <swell.k@gmail.com>
To:        Gordon Tetlow <gordon@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: CFR: Replace man/manpath/whatis/apropos with a shell script
Message-ID:  <868w3aem0a.fsf@gmail.com>
In-Reply-To: <AANLkTim3OJH_B_ZmEbxSvg6Ehww=D8X1e1tYhMrhROZi@mail.gmail.com> (Gordon Tetlow's message of "Thu, 19 Aug 2010 00:45:46 -0700")
References:  <AANLkTi=d1RqZhkJJ94DioZkBq3Pq5vrj0kxBSgdW%2BUUo@mail.gmail.com> <86sk2b79oi.fsf@gmail.com> <AANLkTimRLPe25WeG5JSJJeNbHstq7KizJ-eHOKF-Ju-T@mail.gmail.com> <AANLkTim3OJH_B_ZmEbxSvg6Ehww=D8X1e1tYhMrhROZi@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Gordon Tetlow <gordon@freebsd.org> writes:
> Gordon Tetlow <gordon@freebsd.org> writes:
>> Anonymous <swell.k@gmail.com> writes:
>>> It doesn't search in bin/../man nor in bin/.man. For example,
>>> my PATH contains $LOCALBASE/bin:$HOME/.bin, while /etc/
>>> manpath.config
>>> is default one and contains /usr/local/man which does not
>>> exist here.
>>
>> Guess I missed that pretty badly in my port. I'll go back and
>> retool the logic for this but that'll take a bit of time.
>
> Added. Latest version at http://people.freebsd.org/~gordon/man.sh

The order is still bogus compared to gnu man. If I don't like our
ancient GNU tools and altered PATH in order to prefer ones from ports
then I certainly don't want to view old manpages, too. The base manpath
should be appended *after* any PATH substitutions.

  $ man -aw gperf # man.sh
  /usr/share/man/en.UTF-8/man1/gperf.1.gz
  /usr/share/man/man1/gperf.1.gz
  LOCALBASE/man/man1/gperf.1.gz

  $ man -aw gperf # gnu man
  LOCALBASE/man/man1/gperf.1.gz
  /usr/share/man/en.UTF-8/man1/gperf.1.gz

  > $ echo $PATH
  > LOCALBASE/libexec/ccache:HOME/.bin:LOCALBASE/sbin:LOCALBASE/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:HOME/blah/bin

And it doesn't show anything when there are no arguments, not even
returning with exit code > 0.

  $ man # man.sh

  $ man # gnu man
  What manual page do you want?
  zsh: exit 1     man

> It's a slightly different heuristic than the existing man
> implementation since I don't support the notion of MANPATH_MAP.
> Here's the order:
>
> Default manpaths (/usr/share/man:/usr/share/openssl/man:/usr/local/
> man)
> Parse $PATH (path/man:path/MAN:(if ending in /bin)path/../man)
> Parse config files



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?868w3aem0a.fsf>