From 7f97575941443430e1e60c600b4b841c4efe2896 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 16 Aug 2019 14:08:56 -0400 Subject: [PATCH] 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. --- CHANGELOG | 3 +++ Makefile | 8 ++++++-- debian/rules | 2 ++ ...sh_completions_installed_to_location_not_in_fpath.mdwn | 2 ++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 3dd9b1cb19..c19da5a9f8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -32,6 +32,9 @@ git-annex (7.20190731) UNRELEASED; urgency=medium and writing to the sqlite database somehow caused inode cache information to occasionally be lost. * 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 Thu, 01 Aug 2019 00:11:56 -0400 diff --git a/Makefile b/Makefile index e5b9fef684..516f981e87 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,10 @@ endif PREFIX?=/usr 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. ifdef VIM all=fast @@ -77,9 +81,9 @@ install-desktop: build Build/InstallDesktopFile install-completions: build install -d $(DESTDIR)$(PREFIX)/$(SHAREDIR)/bash-completion/completions 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 \ - > $(DESTDIR)$(PREFIX)/$(SHAREDIR)/zsh/vendor-completions/_git-annex + > $(DESTDIR)$(ZSH_COMPLETIONS_PATH)/_git-annex install -d $(DESTDIR)$(PREFIX)/$(SHAREDIR)/fish/completions ./git-annex --fish-completion-script git-annex 2>/dev/null \ > $(DESTDIR)$(PREFIX)/$(SHAREDIR)/fish/completions/git-annex.fish diff --git a/debian/rules b/debian/rules index 757422dab6..ad0cef7bc4 100755 --- a/debian/rules +++ b/debian/rules @@ -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. export RELEASE_BUILD=1 +export ZSH_COMPLETIONS_PATH=/usr/share/zsh/vendor-completions + %: dh $@ diff --git a/doc/bugs/zsh_completions_installed_to_location_not_in_fpath.mdwn b/doc/bugs/zsh_completions_installed_to_location_not_in_fpath.mdwn index f9347b2cda..1a80aa227e 100644 --- a/doc/bugs/zsh_completions_installed_to_location_not_in_fpath.mdwn +++ b/doc/bugs/zsh_completions_installed_to_location_not_in_fpath.mdwn @@ -17,3 +17,5 @@ version 7.20190730 on an Arch Linux system. ### 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. + +> [[fixed|done]] --[[Joey]]