From 616d2f52f94663832a762a058485a1af02d40ef2 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Tue, 6 May 2025 13:20:36 +0200 Subject: [PATCH] rust/Makefile: Install Bash and Zsh completions by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Bash and Zsh completion files are useful, therefore install them by default. Reviewed-by: Jan Höppner Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- rust/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index adcdd076..5c8c240a 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -14,7 +14,7 @@ ifneq (${HAVE_CARGO},0) CARGO_TARGETS := BUILD_TARGETS = $(CARGO_TARGETS) - INSTALL_TARGETS := install-rust-tools install-man + INSTALL_TARGETS := install-rust-tools install-man install-shell-completions CARGO_TEST_TARGETS = $(addsuffix .test, $(CARGO_TARGETS)) ifeq ($(HOST_ARCH),s390x) @@ -116,6 +116,8 @@ install-man: $(foreach target,$(PV_TARGETS),\ $(INSTALL) -m 644 $(target)/man/*.1 -t $(DESTDIR)$(MANDIR)/man1;) +install-shell-completions: install-bash-completion install-zsh-completion + install-bash-completion: $(PV_TARGETS) $(INSTALL) -d -m 755 $(DESTDIR)$(BASHCOMPLETIONDIR) $(foreach target,$(PV_TARGETS),\ @@ -126,7 +128,7 @@ install-zsh-completion: $(PV_TARGETS) $(foreach target,$(PV_TARGETS),\ $(INSTALL) -m 0644 --preserve-timestamps -- $(shell find $(shell ls --sort=time --reverse --directory target/release/build/$(target)-*/out/ |tail -n1) -regex '.*/_[a-zA-Z0-9]+') $(DESTDIR)$(ZSHCOMPLETIONDIR);) -.PHONY: all install clean skip-build install-rust-tools print-rust-targets install-man rust-test install-bash-completion install-zsh-completion +.PHONY: all install clean skip-build install-rust-tools print-rust-targets install-man rust-test install-bash-completion install-zsh-completion install-shell-completions .check-cargo: ifeq ($(shell command -v $(CARGO)),)