From owner-freebsd-current@FreeBSD.ORG  Sat Sep 11 14:33:50 2010
Return-Path: <owner-freebsd-current@FreeBSD.ORG>
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 39254106564A
	for <freebsd-current@freebsd.org>; Sat, 11 Sep 2010 14:33:50 +0000 (UTC)
	(envelope-from swell.k@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 EE7A08FC1C
	for <freebsd-current@freebsd.org>; Sat, 11 Sep 2010 14:33:49 +0000 (UTC)
Received: by iwn34 with SMTP id 34so3771032iwn.13
	for <freebsd-current@freebsd.org>; Sat, 11 Sep 2010 07:33:49 -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=1fMvht/Rs8+chzvENR2V8ymWFsdzMpCZJqbKs19xzdc=;
	b=GQWCk0vdk1DqEHhY7njEpwK7E/WkwiI5FfFZpj99+maMAgEwnlCHrfOO4nFUW0nHgv
	PtYiuwVeyOyKNMdteQMkMNlay6ZcTatemA56YPFO47042teKqK5qIu55GwhqSxExusVR
	YdeAnTGAd2ojKrsO2OFYy4RieqHwlTwUDRH20=
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=YWFcqMVZtA3BIJy3BFYwSsEqL9uIJE6C9W+jWpAeK1g9WK6/QBrFPGL/cYghzHQHxU
	7hAkkkMFLa4ixwZFuiLqnHYkQlpnI9PmjDSwcNuVQFmq5S8B7aX/Vbh2HjnrJEU8AwzS
	B1R9n+ZHSP1Y6+aY9+CpCBw+tWm61F+5Hp+do=
Received: by 10.231.173.9 with SMTP id n9mr2799626ibz.146.1284215629361;
	Sat, 11 Sep 2010 07:33:49 -0700 (PDT)
Received: from localhost (tor-exit-proxy3-readme.formlessnetworking.net
	[208.53.142.39])
	by mx.google.com with ESMTPS id h8sm3703856ibk.21.2010.09.11.07.33.46
	(version=SSLv3 cipher=RC4-MD5); Sat, 11 Sep 2010 07:33:48 -0700 (PDT)
From: Anonymous <swell.k@gmail.com>
To: Gordon Tetlow <gordon@tetlows.org>
References: <AANLkTi=d1RqZhkJJ94DioZkBq3Pq5vrj0kxBSgdW+UUo@mail.gmail.com>
	<86d3smb83g.fsf@gmail.com>
	<AANLkTikb+1aPG=awvhdKz=6q4p238TWHSORbu5j69L0D@mail.gmail.com>
	<766041FD-DAE2-484A-AA8F-60DA99A86B9C@lassitu.de>
	<86r5h0peme.fsf@gmail.com>
Date: Sat, 11 Sep 2010 18:29:21 +0400
In-Reply-To: <86r5h0peme.fsf@gmail.com> (Anonymous's message of "Sat, 11 Sep
	2010 17:57:13 +0400")
Message-ID: <86k4msmjzy.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
	<freebsd-current.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-current>, 
	<mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current>
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
	<mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Sat, 11 Sep 2010 14:33:50 -0000

Anonymous <swell.k@gmail.com> writes:

>   PATH_MAN_SUB bin/../man
>   PATH_MAN_SUB bin/../.man # e.g. for ~/.bin + ~/.man
>   PATH_MAN_SUB /usr/bin/../share/man

Oops, that would be non-trivial substitution. It's more like

  PATH_MAN_ADD bin ../man
  PATH_MAN_ADD .bin ../.man
  PATH_MAN_ADD /usr/bin ../share/man

And the code for third example would look smth like

  # set by PATH_MAN_ADD first and second argument
  from=/usr/bin
  to=../share/man

  case "$path" in
    *$from) p="$path/$to"
            p=$(realpath $p)
            add_to_manpath "$p"
            ;;
  esac