From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13111 invoked by alias); 20 Sep 2014 20:00:19 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33214 Received: (qmail 18983 invoked from network); 20 Sep 2014 20:00:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, URIBL_BLACK autolearn=no version=3.3.2 X-Originating-IP: [80.3.229.105] X-Spam: 0 X-Authority: v=2.1 cv=RcseCjdv c=1 sm=1 tr=0 a=uz1KDxDNIq33yePw376BBA==:117 a=uz1KDxDNIq33yePw376BBA==:17 a=NLZqzBF-AAAA:8 a=AW-DWZTfyeoA:10 a=uObrxnre4hsA:10 a=kj9zAlcOel0A:10 a=RL50R7omMhr1y0FYAWMA:9 a=CjuIK1q_8ugA:10 a=_dQi-Dcv4p4A:10 Date: Sat, 20 Sep 2014 21:00:01 +0100 From: Peter Stephenson To: "Zsh Hackers' List" Subject: Re: The default $fpath Message-ID: <20140920210001.660493dc@pws-pc.ntlworld.com> In-Reply-To: <20140920203648.092f2c39@pws-pc.ntlworld.com> References: <540AF773.5080407@linux.intel.com> <20140906194513.5b19931c@pws-pc.ntlworld.com> <8761h05zvt.fsf@ft.bewatermyfriend.org> <20140907000454.74cda356@pws-pc.ntlworld.com> <140906204405.ZM18404@torch.brasslantern.com> <20140907193139.3bf3d3dc@pws-pc.ntlworld.com> <1410119582.2513.51.camel@tkkaskin-mobl3.ger.corp.intel.com.tanuk.dy.fi> <20140907214005.3190037b@pws-pc.ntlworld.com> <140907140122.ZM12385@torch.brasslantern.com> <20140908112328.24371de3@pwslap01u.europe.root.pri> <87r3zm2wh6.fsf@ft.bewatermyfriend.org> <20140920200423.1959bc8c@pws-pc.ntlworld.com> <20140920203648.092f2c39@pws-pc.ntlworld.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 20 Sep 2014 20:36:48 +0100 Peter Stephenson wrote: > But surely the only place we're ever likely to get an other copy of the > directory from is $sitefndir, whether set explicitly or based on the > prefix? Oh, I see. If it's not set explicitly, it hasn't been expanded yet, hence the test for the parts. And the parts haven't been expanded. And prefix may be set to NONE to use the default prefix but may also explicitly be set to /usr/local. Er... I couldn't be bothered to test if datadir had been moved from ${prefix}/share. An eval would be more effective but less safe. diff --git a/configure.ac b/configure.ac index b202940..1d77098 100644 --- a/configure.ac +++ b/configure.ac @@ -317,9 +317,17 @@ fi], [sitefndir=${datadir}/${tzsh_name}/site-functions]) dnl Add /usr/local/share/zsh/site-functions if not yet present dnl owing to $sitefndir, whether or not explicitly given. +dnl If not explicitly given, it hasn't been expanded yet. if test X$sitefndir = X/usr/local/share/zsh/site-functions then fixed_sitefndir='' -else fixed_sitefndir=/usr/local/share/zsh/site-functions +elif test X$prefix != X/usr/local; then + if test X$prefix = XNONE && test X$ac_default_prefix = X/usr/local + then fixed_sitefndir='' + else fixed_sitefndir=/usr/local/share/zsh/site-functions + fi +elif test X$tzsh_name != Xzsh +then fixed_sitefndir=/usr/local/share/zsh/site-functions +else fixed_sitefndir='' fi ifdef([function_subdirs],[undefine([function_subdirs])])