[Pkg-zsh-devel] Bug#934926: update
Frank Terbeck
ft at zsh.org
Sun Jan 9 14:28:44 GMT 2022
Daniel Shahaf wrote:
[…]
> - Packages that are part of Debian should install to
> /usr/share/zsh/vendor-*.
>
> - Upstream packages have three options:
>
> + Install to /usr/local/share/zsh/site-functions (regardless of their
> own $PREFIX _and_ of zsh's $PREFIX)
This is precisely the right fpath entry for site local function files.
The Debian package set this to a /usr/local directory even when configu-
red with --prefix=/usr since before the current team took over.
This is the right thing to do in any case, since non-package files
should just be dropped into /usr/share/.
We *added* the ‘vendor-*’ directories to get fpath entries that are
under the control of the package system for packages to drop additional
functions into. It's been this way since about 2011.
A couple of years later (2014-ish) zsh upstream changed its compile time
configuration semantics with respect to site-function directories: It
now ensures that /usr/local/share/zsh/site-functions is *always* there
and on top of the fpath variable.
This acknowledges that /usr/local/ is the right place for site local
additions, which I don't think anybody disputes.
The change in handling site-function directories is that compile time
configuration also adds a PREFIX/share/zsh/site-functions directory,
with lower priority than the one in /usr/local.
The reason this doesn't get added on Debian right now is that we're
still setting ‘--enable-site-fndir=/usr/local/share/zsh/site-functions’
explicitly. Dropping this setting would change this.
Since Debian's ‘vendor-*’ directory handling predates this by years,
changing this, effectively adding a second path for the same purpose
seems inelegant, since it adds redundancy where none is needed.
This however, sucks:
% apt-file search usr/share/zsh/site-functions/ | wc -l
30
Because that is thirty functions that will not work.
When we added the ‘vendor-*’ stuff, we filed bug reports for packages
that tried this, because even back then, it wouldn't have worked,
because site-functions always was in /usr/local with Debian's zsh.
That resulted in this:
% apt-file search vendor-completions | wc -l
166
I am not sure if there's an elegant way to resolve this, because the
‘vendor-*’ directories are the documented way for zsh packages to add
functions for more than a decade. I don't think dropping them is a good
idea, because it would break backward compatibility. And as I said, just
adding the second --prefix based site-functions entry would litter the
system by added multiple destinations for the same purpose.
Maybe there's a way to add a lintian check for the installation path of
zsh function files in Debian packages. With that, we could add the pre-
fix based site-functions directory, but deprecate its use. That way,
packages that disrespect the zsh package's policy still work, while
keeping the possibility of a clean system, in case all package adhere to
the policy. We could file a bunch of bugs for the packages that are cur-
rently using /usr/share/zsh/site-functions right now.
Regards, Frank
More information about the Pkg-zsh-devel
mailing list