[virt-tools-list] [virt-manager] [RFC PATCH 9/9] setup.py: Install and link the bash completion scripts

Lin Ma lma at suse.com
Wed Nov 14 08:12:58 UTC 2018


Signed-off-by: Lin Ma <lma at suse.com>
---
 setup.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/setup.py b/setup.py
index 658e6503..1c4b4340 100755
--- a/setup.py
+++ b/setup.py
@@ -273,6 +273,15 @@ class my_install_data(distutils.command.install_data.install_data):
                 "share/glib-2.0/schemas")
             self.spawn(["glib-compile-schemas", gschema_install])
 
+        self.spawn(["rm", "-f", "/usr/share/bash-completion/completions/virt-install"])
+        self.spawn(["rm", "-f", "/usr/share/bash-completion/completions/virt-clone"])
+        self.spawn(["rm", "-f", "/usr/share/bash-completion/completions/virt-xml"])
+        self.spawn(["rm", "-f", "/usr/share/bash-completion/completions/virt-convert"])
+        self.spawn(["ln", "-s", "virtmanager", "/usr/share/bash-completion/completions/virt-install"])
+        self.spawn(["ln", "-s", "virtmanager", "/usr/share/bash-completion/completions/virt-clone"])
+        self.spawn(["ln", "-s", "virtmanager", "/usr/share/bash-completion/completions/virt-xml"])
+        self.spawn(["ln", "-s", "virtmanager", "/usr/share/bash-completion/completions/virt-convert"])
+
 
 class my_sdist(distutils.command.sdist.sdist):
     description = "Update virt-manager.spec; build sdist-tarball."
@@ -663,6 +672,7 @@ distutils.core.setup(
         ("share/virt-manager/virtinst/devices", glob.glob("virtinst/devices/*.py")),
         ("share/virt-manager/virtinst/domain", glob.glob("virtinst/domain/*.py")),
         ("share/virt-manager/virtconv", glob.glob("virtconv/*.py")),
+        ("share/bash-completion/completions", glob.glob("bash-completion/virtmanager")),
     ],
 
     cmdclass={
-- 
2.19.0




More information about the virt-tools-list mailing list