manwhich: Deriving MANPATH from PATH [PSARC/2007/688 FastTrack timeout 12/19/2007]
Lawrence Lee
Lawrence.Lee at sun.com
Thu Dec 13 07:25:59 PST 2007
John Plocher wrote:
> 4. Technical Description:
> 4.1. Details:
> The source file man.c will be enhanced to refer to PATH only in the
> absence of MANPATH. Each element of PATH will be translated based
> into the appropriate MANPATH element based upon the following
> priorities:
>
> - Explicit transformation rule. For example, /usr/ucb in PATH
> translates to /usr/share/man,1b.
> - The parent directory of the PATH directory with /share/man
> appended. For example, /usr/gnu/bin becomes
> /usr/gnu/share/man.
> - The parent directory of the PATH directory with /man
> appended. For example, /opt/VRTSvcs/bin becomes
> /opt/VRTSvcs/man because /opt/VRTSvcs/share/man does not exist
> but /opt/VRTSvcs/man does.
>
> In addition and higher precedence to the above, if man is invoked
> referring to particular instance of a command (e.g. "man ./ls" or
> "man /usr/ucb/ps") the path transformation rules are applied using
> the directory component of the argument.
>
> In all cases where MANPATH is not defined and the path to a command
> is not specified /usr/share/man will be appended to MANPATH if it
> is not otherwise included based upon PATH transform rules. This
> ensures that sections other than 1* are accessible.
>
> A prototype of this behavior has been implemented and is available
> for review at http://cr.opensolaris.org/~mgerdts/manpath-from-path/.
>
Would it be an appropriate extension to also use this behavior
if MANPATH is defined, but the requested man page is not found?
Will the transformation rules be hardcoded in the man.c
or will there be a system file which defines the transformation rules.
IOW - if sbin or exe is not included in the default transformation rules,
could a system administrator extend those rules?
More information about the opensolaris-arc
mailing list