summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-07-25 04:04:16 +0100
committerSam James <sam@gentoo.org>2021-07-31 01:17:42 +0100
commit1153630cab2539454b7e6b62c2ead209c0452833 (patch)
tree6f5c802c7dded61a59d55d66ad38742dcfee3c76 /sys-block
parentgames-fps/chocolate-doom: [QA] unconditionally install completion files (diff)
downloadgentoo-1153630cab2539454b7e6b62c2ead209c0452833.tar.gz
gentoo-1153630cab2539454b7e6b62c2ead209c0452833.tar.bz2
gentoo-1153630cab2539454b7e6b62c2ead209c0452833.zip
sys-block/ndctl: [QA] unconditionally install completion files
QA policy [0] says that we don't conditionalise installation of small files. It's a wasteful rebuild and inconsistent across packages for when users desire completions to be available. [0] https://projects.gentoo.org/qa/policy-guide/installed-files.html#pg0301 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-block')
-rw-r--r--sys-block/ndctl/files/ndctl-71.1-bash-completion-configure.patch48
-rw-r--r--sys-block/ndctl/ndctl-71.1-r2.ebuild (renamed from sys-block/ndctl/ndctl-71.1-r1.ebuild)8
2 files changed, 54 insertions, 2 deletions
diff --git a/sys-block/ndctl/files/ndctl-71.1-bash-completion-configure.patch b/sys-block/ndctl/files/ndctl-71.1-bash-completion-configure.patch
new file mode 100644
index 000000000000..d6a796ab9796
--- /dev/null
+++ b/sys-block/ndctl/files/ndctl-71.1-bash-completion-configure.patch
@@ -0,0 +1,48 @@
+https://github.com/pmem/ndctl/pull/174
+
+From 92485810ce872c92b925ccdf4e3b58fa37ccbb8e Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Sat, 17 Jul 2021 19:31:56 +0100
+Subject: [PATCH] change bash-completion
+
+---
+ configure.ac | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 5ec8d2f..f7b1aed 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -133,19 +133,22 @@ PKG_CHECK_MODULES([UUID], [uuid],
+ [AC_DEFINE([HAVE_UUID], [1], [Define to 1 if using libuuid])])
+ PKG_CHECK_MODULES([JSON], [json-c])
+
+-AC_ARG_WITH([bash],
+- AS_HELP_STRING([--with-bash],
+- [Enable bash auto-completion. @<:@default=yes@:>@]),
++AC_ARG_WITH([bash-completion-dir],
++ AS_HELP_STRING([--with-bash-completion-dir[=PATH]],
++ [Enable bash auto-completion. Uses pkgconfig if no path given. @<:@default=yes@:>@]),
+ [],
+- [with_bash=yes])
++ [with_bash_completion_dir=yes])
+
+-if test "x$with_bash" = "xyes"; then
++if test "x$with_bash_completion_dir" = "xyes"; then
+ PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0],
+- [BASH_COMPLETION_DIR=$($PKG_CONFIG --variable=completionsdir bash-completion)], [])
++ [BASH_COMPLETION_DIR=$($PKG_CONFIG --variable=completionsdir bash-completion)],
++ [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"])
++else
++ BASH_COMPLETION_DIR="$with_bash_completion_dir"
+ fi
+
+ AC_SUBST([BASH_COMPLETION_DIR])
+-AM_CONDITIONAL([ENABLE_BASH_COMPLETION], [test "x$with_bash" = "xyes"])
++AM_CONDITIONAL([ENABLE_BASH_COMPLETION], [test "x$with_bash_completion_dir" != "xno"])
+
+ AC_ARG_ENABLE([local],
+ AS_HELP_STRING([--disable-local], [build against kernel ndctl.h @<:@default=system@:>@]),
+--
+2.32.0
+
diff --git a/sys-block/ndctl/ndctl-71.1-r1.ebuild b/sys-block/ndctl/ndctl-71.1-r2.ebuild
index 4f2aa941c70a..d6c230f369cd 100644
--- a/sys-block/ndctl/ndctl-71.1-r1.ebuild
+++ b/sys-block/ndctl/ndctl-71.1-r2.ebuild
@@ -40,6 +40,10 @@ DOCS=(
CONTRIBUTING.md
)
+PATCHES=(
+ "${FILESDIR}/${PN}-71.1-bash-completion-configure.patch"
+)
+
src_prepare() {
default
printf 'm4_define([GIT_VERSION], [%s])' "${PV}" > version.m4 || die
@@ -49,7 +53,7 @@ src_prepare() {
src_configure() {
econf \
- $(use_with bash-completion bash) \
+ --with-bash-completion-dir="$(get_bashcompdir)" \
$(use_with systemd) \
--disable-asciidoctor
}
@@ -61,5 +65,5 @@ src_test() {
src_install() {
default
- use bash-completion && bashcomp_alias ndctl daxctl
+ bashcomp_alias ndctl daxctl
}