zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
Cc: zsh-workers@zsh.org
Subject: Re: The default $fpath
Date: Sat, 06 Sep 2014 18:06:09 +0200	[thread overview]
Message-ID: <87egvo68em.fsf@ft.bewatermyfriend.org> (raw)
In-Reply-To: <540AF773.5080407@linux.intel.com> (Tanu Kaskinen's message of "Sat, 06 Sep 2014 15:00:51 +0300")

Hello Tanu,

Tanu Kaskinen wrote:
> Let's assume that I write a program, let's call it "Foo". I want to support 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 the 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 picked 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 doesn't
> include /usr/local/share/zsh/site-functions in $fpath if the install prefix 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 ‘configure’ script: We set the ‘site-functions’ location to
/usr/local by using:

  --enable-site-fndir=/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=/usr/share/zsh/vendor-functions,/usr/share/zsh/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

-- 
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


  reply	other threads:[~2014-09-06 16:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-06 12:00 Tanu Kaskinen
2014-09-06 16:06 ` Frank Terbeck [this message]
2014-09-06 18:45 ` Peter Stephenson
2014-09-06 19:10   ` Frank Terbeck
2014-09-06 23:04     ` Peter Stephenson
2014-09-07  3:44       ` Bart Schaefer
2014-09-07 18:31         ` Peter Stephenson
2014-09-07 19:37           ` Vin Shelton
2014-09-07 19:53             ` Tanu Kaskinen
2014-09-07 20:40               ` Peter Stephenson
2014-09-07 21:01                 ` Bart Schaefer
2014-09-08 10:23                   ` Peter Stephenson
2014-09-08 11:16                     ` Frank Terbeck
2014-09-20 19:04                       ` Peter Stephenson
2014-09-20 19:36                         ` Peter Stephenson
2014-09-20 20:00                           ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87egvo68em.fsf@ft.bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=tanu.kaskinen@linux.intel.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).