Makefile: Changed default zsh completion location to zsh default fpath.

Systems such as Debian that have overridden the default fpath will need to
set ZSH_COMPLETIONS_PATH.

I feel that Debian is causing unncessary complexity by making this change,
and have filed a bug report about it.

This also means that when git-annex is installed with PREFIX=/usr/local
it will use /usr/local/share/zsh/site-functions which works with probably
all versions of zsh.
This commit is contained in:
Joey Hess 2019-08-16 14:08:56 -04:00
parent 5fcaaf77db
commit 7f97575941
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 13 additions and 2 deletions

View file

@ -32,6 +32,9 @@ git-annex (7.20190731) UNRELEASED; urgency=medium
and writing to the sqlite database somehow caused inode cache information and writing to the sqlite database somehow caused inode cache information
to occasionally be lost. to occasionally be lost.
* Make git-annex-standalone.deb include the shell completions again. * Make git-annex-standalone.deb include the shell completions again.
* Makefile: Changed default zsh completion location to zsh default fpath.
Systems such as Debian that have overridden the default fpath will
need to set ZSH_COMPLETIONS_PATH.
-- Joey Hess <id@joeyh.name> Thu, 01 Aug 2019 00:11:56 -0400 -- Joey Hess <id@joeyh.name> Thu, 01 Aug 2019 00:11:56 -0400

View file

@ -11,6 +11,10 @@ endif
PREFIX?=/usr PREFIX?=/usr
SHAREDIR?=share SHAREDIR?=share
# On Debian systems, zsh does not look here, and you will have to override
# this to /usr/share/zsh/vendor-completions
ZSH_COMPLETIONS_PATH?=$(PREFIX)/$(SHAREDIR)/zsh/site-functions
# Am I typing :make in vim? Do a fast build. # Am I typing :make in vim? Do a fast build.
ifdef VIM ifdef VIM
all=fast all=fast
@ -77,9 +81,9 @@ install-desktop: build Build/InstallDesktopFile
install-completions: build install-completions: build
install -d $(DESTDIR)$(PREFIX)/$(SHAREDIR)/bash-completion/completions install -d $(DESTDIR)$(PREFIX)/$(SHAREDIR)/bash-completion/completions
install -m 0644 bash-completion.bash $(DESTDIR)$(PREFIX)/$(SHAREDIR)/bash-completion/completions/git-annex install -m 0644 bash-completion.bash $(DESTDIR)$(PREFIX)/$(SHAREDIR)/bash-completion/completions/git-annex
install -d $(DESTDIR)$(PREFIX)/$(SHAREDIR)/zsh/vendor-completions install -d $(DESTDIR)$(ZSH_COMPLETIONS_PATH)
./git-annex --zsh-completion-script git-annex 2>/dev/null \ ./git-annex --zsh-completion-script git-annex 2>/dev/null \
> $(DESTDIR)$(PREFIX)/$(SHAREDIR)/zsh/vendor-completions/_git-annex > $(DESTDIR)$(ZSH_COMPLETIONS_PATH)/_git-annex
install -d $(DESTDIR)$(PREFIX)/$(SHAREDIR)/fish/completions install -d $(DESTDIR)$(PREFIX)/$(SHAREDIR)/fish/completions
./git-annex --fish-completion-script git-annex 2>/dev/null \ ./git-annex --fish-completion-script git-annex 2>/dev/null \
> $(DESTDIR)$(PREFIX)/$(SHAREDIR)/fish/completions/git-annex.fish > $(DESTDIR)$(PREFIX)/$(SHAREDIR)/fish/completions/git-annex.fish

2
debian/rules vendored
View file

@ -11,6 +11,8 @@ STANDALONE_BUILD=$(shell grep -qe '^Package: git-annex-standalone' debian/contro
# Do use the changelog's version number, rather than making one up. # Do use the changelog's version number, rather than making one up.
export RELEASE_BUILD=1 export RELEASE_BUILD=1
export ZSH_COMPLETIONS_PATH=/usr/share/zsh/vendor-completions
%: %:
dh $@ dh $@

View file

@ -17,3 +17,5 @@ version 7.20190730 on an Arch Linux system.
### Recommended fix ### Recommended fix
Make the installation directory configurable. Use /etc/os-release to check if the system is a Debian-based system, and if so, continue to use vendor-completions, if not, use site-functions. Make the installation directory configurable. Use /etc/os-release to check if the system is a Debian-based system, and if so, continue to use vendor-completions, if not, use site-functions.
> [[fixed|done]] --[[Joey]]