rust/Makefile: Fix file permissions for shell completion files

While at it, preserve the timestamps as well because it's recommended.

See https://docs.fedoraproject.org/en-US/packaging-guidelines/ShellCompletions/.

Fixes: b3055154db ("rust/Makefile: Add 'install-(bash|zsh)-completion' targets")
Reviewed-by: Steffen Eiden <seiden@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Marc Hartmayer
2025-04-14 09:04:00 +00:00
committed by Jan Höppner
parent c68c3cb8b2
commit e93668ae5b

View File

@@ -119,12 +119,12 @@ install-man:
install-bash-completion: $(PV_TARGETS)
$(INSTALL) -d -m 755 $(DESTDIR)$(BASHCOMPLETIONDIR)
$(foreach target,$(PV_TARGETS),\
$(INSTALL) $(shell find $(shell ls --sort=time --reverse --directory target/release/build/$(target)-*/out/ |tail -n1) -name '*.bash') $(DESTDIR)$(BASHCOMPLETIONDIR);)
$(INSTALL) -m 0644 --preserve-timestamps -- $(shell find $(shell ls --sort=time --reverse --directory target/release/build/$(target)-*/out/ |tail -n1) -name '*.bash') $(DESTDIR)$(BASHCOMPLETIONDIR);)
install-zsh-completion: $(PV_TARGETS)
$(INSTALL) -d -m 755 $(DESTDIR)$(ZSHCOMPLETIONDIR)
$(foreach target,$(PV_TARGETS),\
$(INSTALL) $(shell find $(shell ls --sort=time --reverse --directory target/release/build/$(target)-*/out/ |tail -n1) -regex '.*/_[a-zA-Z0-9]+') $(DESTDIR)$(ZSHCOMPLETIONDIR);)
$(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