From owner-freebsd-current@FreeBSD.ORG Wed Aug 18 21:47:13 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 BDD111065672 for ; Wed, 18 Aug 2010 21:47:13 +0000 (UTC) (envelope-from gordon.tetlow@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 81C2B8FC18 for ; Wed, 18 Aug 2010 21:47:13 +0000 (UTC) Received: by iwn36 with SMTP id 36so1194761iwn.13 for ; Wed, 18 Aug 2010 14:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=5SEaXr+JNTAnBhRn9254ouk+B481+qvrGi/DIMyrYfM=; b=vOx0r1QbhaN0iKPHnf9A8qISKJeT/+3zmIb9I66f/dgunyNh9qOKrCV2Tt6VZkkEev PzRD/mR3P9zd6/8TiXh0QdaxGNXH6S5vekgPPyfPRxNhX5rRA9mXxUnueZyQ+xAZWVwq oXCOk3iTdXGFqwuicLZoqj1HGU4d91K3YQUI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=VvO3dxQnwq72vVTTIJyYliZ3rUnSO5ovLm0a3n+/YkkZq0lMYHRNeLjqCmgCjKYmnh HcsayZRYHiST3yhd7PKQiLS4PEwj7oNEyLrRUA4c9Jme3EHgGqxbE8b19lFQ+RATcK2E zCYYK6r2qmRdL5ZN0LFJxx1EaINRjo6zpFQlE= MIME-Version: 1.0 Received: by 10.231.191.74 with SMTP id dl10mr9858627ibb.157.1282168032794; Wed, 18 Aug 2010 14:47:12 -0700 (PDT) Sender: gordon.tetlow@gmail.com Received: by 10.231.172.147 with HTTP; Wed, 18 Aug 2010 14:47:12 -0700 (PDT) In-Reply-To: References: Date: Wed, 18 Aug 2010 14:47:12 -0700 X-Google-Sender-Auth: E-JYYtE5VKGoeBkKX6pS4ieNSOM Message-ID: From: Gordon Tetlow To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Wed, 18 Aug 2010 21:47:13 -0000 On Wed, Aug 18, 2010 at 12:11 AM, Gordon Tetlow wrote: > All, > > I sat down and rewrote the man tools from a relatively old codebase to a > single shell script. My original motivation was to allow multiple > configuration files so port installations did not have to mess with > /etc/manpath.config (like perl for example) when needing to manipulate the > manpath. After looking at the existing code, I figured I could rewrite it as > a shell script relatively easily. > > Script (install as /usr/bin/man, /usr/bin/manpath, /usr/bin/apropos, > /usr/bin/whatis) > http://people.freebsd.org/~gordon/man.sh > > Features of the new code: > > 1. BSD licensed (old code is GPL). > 2. Imports configuration from /usr/local/etc/man.d/*.conf and /etc/man.conf > (purposefully changed the manpath.config file since it is a different > syntax). > 3. Allows ports to override the toolset used to display the manpage based > on language. This was done to try to merge the functionality of the > japanese/man port into the base system as much as possible. > > I've tried to make this mirror the functionality, directory search order, > and arguments as the current base implementation. > > This brings me to my next point. I need some testers willing to try this > out. It would be particularly great if I could get some foreign language > testers with localized manpage installations. If something doesn't work the > way you expect, please contact me and I can help debug it (using man -ddd > will generally give me the debug information I need). > > Thanks, > Gordon > I did some additional testing with the japanese/man-doc port and found the following was necessary: 1. Install my script as /usr/bin/man 2. Install japanese/man-doc 3. Create a /usr/local/etc/man.d/ja-man-doc.conf with the following contents: EQN_JA /usr/local/bin/geqn COL_JA /bin/cat NROFF_JA /usr/local/bin/groff -S -Wall -mtty-char -man -Tnippon -dlang=ja_JP.eucJP PIC_JA /usr/local/bin/gpic TBL_JA /usr/local/bin/gtbl TROFF_JA /usr/local/bin/groff -man -dlang=ja_JP.eucJP MANLOCALE ja_JP.eucJP 4. Create a symlink from /usr/share/man/ja.eucJP -> /usr/local/man/ja 5. Set LC_CTYPE=ja_JP.eucJP 6. man ls When all is said and done, 3 should be handled by the man-doc port while 4 is a problem. The current base system man uses the following search order for localized manpages (which I have emulated): Look in /usr/share/man/. /usr/share/man/ ... /usr/local/man/. /usr/local/man/ ... Without step 4 from above, if you were to attempt to get a localized manpage for ls(1) that resides in /usr/local/man/., you would never see it because the english language manpage in /usr/share/man would be found first. The japanese man port gets around this by installing their own man implementation (jman) forcing /usr/local/man/ja before /usr/share/man in the search order. I'm interested in feedback about whether the search order should change or if I should leave it as is.