From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-1.sys.kth.se (smtp-1.sys.kth.se [130.237.32.175]) by krisdoz.my.domain (8.14.5/8.14.5) with ESMTP id pBOMaMLj030449 for ; Sat, 24 Dec 2011 17:36:22 -0500 (EST) Received: from mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) by smtp-1.sys.kth.se (Postfix) with ESMTP id 61D39156371 for ; Sat, 24 Dec 2011 23:36:15 +0100 (CET) X-Virus-Scanned: by amavisd-new at kth.se Received: from smtp-1.sys.kth.se ([130.237.32.175]) by mailscan-1.sys.kth.se (mailscan-1.sys.kth.se [130.237.32.91]) (amavisd-new, port 10024) with LMTP id W22XlxhSSm+t for ; Sat, 24 Dec 2011 23:36:14 +0100 (CET) X-KTH-Auth: kristaps [81.198.4.39] X-KTH-mail-from: kristaps@bsd.lv X-KTH-rcpt-to: tech@mdocml.bsd.lv Received: from macky.local (unknown [81.198.4.39]) by smtp-1.sys.kth.se (Postfix) with ESMTP id 659F2154137 for ; Sat, 24 Dec 2011 23:36:13 +0100 (CET) Message-ID: <4EF653DC.3010502@bsd.lv> Date: Sun, 25 Dec 2011 00:36:12 +0200 From: Kristaps Dzonsons User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0) Gecko/20111105 Thunderbird/8.0 X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 To: tech@mdocml.bsd.lv Subject: Re: MANPATH and overriding/modifying default paths. References: <4EEDFE12.4020702@bsd.lv> <20111224221429.GF15148@iris.usta.de> In-Reply-To: <20111224221429.GF15148@iris.usta.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >> A while back, I complained to Ingo that MANPATH is heavy-handed: it >> doesn't allow us to modify the default search path (in, e.g., >> /etc/man.conf), but only override it. >> >> He mentioned that in manpath(1) used on systems, MANPATH can modify >> instead of override by placemen to colons. To wit: >> >> MANPATH >> If $MANPATH is set, manpath displays its value rather than >> determining it on the fly. If $MANPATH is prefixed by a colon, then >> the value of the variable is appended to the list determined from >> the content of the configuration files. If the colon comes at the >> end of the value in the variable, then the determined list is >> appended to the content of the variable. If the value of the >> variable contains a double colon (::), then the determined list is >> inserted in the middle of the value, between the two colons. >> >> The enclosed patch does just this for apropos(1), whatis(1), and >> catman(8) (which is also updated with -C like the others). I >> modified the explanation above to be (I hope) a little clearer as to >> precedence. > > Yes, your wording is better, very clear and concise. > >> Objections? > > First, i misread your patch. You changed the #else clause of > the cpp(1) alternative, not the #ifdef clause. Thanks for > pointing that out once again. > > Then, i hesitated for some time whether we really want this, > but came to the conclusion that we have MANPATH anyway, it does > not change MANPATH semantics that much, the proposed use case > makes sense, i could not come up with a better solution, and it > improves compatibility a tiny bit. > > So i have tweaked it and committed it to OpenBSD. > At the expense of three additional lines of code - > actually, all of them closing braces - i got rid of two > local variables, made the code flow much more obvious > and got the oportunity of inserting eight comments. > > While here, i have also put back -m (which got lost) > and copied Linux semantics of treating an empty MANPATH > the same way as an undefined MANPATH, which obviously > is more useful than returning empty results. > > Feel free to merge to bsd.lv, or tell me to do it; > conflict resolution will be trivial. Ingo, I'm checking this in right now, applying the apropos(1) updates to whatis(1) and catman(8). Thanks for looking this over! Kristaps -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv