]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
whereis: support MANPATH environment variable
authorSami Kerola <kerolasa@iki.fi>
Sat, 16 Mar 2013 21:05:24 +0000 (21:05 +0000)
committerKarel Zak <kzak@redhat.com>
Tue, 19 Mar 2013 15:09:38 +0000 (16:09 +0100)
The MANPATH has been around long enough that it can be added to whereis
default search path.

Reference: manpath(1)
Addresses: http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/whereis.1
misc-utils/whereis.c

index 9b33999c484989d22c8efde729f057785fc7619b..4ce7a0777ba67c3f054f8c73a3b5029be5007e9c 100644 (file)
@@ -30,7 +30,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\" @(#)whereis.1 from UCB 4.2
-.TH WHEREIS 1 "January 2013" "util-linux" "User Commands"
+.TH WHEREIS 1 "March 2013" "util-linux" "User Commands"
 .SH NAME
 whereis \- locate the binary, source, and manual page files for a command
 .SH SYNOPSIS
@@ -113,21 +113,24 @@ or have no source in
 .B $ cd /usr/bin
 .br
 .B $ whereis \-u \-ms \-M /usr/man/man1 \-S /usr/src \-f *
-
-.SH FILES
+.SH "FILE SEARCH PATHS"
+By default
 .B whereis
-contains a basic set of hard-coded paths (see below), but if the
-.B \-B
-option is not specified, it also follows the
+tries to find files from hard-coded paths, which are defined with glob
+patterns. The command attempst to use contents of
 .B $PATH
-environment variable (since version 2.21).
-.IP
-.br
-/{bin,sbin,etc}
-.br
-/usr/{lib,\:bin,\:old,\:new,\:local,\:games,\:include,\:etc,\:src,\:man,\:sbin,\:X386,\:TeX,\:g++-include}
-.br
-/usr/local/{X386,\:TeX,\:X11,\:include,\:lib,\:man,\:etc,\:bin,\:games,\:emacs}
+and
+.B $MANPATH
+environment variables as default search path.  The easiest way to know
+what paths are in use is to add
+.B \-l
+listing option.  Effects of the
+.BR \-B ,
+.BR \-M ,
+and
+.BR \-S
+are display with
+.BR \-l .
 .SH "SEE ALSO"
 .BR chdir (2)
 .SH BUGS
index 1819f7c64cbff4f232ed257f241c076b4cfeb572..77d5ed4611891a2f362db0192c18711b55f8653b 100644 (file)
@@ -475,6 +475,8 @@ int main(int argc, char **argv)
        construct_dirlist_from_env("PATH", &ls, BIN_DIR);
 
        construct_dirlist(&ls, MAN_DIR, mandirs);
+       construct_dirlist_from_env("MANPATH", &ls, MAN_DIR);
+
        construct_dirlist(&ls, SRC_DIR, srcdirs);
 
        for (i = 1; i < argc; i++) {