1 |
commit: 1153630cab2539454b7e6b62c2ead209c0452833 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 25 03:04:16 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jul 31 00:17:42 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1153630c |
7 |
|
8 |
sys-block/ndctl: [QA] unconditionally install completion files |
9 |
|
10 |
QA policy [0] says that we don't conditionalise installation of |
11 |
small files. It's a wasteful rebuild and inconsistent across packages |
12 |
for when users desire completions to be available. |
13 |
|
14 |
[0] https://projects.gentoo.org/qa/policy-guide/installed-files.html#pg0301 |
15 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
16 |
|
17 |
.../ndctl-71.1-bash-completion-configure.patch | 48 ++++++++++++++++++++++ |
18 |
.../{ndctl-71.1-r1.ebuild => ndctl-71.1-r2.ebuild} | 8 +++- |
19 |
2 files changed, 54 insertions(+), 2 deletions(-) |
20 |
|
21 |
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 |
22 |
new file mode 100644 |
23 |
index 00000000000..d6a796ab979 |
24 |
--- /dev/null |
25 |
+++ b/sys-block/ndctl/files/ndctl-71.1-bash-completion-configure.patch |
26 |
@@ -0,0 +1,48 @@ |
27 |
+https://github.com/pmem/ndctl/pull/174 |
28 |
+ |
29 |
+From 92485810ce872c92b925ccdf4e3b58fa37ccbb8e Mon Sep 17 00:00:00 2001 |
30 |
+From: Sam James <sam@g.o> |
31 |
+Date: Sat, 17 Jul 2021 19:31:56 +0100 |
32 |
+Subject: [PATCH] change bash-completion |
33 |
+ |
34 |
+--- |
35 |
+ configure.ac | 17 ++++++++++------- |
36 |
+ 1 file changed, 10 insertions(+), 7 deletions(-) |
37 |
+ |
38 |
+diff --git a/configure.ac b/configure.ac |
39 |
+index 5ec8d2f..f7b1aed 100644 |
40 |
+--- a/configure.ac |
41 |
++++ b/configure.ac |
42 |
+@@ -133,19 +133,22 @@ PKG_CHECK_MODULES([UUID], [uuid], |
43 |
+ [AC_DEFINE([HAVE_UUID], [1], [Define to 1 if using libuuid])]) |
44 |
+ PKG_CHECK_MODULES([JSON], [json-c]) |
45 |
+ |
46 |
+-AC_ARG_WITH([bash], |
47 |
+- AS_HELP_STRING([--with-bash], |
48 |
+- [Enable bash auto-completion. @<:@default=yes@:>@]), |
49 |
++AC_ARG_WITH([bash-completion-dir], |
50 |
++ AS_HELP_STRING([--with-bash-completion-dir[=PATH]], |
51 |
++ [Enable bash auto-completion. Uses pkgconfig if no path given. @<:@default=yes@:>@]), |
52 |
+ [], |
53 |
+- [with_bash=yes]) |
54 |
++ [with_bash_completion_dir=yes]) |
55 |
+ |
56 |
+-if test "x$with_bash" = "xyes"; then |
57 |
++if test "x$with_bash_completion_dir" = "xyes"; then |
58 |
+ PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], |
59 |
+- [BASH_COMPLETION_DIR=$($PKG_CONFIG --variable=completionsdir bash-completion)], []) |
60 |
++ [BASH_COMPLETION_DIR=$($PKG_CONFIG --variable=completionsdir bash-completion)], |
61 |
++ [BASH_COMPLETION_DIR="$datadir/bash-completion/completions"]) |
62 |
++else |
63 |
++ BASH_COMPLETION_DIR="$with_bash_completion_dir" |
64 |
+ fi |
65 |
+ |
66 |
+ AC_SUBST([BASH_COMPLETION_DIR]) |
67 |
+-AM_CONDITIONAL([ENABLE_BASH_COMPLETION], [test "x$with_bash" = "xyes"]) |
68 |
++AM_CONDITIONAL([ENABLE_BASH_COMPLETION], [test "x$with_bash_completion_dir" != "xno"]) |
69 |
+ |
70 |
+ AC_ARG_ENABLE([local], |
71 |
+ AS_HELP_STRING([--disable-local], [build against kernel ndctl.h @<:@default=system@:>@]), |
72 |
+-- |
73 |
+2.32.0 |
74 |
+ |
75 |
|
76 |
diff --git a/sys-block/ndctl/ndctl-71.1-r1.ebuild b/sys-block/ndctl/ndctl-71.1-r2.ebuild |
77 |
similarity index 87% |
78 |
rename from sys-block/ndctl/ndctl-71.1-r1.ebuild |
79 |
rename to sys-block/ndctl/ndctl-71.1-r2.ebuild |
80 |
index 4f2aa941c70..d6c230f369c 100644 |
81 |
--- a/sys-block/ndctl/ndctl-71.1-r1.ebuild |
82 |
+++ b/sys-block/ndctl/ndctl-71.1-r2.ebuild |
83 |
@@ -40,6 +40,10 @@ DOCS=( |
84 |
CONTRIBUTING.md |
85 |
) |
86 |
|
87 |
+PATCHES=( |
88 |
+ "${FILESDIR}/${PN}-71.1-bash-completion-configure.patch" |
89 |
+) |
90 |
+ |
91 |
src_prepare() { |
92 |
default |
93 |
printf 'm4_define([GIT_VERSION], [%s])' "${PV}" > version.m4 || die |
94 |
@@ -49,7 +53,7 @@ src_prepare() { |
95 |
|
96 |
src_configure() { |
97 |
econf \ |
98 |
- $(use_with bash-completion bash) \ |
99 |
+ --with-bash-completion-dir="$(get_bashcompdir)" \ |
100 |
$(use_with systemd) \ |
101 |
--disable-asciidoctor |
102 |
} |
103 |
@@ -61,5 +65,5 @@ src_test() { |
104 |
src_install() { |
105 |
default |
106 |
|
107 |
- use bash-completion && bashcomp_alias ndctl daxctl |
108 |
+ bashcomp_alias ndctl daxctl |
109 |
} |