From owner-freebsd-current@FreeBSD.ORG Thu Sep 9 19:55:44 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E15810656D9 for ; Thu, 9 Sep 2010 19:55:44 +0000 (UTC) (envelope-from swell.k@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9DBE38FC0A for ; Thu, 9 Sep 2010 19:55:43 +0000 (UTC) Received: by ewy4 with SMTP id 4so1419792ewy.13 for ; Thu, 09 Sep 2010 12:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=ErZBTbmR+hQ13kqa9FlymjfSz1zBZY/4X3WZlW/4Nck=; b=E4Q17ZsjJnwMfZF0MBEbtMyOGrhLrt+XAr+BBeL3Mv8rBK8LujbMGJNdIF97242E6g 1jtl5Hm/wQiLDVVFtZqArV4oeBsfqN/lAe1TEWfjTpuNAeyRAZFC8eYU3bfbff0rfmSd 9YEVcYjpZRbqGdSt59uiZqgJbdRyderdaMZPg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; b=C7iRaWN3u1dMrreIVy5RNJNG5akhj4sQPH1tfHrlQnrwPH82Wm/CDlftI0raMTlXqq c+RWCRKTEejIGjuZffFm67wu75xYPz3jo3UiIj83y57wFqPArp0WVzlulalxYU0b9D93 iKGmMiHfPI9yTpwzB3zXtufs4E/zSBgZa1wJg= Received: by 10.213.47.70 with SMTP id m6mr309021ebf.63.1284062142434; Thu, 09 Sep 2010 12:55:42 -0700 (PDT) Received: from localhost (tor-exit-proxy1-readme.formlessnetworking.net [208.53.142.37]) by mx.google.com with ESMTPS id u9sm2561043eeh.5.2010.09.09.12.55.39 (version=SSLv3 cipher=RC4-MD5); Thu, 09 Sep 2010 12:55:40 -0700 (PDT) From: Anonymous To: Gordon Tetlow References: <86sk2b79oi.fsf@gmail.com> Date: Thu, 09 Sep 2010 23:48:37 +0400 In-Reply-To: (Gordon Tetlow's message of "Thu, 19 Aug 2010 00:45:46 -0700") Message-ID: <868w3aem0a.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Cc: freebsd-current@freebsd.org Subject: Re: CFR: Replace man/manpath/whatis/apropos with a shell script X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 09 Sep 2010 19:55:44 -0000 Gordon Tetlow writes: > Gordon Tetlow writes: >> Anonymous 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