From owner-freebsd-current@freebsd.org Mon Jan 9 16:47:48 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA0F6CA7FEA; Mon, 9 Jan 2017 16:47:48 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C50E91375; Mon, 9 Jan 2017 16:47:48 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id v08JQXTA042601 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 8 Jan 2017 11:26:33 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id v08JQX0d042600; Sun, 8 Jan 2017 11:26:33 -0800 (PST) (envelope-from sgk) Date: Sun, 8 Jan 2017 11:26:33 -0800 From: Steve Kargl To: freebsd-doc@freebsd.org, freebsd-current@freebsd.org, freebsd-hackers@freebsd.org Subject: MANPATH not handled correctly Message-ID: <20170108192633.GA42537@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.2 (2016-11-26) X-Mailman-Approved-At: Mon, 09 Jan 2017 17:00:42 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 16:47:49 -0000 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