anitazha / rpms / ndctl

Forked from rpms/ndctl 2 years ago
Clone

Blame 0047-ndctl-install-bash-completion-symlinks.patch

Jeff Moyer 2c91dc
From ac46d00d7d4d555a238bb898e2ff4af0c444bebe Mon Sep 17 00:00:00 2001
Jeff Moyer 2c91dc
From: Vishal Verma <vishal.l.verma@intel.com>
Jeff Moyer 2c91dc
Date: Tue, 16 Nov 2021 17:51:31 -0700
Jeff Moyer 2c91dc
Subject: [PATCH 047/217] ndctl: install bash-completion symlinks
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
Install symlinks for other utilities (daxctl, cxl-cli) in the
Jeff Moyer 2c91dc
completions directory so that the dynamic completion loader can pick up
Jeff Moyer 2c91dc
their respective names. Without this, completions for daxctl and cxl
Jeff Moyer 2c91dc
would only work after a prior invocation of ndctl's completion.
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
Reported-by: Dan Williams <dan.j.williams@intel.com>
Jeff Moyer 2c91dc
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Jeff Moyer 2c91dc
---
Jeff Moyer 2c91dc
 Makefile.am   | 3 +++
Jeff Moyer 2c91dc
 configure.ac  | 1 +
Jeff Moyer 2c91dc
 ndctl.spec.in | 4 +++-
Jeff Moyer 2c91dc
 3 files changed, 7 insertions(+), 1 deletion(-)
Jeff Moyer 2c91dc
Jeff Moyer 2c91dc
diff --git a/Makefile.am b/Makefile.am
Jeff Moyer 2c91dc
index fa2010a..bd0037e 100644
Jeff Moyer 2c91dc
--- a/Makefile.am
Jeff Moyer 2c91dc
+++ b/Makefile.am
Jeff Moyer 2c91dc
@@ -49,6 +49,9 @@ sles/ndctl.spec: sles/header ndctl.spec.in Makefile.am version.m4
Jeff Moyer 2c91dc
 if ENABLE_BASH_COMPLETION
Jeff Moyer 2c91dc
 bashcompletiondir = $(BASH_COMPLETION_DIR)
Jeff Moyer 2c91dc
 dist_bashcompletion_DATA = contrib/ndctl
Jeff Moyer 2c91dc
+install-data-hook:
Jeff Moyer 2c91dc
+	$(LN_S) -f $(BASH_COMPLETION_DIR)/ndctl $(DESTDIR)/$(BASH_COMPLETION_DIR)/daxctl
Jeff Moyer 2c91dc
+	$(LN_S) -f $(BASH_COMPLETION_DIR)/ndctl $(DESTDIR)/$(BASH_COMPLETION_DIR)/cxl
Jeff Moyer 2c91dc
 endif
Jeff Moyer 2c91dc
 
Jeff Moyer 2c91dc
 modprobe_file = contrib/nvdimm-security.conf
Jeff Moyer 2c91dc
diff --git a/configure.ac b/configure.ac
Jeff Moyer 2c91dc
index 00497ae..9ac785f 100644
Jeff Moyer 2c91dc
--- a/configure.ac
Jeff Moyer 2c91dc
+++ b/configure.ac
Jeff Moyer 2c91dc
@@ -31,6 +31,7 @@ AC_PREFIX_DEFAULT([/usr])
Jeff Moyer 2c91dc
 
Jeff Moyer 2c91dc
 AC_PROG_SED
Jeff Moyer 2c91dc
 AC_PROG_MKDIR_P
Jeff Moyer 2c91dc
+AC_PROG_LN_S
Jeff Moyer 2c91dc
 
Jeff Moyer 2c91dc
 AC_ARG_ENABLE([docs],
Jeff Moyer 2c91dc
         AS_HELP_STRING([--disable-docs],
Jeff Moyer 2c91dc
diff --git a/ndctl.spec.in b/ndctl.spec.in
Jeff Moyer 2c91dc
index 4b08c05..27ca097 100644
Jeff Moyer 2c91dc
--- a/ndctl.spec.in
Jeff Moyer 2c91dc
+++ b/ndctl.spec.in
Jeff Moyer 2c91dc
@@ -140,7 +140,7 @@ make check
Jeff Moyer 2c91dc
 %license LICENSES/preferred/GPL-2.0 LICENSES/other/MIT LICENSES/other/CC0-1.0
Jeff Moyer 2c91dc
 %{_bindir}/ndctl
Jeff Moyer 2c91dc
 %{_mandir}/man1/ndctl*
Jeff Moyer 2c91dc
-%{bashcompdir}/
Jeff Moyer 2c91dc
+%{bashcompdir}/ndctl
Jeff Moyer 2c91dc
 %{_unitdir}/ndctl-monitor.service
Jeff Moyer 2c91dc
 %{_sysconfdir}/ndctl/keys/keys.readme
Jeff Moyer 2c91dc
 %{_sysconfdir}/modprobe.d/nvdimm-security.conf
Jeff Moyer 2c91dc
@@ -153,12 +153,14 @@ make check
Jeff Moyer 2c91dc
 %{_bindir}/daxctl
Jeff Moyer 2c91dc
 %{_mandir}/man1/daxctl*
Jeff Moyer 2c91dc
 %{_datadir}/daxctl/daxctl.conf
Jeff Moyer 2c91dc
+%{bashcompdir}/daxctl
Jeff Moyer 2c91dc
 
Jeff Moyer 2c91dc
 %files -n cxl-cli
Jeff Moyer 2c91dc
 %defattr(-,root,root)
Jeff Moyer 2c91dc
 %license LICENSES/preferred/GPL-2.0 LICENSES/other/MIT LICENSES/other/CC0-1.0
Jeff Moyer 2c91dc
 %{_bindir}/cxl
Jeff Moyer 2c91dc
 %{_mandir}/man1/cxl*
Jeff Moyer 2c91dc
+%{bashcompdir}/cxl
Jeff Moyer 2c91dc
 
Jeff Moyer 2c91dc
 %files -n LNAME
Jeff Moyer 2c91dc
 %defattr(-,root,root)
Jeff Moyer 2c91dc
-- 
Jeff Moyer 2c91dc
2.27.0
Jeff Moyer 2c91dc