[systemd-devel] [PATCH 01/16] shell-completion: fix zsh completion installation

William Giokas 1007380 at gmail.com
Tue Jul 30 21:22:39 PDT 2013


Moved zsh shell completion to shell-completion/zsh/_systemd for
automake's sake. Also allow users to specify where the files should go
with::

  ./configure --with-zshcompletiondir=/path/to/some/where

and by default going to `$datadir/zsh/site-functions`
---

My server is down for maintenance, so I'll be putting these on the ml
directly.

 Makefile.am                                                   | 8 +++++---
 configure.ac                                                  | 6 ++++++
 shell-completion/{systemd-zsh-completion.zsh => zsh/_systemd} | 0
 3 files changed, 11 insertions(+), 3 deletions(-)
 rename shell-completion/{systemd-zsh-completion.zsh => zsh/_systemd} (100%)

diff --git a/Makefile.am b/Makefile.am
index c81c40c..27e03ce 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,7 @@ pkgconfigdatadir=$(datadir)/pkgconfig
 pkgconfiglibdir=$(libdir)/pkgconfig
 polkitpolicydir=$(datadir)/polkit-1/actions
 bashcompletiondir=@bashcompletiondir@
+zshcompletiondir=@zshcompletiondir@
 rpmmacrosdir=$(prefix)/lib/rpm/macros.d
 sysvinitdir=$(SYSTEM_SYSVINIT_PATH)
 sysvrcnddir=$(SYSTEM_SYSVRCND_PATH)
@@ -342,6 +343,9 @@ dist_bashcompletion_DATA = \
 	shell-completion/bash/udevadm \
 	shell-completion/bash/kernel-install
 
+dist_zshcompletion_DATA = \
+	shell-completion/zsh/_systemd
+
 dist_sysctl_DATA = \
 	sysctl.d/50-default.conf
 
@@ -4234,9 +4238,6 @@ EXTRA_DIST += \
 	docs/sysvinit/README.in \
 	docs/var-log/README.in
 
-EXTRA_DIST += \
-	shell-completion/systemd-zsh-completion.zsh
-
 SOCKETS_TARGET_WANTS += \
 	systemd-initctl.socket \
 	systemd-shutdownd.socket
@@ -4351,6 +4352,7 @@ DISTCHECK_CONFIGURE_FLAGS = \
 	--with-dbussystemservicedir=$$dc_install_base/$(dbussystemservicedir) \
 	--with-dbusinterfacedir=$$dc_install_base/$(dbusinterfacedir) \
 	--with-bashcompletiondir=$$dc_install_base/$(bashcompletiondir) \
+	--with-zshcompletiondir=$$dc_install_base/$(zshcompletiondir) \
 	--with-pamlibdir=$$dc_install_base/$(pamlibdir) \
 	--with-rootprefix=$$dc_install_base \
 	--disable-split-usr
diff --git a/configure.ac b/configure.ac
index f71e15c..0ecc716 100644
--- a/configure.ac
+++ b/configure.ac
@@ -915,6 +915,10 @@ AC_ARG_WITH([bashcompletiondir],
                 with_bashcompletiondir=${datadir}/bash-completion/completions
         ])])
 
+AC_ARG_WITH([zshcompletiondir],
+        AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
+        [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
+
 AC_ARG_WITH([rootprefix],
         AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
         [], [with_rootprefix=${ac_default_prefix}])
@@ -959,6 +963,7 @@ AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir])
 AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir])
 AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir])
 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
+AC_SUBST([zshcompletiondir], [$with_zshcompletiondir])
 AC_SUBST([pamlibdir], [$with_pamlibdir])
 AC_SUBST([rootprefix], [$with_rootprefix])
 AC_SUBST([rootlibdir], [$with_rootlibdir])
@@ -1036,6 +1041,7 @@ AC_MSG_RESULT([
         D-Bus system dir:        ${with_dbussystemservicedir}
         D-Bus interfaces dir:    ${with_dbusinterfacedir}
         Bash completions dir:    ${with_bashcompletiondir}
+        Zsh completions dir:     ${with_zshcompletiondir}
         Extra start script:      ${RC_LOCAL_SCRIPT_PATH_START}
         Extra stop script:       ${RC_LOCAL_SCRIPT_PATH_STOP}
         Debug shell:             ${SUSHELL} @ ${DEBUGTTY}
diff --git a/shell-completion/systemd-zsh-completion.zsh b/shell-completion/zsh/_systemd
similarity index 100%
rename from shell-completion/systemd-zsh-completion.zsh
rename to shell-completion/zsh/_systemd
-- 
1.8.4.rc0.352.g531e8cb



More information about the systemd-devel mailing list