From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23443 invoked by alias); 6 Sep 2014 16:23:41 -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: 33114 Received: (qmail 20038 invoked from network); 6 Sep 2014 16:23:26 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 From: Frank Terbeck To: Tanu Kaskinen Cc: zsh-workers@zsh.org Subject: Re: The default $fpath In-Reply-To: <540AF773.5080407@linux.intel.com> (Tanu Kaskinen's message of "Sat, 06 Sep 2014 15:00:51 +0300") References: <540AF773.5080407@linux.intel.com> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.93 (gnu/linux) Date: Sat, 06 Sep 2014 18:06:09 +0200 Message-ID: <87egvo68em.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Df-Sender: NDMwNDQ0 Hello Tanu, Tanu Kaskinen wrote: > Let's assume that I write a program, let's call it "Foo". I want to suppo= rt Zsh > completion for Foo, so I write a shell completion script. By default, if > someone builds Foo from source, Foo should be installed under prefix > /usr/local. Distributions will install Foo under prefix /usr. > > Regardless of whether Foo is installed under /usr or /usr/local, I want t= he Zsh > completion to Just Work. I think it should not matter whether the Zsh > completion is installed under /usr/share/zsh/site-functions or > /usr/local/share/zsh/site-functions, the completion script should be pick= ed up > by Zsh either way. > > On some distributions this appears to work, but not all. At least Fedora'= s Zsh > doesn't include /usr/local/share/zsh/site-functions in the default $fpath= . This > doesn't seem to be Fedora's fault. As far as I can see, Zsh upstream does= n't > include /usr/local/share/zsh/site-functions in $fpath if the install pref= ix is > /usr. > > Would a patch be accepted that adds /usr/local/share/zsh/site-functions to > $fpath always, no matter what the install prefix is? I think this is a problem that should be tackled in vendor packages. Here's how we do it in debian land, using build-time parameters passed to the =E2=80=98configure=E2=80=99 script: We set the =E2=80=98site-functio= ns=E2=80=99 location to /usr/local by using: --enable-site-fndir=3D/usr/local/share/zsh/site-functions This solves the problem of site-specific additions out of the scope of the package system. Now there's the problem, that other packages, that may want to install zsh completions can't just write to /usr/local... To solve that we use --enable-additional-fpath=3D/usr/share/zsh/vendor-functions,/usr/share/zs= h/vendor-completions And we just tell other packages to install completions to /usr/share/zsh/vendor-completions This would solve what you're asking for, in addition to leaving a clean place for completions from other packages in a vendor's repository. Regards, Frank --=20 In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925