[libvirt] [PATCH] spec: enable bash completion only on new enough distros

Pavel Hrdina posted 1 patch 6 years, 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/148e8fe9d3ca688b5c4361ae541474651f691bf9.1516181998.git.phrdina@redhat.com
libvirt.spec.in | 10 ++++++++++
1 file changed, 10 insertions(+)
[libvirt] [PATCH] spec: enable bash completion only on new enough distros
Posted by Pavel Hrdina 6 years, 3 months ago
RHEL-6 doesn't have bash-completion package by default, it has to be
installed from EPEL.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 libvirt.spec.in | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index d4ef116b2d..ef96888d09 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -87,6 +87,7 @@
 %define with_libssh2       0%{!?_without_libssh2:0}
 %define with_wireshark     0%{!?_without_wireshark:0}
 %define with_libssh        0%{!?_without_libssh:0}
+%define with_bash_completion  0%{!?_without_bash_completion:0}
 %define with_pm_utils      1
 
 # Finally set the OS / architecture specific special cases
@@ -190,6 +191,11 @@
     %define with_libssh 0%{!?_without_libssh:1}
 %endif
 
+# Enable bash-completion for new enough distros
+%if 0%{?fedora} || 0%{?rhel} >= 7
+    %define with_bash_completion  0%{!?_without_bash_completion:1}
+%endif
+
 
 %if %{with_qemu} || %{with_lxc} || %{with_uml}
 # numad is used to manage the CPU and memory placement dynamically,
@@ -306,7 +312,9 @@ BuildRequires: xen-devel
 BuildRequires: libxml2-devel
 BuildRequires: libxslt
 BuildRequires: readline-devel
+%if %{with_bash_completion}
 BuildRequires: bash-completion >= 2.0
+%endif
 BuildRequires: ncurses-devel
 BuildRequires: gettext
 BuildRequires: libtasn1-devel
@@ -2048,7 +2056,9 @@ exit 0
 %{_datadir}/systemtap/tapset/libvirt_qemu_probes*.stp
 %{_datadir}/systemtap/tapset/libvirt_functions.stp
 
+%if %{with_bash_completion}
 %{_datadir}/bash-completion/completions/vsh
+%endif
 
 
 %if %{with_systemd}
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] spec: enable bash completion only on new enough distros
Posted by Daniel P. Berrange 6 years, 3 months ago
On Wed, Jan 17, 2018 at 10:40:19AM +0100, Pavel Hrdina wrote:
> RHEL-6 doesn't have bash-completion package by default, it has to be
> installed from EPEL.
> 
> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
>  libvirt.spec.in | 10 ++++++++++
>  1 file changed, 10 insertions(+)

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list