Skip to contentSkip to conversation

ndctl: install bash-completion symlinks

PATCH New Vishal Verma 1 participant 1 message Nov 17, 2021

Subsystems (2)
lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 ndctl: install bash-completion symlinks

Install symlinks for other utilities (daxctl, cxl-cli) in the completions directory so that the dynamic completion loader can pick up their respective names. Without this, completions for daxctl and cxl would only work after a prior invocation of ndctl's completion.

---
 configure.ac  | 1 +
 Makefile.am   | 3 +++
 ndctl.spec.in | 4 +++-
 3 files changed, 7 insertions(+), 1 deletion(-)
configure.ac +1 -0
index 00497ae..9ac785f 100644
@@ -31,6 +31,7 @@ AC_PREFIX_DEFAULT([/usr])
 
 AC_PROG_SED
 AC_PROG_MKDIR_P
+AC_PROG_LN_S
 
 AC_ARG_ENABLE([docs],
         AS_HELP_STRING([--disable-docs],
Makefile.am +3 -0
index fa2010a..bd0037e 100644
@@ -49,6 +49,9 @@ sles/ndctl.spec: sles/header ndctl.spec.in Makefile.am version.m4
 if ENABLE_BASH_COMPLETION
 bashcompletiondir = $(BASH_COMPLETION_DIR)
 dist_bashcompletion_DATA = contrib/ndctl
+install-data-hook:
+	$(LN_S) -f $(BASH_COMPLETION_DIR)/ndctl $(DESTDIR)/$(BASH_COMPLETION_DIR)/daxctl
+	$(LN_S) -f $(BASH_COMPLETION_DIR)/ndctl $(DESTDIR)/$(BASH_COMPLETION_DIR)/cxl
 endif
 
 modprobe_file = contrib/nvdimm-security.conf
ndctl.spec.in +3 -1
index 4b08c05..27ca097 100644
@@ -140,7 +140,7 @@ make check
 %license LICENSES/preferred/GPL-2.0 LICENSES/other/MIT LICENSES/other/CC0-1.0
 %{_bindir}/ndctl
 %{_mandir}/man1/ndctl*
-%{bashcompdir}/
+%{bashcompdir}/ndctl
 %{_unitdir}/ndctl-monitor.service
 %{_sysconfdir}/ndctl/keys/keys.readme
 %{_sysconfdir}/modprobe.d/nvdimm-security.conf
@@ -153,12 +153,14 @@ make check
 %{_bindir}/daxctl
 %{_mandir}/man1/daxctl*
 %{_datadir}/daxctl/daxctl.conf
+%{bashcompdir}/daxctl
 
 %files -n cxl-cli
 %defattr(-,root,root)
 %license LICENSES/preferred/GPL-2.0 LICENSES/other/MIT LICENSES/other/CC0-1.0
 %{_bindir}/cxl
 %{_mandir}/man1/cxl*
+%{bashcompdir}/cxl
 
 %files -n LNAME
 %defattr(-,root,root)

base-commit: 1baaa9035ca5402561a94b9d322b2edbcba4f249

Signature · 1 line
2.31.1