]> git.proxmox.com Git - mirror_ovs.git/commitdiff
bashcomp: Install and package completion scripts.
authorAlex Wang <alexw@nicira.com>
Wed, 18 Mar 2015 21:32:23 +0000 (14:32 -0700)
committerAlex Wang <alexw@nicira.com>
Fri, 20 Mar 2015 23:42:47 +0000 (16:42 -0700)
This commit makes the bash completion scripts be installed to
$(sysconfdir)/bash_completion.d/ through 'make install' and to
/etc/bash_completion.d/ through package installation.  This will
make the scripts available for each bash session.

An alternative is to put scripts to /usr/share/bash_completion/
directory.  However, this is not supported by earlier version of
bash completion.

Signed-off-by: Alex Wang <alexw@nicira.com>
Makefile.am
debian/openvswitch-common.install
debian/openvswitch-switch.install
rhel/openvswitch.spec.in
utilities/automake.mk
utilities/ovs-command-bashcomp.INSTALL.md
xenserver/openvswitch-xen.spec.in

index e1a4e1780b3077f2ad2586ad621859d7094932a7..ab2216749f065cf531478f4807e10702c2dff868 100644 (file)
@@ -137,6 +137,7 @@ OVSIDL_BUILT =
 pkgdata_DATA =
 sbin_SCRIPTS =
 scripts_SCRIPTS =
+completion_SCRIPTS =
 scripts_DATA =
 SUFFIXES =
 check_DATA =
@@ -144,6 +145,7 @@ check_SCRIPTS =
 pkgconfig_DATA =
 
 scriptsdir = $(pkgdatadir)/scripts
+completiondir = $(sysconfdir)/bash_completion.d
 pkgconfigdir = $(libdir)/pkgconfig
 
 # This ensures that files added to EXTRA_DIST are always distributed,
index 11bb596708b5ccfaef9084b51c57df1d0d5429c0..f0841529af5ec4ed1a00a9f019feecc14c161647 100644 (file)
@@ -1,3 +1,4 @@
+etc/bash_completion.d/ovs-appctl-bashcomp.bash
 usr/bin/ovs-appctl
 usr/bin/ovs-benchmark
 usr/bin/ovs-docker
index c4f1426fe0a082d4f66ebf3a958ee542078310ae..b5d0063218b8f80a3122bb359f638cde7bd48a11 100644 (file)
@@ -1,3 +1,4 @@
+etc/bash_completion.d/ovs-vsctl-bashcomp.bash
 usr/bin/ovs-dpctl
 usr/bin/ovs-dpctl-top
 usr/bin/ovs-pcap
index 56603ccbba4732e49bd1a350afbe674d82fc1ecb..1ea685d3b6f41585efa9eaab26121e6940898fba 100644 (file)
@@ -123,6 +123,8 @@ exit 0
 
 %files
 %defattr(-,root,root)
+/etc/bash_completion.d/ovs-appctl-bashcomp.bash
+/etc/bash_completion.d/ovs-vsctl-bashcomp.bash
 /etc/init.d/openvswitch
 %config(noreplace) /etc/logrotate.d/openvswitch
 /etc/sysconfig/network-scripts/ifup-ovs
index 8b55e2d5dffd9bc5a22c2ef759376dc1efbd593e..a06630f1ff91959e35870a8d2b88f5555938d05a 100644 (file)
@@ -22,6 +22,10 @@ scripts_SCRIPTS += \
        utilities/ovs-save
 scripts_DATA += utilities/ovs-lib
 
+completion_SCRIPTS += \
+       utilities/ovs-appctl-bashcomp.bash \
+       utilities/ovs-vsctl-bashcomp.bash
+
 check_SCRIPTS += \
        utilities/ovs-appctl-bashcomp.bash \
        utilities/ovs-vsctl-bashcomp.bash
index 411f42fe621a34c5e7f660dbb430731e96bf419b..9bdef40f3997ea76e16f2ef5efa711f8a8ac6202 100644 (file)
@@ -65,9 +65,16 @@ ovs-vsctl-bashcomp
 How to use:
 -----------
 
-   To use the scripts, either copy them inside /etc/bash_completion.d/ or
-   manually run it directly in bash via . ovs-appctl-bashcomp.bash or
-   . ovs-vsctl-bashcomp.bash.
+   The bashcomp scripts should be placed at /etc/bash_completion.d/
+   to be available for all bash sessions.  Running 'make install'
+   will place the scripts to $(sysconfdir)/bash_completion.d/.  So user
+   should specify --sysconfdir=/etc at configuration.  Meanwhile, if OVS is
+   installed from packages, the scripts will automatically be placed inside
+   /etc/bash_completion.d/.
+
+   If you just want to run the scripts in one bash, you can remove them from
+   /etc/bash_completion.d/ and run the scripts via '. ovs-appctl-bashcomp.bash'
+   or '. ovs-vsctl-bashcomp.bash'.
 
 Test:
 -----
index 3bae86a51543ba75baa5d5359f17713d8b384e1e..4d98d2e01a2d0f4edd6f46a1f36ca4967baafc5e 100644 (file)
@@ -430,6 +430,8 @@ exit 0
 
 %files
 %defattr(-,root,root)
+/etc/bash_completion.d/ovs-appctl-bashcomp.bash
+/etc/bash_completion.d/ovs-vsctl-bashcomp.bash
 /etc/init.d/openvswitch
 /etc/init.d/openvswitch-xapi-update
 /etc/xapi.d/plugins/openvswitch-cfg-update