zsh-workers
 help / color / mirror / code / Atom feed
* [wgiokas@WST420: Re: Correct installation path for completion files]
@ 2013-07-26 18:07 William Giokas
  2013-07-26 18:23 ` Frank Terbeck
  0 siblings, 1 reply; 5+ messages in thread
From: William Giokas @ 2013-07-26 18:07 UTC (permalink / raw)
  To: zsh-workers; +Cc: ft

[-- Attachment #1: Type: text/plain, Size: 3645 bytes --]

On Fri, Jul 26, 2013 at 07:47:15PM +0200, Frank Terbeck wrote:
> William Giokas wrote:
> > I am working on having systemd install its own completion file in the
> > `make install`, but was told that the directory that I was having it go
> > to by default was non-standard.
> 
> Hm, getting the completion into our repo and sync every now and then is
> not an option?

I don't think so. I feel like the completion file should be with the
package so that when the package is updated, so is the completion file.
Keeping them in a central place has uses, but I see very little benefit
of it for a large, quickly changing project like systemd.

> > Which directory should upstream provided completion files go? I
> 
> Depends. :-)
> 
> > currently have all of mine in /usr/share/zsh/site-functions/, but I was
> 
> By default, the `site-functions' directory is located in /usr/local, for
> admins to locally override functions. This is a compile-time option
> though, and your vendor seems to change it.

This is just some confusion. I meant $datadir, which would be
'$prefix/share'. Don't mind that.

> > told that they should be in /usr/share/zsh/vendor-functions/. However,
> 
> This is a directory that debian uses (well, at least - so probably
> ubuntu as well). This is done by specifying the following compile-time
> option:
> 
>   --enable-additional-fpath=/usr/share/zsh/vendor-functions,/usr/share/zsh/vendor-completions
> 
> The idea is to have a directory early in $fpath in /usr/share for other
> debian packages to override zsh-default functions or provide additional
> ones. Debian packages are not allowed to install files to /use/local.
> Also, by not changing the `site-functions' location we still allow
> admins to locally override any function they want by dropping files into
> /usr/local/share/zsh/site-functions outside of the realm of the
> packaging system.

I am not talking about putting them in places for Debian, but for a
generic Linux OS. If vendor-functions has to be specially added to zsh,
then I am wary to set a default installation path to
$datadir/zsh/vendor-completion. Using /usr/local is a good idea, but not
every distro (In fact, only Debian and Ubuntu do) uses that in their
default fpath. CentOS/RHEL's fpath is simple enough, if quite old:

/usr/share/zsh/site-functions:/usr/share/zsh/4.3.10/functions

> > going through a few distros (CentOS, Debian, Arch, and Fedora) nothing
> > seems to install to that directory, and all completion files not
> > supplied by the zsh package are in `site-functions`. There was a post on
> 
> I don't think moving site-functions out of /usr/local is a good idea; it
> robs people of the possibility to override functions locally.
> 
> > the Debian MLs[1] that said to put them in vendor-functions, but I am
> > wary if even in the debian packages they don't do that yet. (Unless this
> > is in their experimental branch or something)
> 
> A debian package for systemd should place the completion function you
> are talking about to "/usr/share/vendor-functions". It is exactly the
> intended place for such add-ons on debian.

I should have made this clearer: I am looking for a generic place to use
in a distro-agnostic Makefile, not a specfile, PKGBUILD or ebuild. Would
it be sane to have the default be $datadir/zsh/site-functions, and allow
Debian and the select few other distros use a ./configure flag to place
this somewhere else?

Thanks,

-- 
William Giokas | KaiSforza | http://kaictl.net/
GnuPG Key: 0x73CD09CF
Fingerprint: F73F 50EF BBE2 9846 8306  E6B8 6902 06D8 73CD 09CF

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [wgiokas@WST420: Re: Correct installation path for completion files]
  2013-07-26 18:07 [wgiokas@WST420: Re: Correct installation path for completion files] William Giokas
@ 2013-07-26 18:23 ` Frank Terbeck
  2013-07-26 18:41   ` William Giokas
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Terbeck @ 2013-07-26 18:23 UTC (permalink / raw)
  To: William Giokas; +Cc: zsh-workers

William Giokas wrote:
[...]
> I should have made this clearer: I am looking for a generic place to use
> in a distro-agnostic Makefile, not a specfile, PKGBUILD or ebuild. Would
> it be sane to have the default be $datadir/zsh/site-functions, and allow
> Debian and the select few other distros use a ./configure flag to place
> this somewhere else?

It's hard to make it distribution-agnostic. The best way I can think of
is to use the output of this as the destination directory:

  zsh -fc 'print ${fpath[1]}'

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [wgiokas@WST420: Re: Correct installation path for completion files]
  2013-07-26 18:23 ` Frank Terbeck
@ 2013-07-26 18:41   ` William Giokas
  2013-07-27  0:10     ` Frank Terbeck
  2013-07-27  0:10     ` Bart Schaefer
  0 siblings, 2 replies; 5+ messages in thread
From: William Giokas @ 2013-07-26 18:41 UTC (permalink / raw)
  To: Frank Terbeck; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1030 bytes --]

On Fri, Jul 26, 2013 at 08:23:06PM +0200, Frank Terbeck wrote:
> William Giokas wrote:
> [...]
> > I should have made this clearer: I am looking for a generic place to use
> > in a distro-agnostic Makefile, not a specfile, PKGBUILD or ebuild. Would
> > it be sane to have the default be $datadir/zsh/site-functions, and allow
> > Debian and the select few other distros use a ./configure flag to place
> > this somewhere else?
> 
> It's hard to make it distribution-agnostic. The best way I can think of
> is to use the output of this as the destination directory:
> 
>   zsh -fc 'print ${fpath[1]}'
> 

If vendor-functions is something special that distributions use, then
they can specify that when they package this stuff. site-functions seems
to be the default for zsh, so it seems that it should be the default for
packages that install zsh completion.

Thanks,
-- 
William Giokas | KaiSforza | http://kaictl.net/
GnuPG Key: 0x73CD09CF
Fingerprint: F73F 50EF BBE2 9846 8306  E6B8 6902 06D8 73CD 09CF

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [wgiokas@WST420: Re: Correct installation path for completion files]
  2013-07-26 18:41   ` William Giokas
@ 2013-07-27  0:10     ` Frank Terbeck
  2013-07-27  0:10     ` Bart Schaefer
  1 sibling, 0 replies; 5+ messages in thread
From: Frank Terbeck @ 2013-07-27  0:10 UTC (permalink / raw)
  To: William Giokas; +Cc: zsh-workers

William Giokas wrote:
> On Fri, Jul 26, 2013 at 08:23:06PM +0200, Frank Terbeck wrote:
[...]
>> It's hard to make it distribution-agnostic. The best way I can think of
>> is to use the output of this as the destination directory:
>> 
>>   zsh -fc 'print ${fpath[1]}'
>> 
>
> If vendor-functions is something special that distributions use, then
> they can specify that when they package this stuff. site-functions seems
> to be the default for zsh, so it seems that it should be the default for
> packages that install zsh completion.

The `vendor-*' directories debian uses are indeed *only* relevant for
*debian* packages. They are inside /usr/share, where you shouldn't put
non-package stuff on debian anyway.

Since we're not talking specifically about debian-packages, we can
ignore those and look at other possibilities, of which the
`site-functions' directory seems like the best fit.

The problem is, that the location of `site-functions' is not a fixed
value. It's a compile-time option. The default is
/usr/local/share/zsh/site-functions, but some vendors use
/usr/share/zsh/site-functions/, like you mentioned yourself in
<20130726170749.GA6421@WST420>.

But unless someone screws with $fpath in the global zshenv file, the
command I mentioned should return the site-functions location the
system's specific zsh binary was compiled with.

Putting additional function files in there will work fine.

Regards, Frank


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [wgiokas@WST420: Re: Correct installation path for completion files]
  2013-07-26 18:41   ` William Giokas
  2013-07-27  0:10     ` Frank Terbeck
@ 2013-07-27  0:10     ` Bart Schaefer
  1 sibling, 0 replies; 5+ messages in thread
From: Bart Schaefer @ 2013-07-27  0:10 UTC (permalink / raw)
  To: William Giokas; +Cc: zsh-workers

On Jul 26,  1:41pm, William Giokas wrote:
} Subject: Re: [wgiokas@WST420: Re: Correct installation path for completion
}
} 
} On Fri, Jul 26, 2013 at 08:23:06PM +0200, Frank Terbeck wrote:
} > William Giokas wrote:
} > 
} > It's hard to make it distribution-agnostic. The best way I can think of
} > is to use the output of this as the destination directory:
} > 
} >   zsh -fc 'print ${fpath[1]}'
} 
} If vendor-functions is something special that distributions use, then
} they can specify that when they package this stuff. site-functions seems
} to be the default for zsh, so it seems that it should be the default for
} packages that install zsh completion.

Even if you choose site-functions you still need to know what path the
distribution has used as the prefix ... you've already pointed out that
RedHat-derived dists have /usr/share/zsh/site-functions/ whereas Debian
uses /usr/local/share/zsh/site-functions/.

Frank's suggestion of running zsh to grab the first directory in $fpath
is as good a way to avoid the guesswork as any.  If zsh won't run because
it's not installed, you're no worse off (and you can decide to skip the
function installation entirely).


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-07-27  0:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26 18:07 [wgiokas@WST420: Re: Correct installation path for completion files] William Giokas
2013-07-26 18:23 ` Frank Terbeck
2013-07-26 18:41   ` William Giokas
2013-07-27  0:10     ` Frank Terbeck
2013-07-27  0:10     ` Bart Schaefer

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