[bash-completion/el4/master] Patch to not test command availability for each snippet, improves load time.

Ville Skyttä scop at fedoraproject.org
Fri Apr 15 21:18:25 UTC 2011


commit 81689ce5eb1a3ddaaab347e887d37f106b691dc4
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Fri Apr 15 23:20:03 2011 +0300

    Patch to not test command availability for each snippet, improves load time.

 bash-completion-1.0-yeswehave.patch |   16 ++++++++++++++++
 bash-completion.spec                |    8 +++++++-
 2 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/bash-completion-1.0-yeswehave.patch b/bash-completion-1.0-yeswehave.patch
new file mode 100644
index 0000000..9b8c6df
--- /dev/null
+++ b/bash-completion-1.0-yeswehave.patch
@@ -0,0 +1,16 @@
+diff -up bash-completion-1.0/bash_completion~ bash-completion-1.0/bash_completion
+--- bash-completion-1.0/bash_completion~	2009-04-02 23:01:39.000000000 +0300
++++ bash-completion-1.0/bash_completion	2011-04-15 23:12:46.497273696 +0300
+@@ -182,7 +182,11 @@ complete -b builtin
+ have()
+ {
+ 	unset -v have
+-	PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null &&
++	# In this packaged setup we don't need to do the availability test
++	# below because only completions for commands that are actually
++	# available should be in /etc/bash_completion.d anyway; not doing the
++	# test improves our load time significantly.
++	#PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null &&
+ 		have="yes"
+ }
+ 
diff --git a/bash-completion.spec b/bash-completion.spec
index 4846dbf..f23ea46 100644
--- a/bash-completion.spec
+++ b/bash-completion.spec
@@ -1,6 +1,6 @@
 Name:           bash-completion
 Version:        1.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 Epoch:          1
 Summary:        Programmable completion for Bash
 
@@ -13,6 +13,8 @@ Source2:        %{name}-plague-client
 Source3:        %{name}-repomanage
 # http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=1421e55aac075e13491cd212b796bdd453214a2c
 Patch0:         %{name}-1.0-bash4quoting-490322.patch
+# Non-upstream: see comments in patch
+Patch1:         %{name}-1.0-yeswehave.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
@@ -28,6 +30,7 @@ of the programmable completion feature of bash 2.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 install -pm 644 %{SOURCE1} contrib/mock
 install -pm 644 %{SOURCE2} contrib/plague-client
 install -pm 644 %{SOURCE3} contrib/repomanage
@@ -268,6 +271,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Apr 15 2011 Ville Skyttä <ville.skytta at iki.fi> - 1:1.0-3
+- Patch to not test command availability for each snippet, improves load time.
+
 * Tue Apr  7 2009 Ville Skyttä <ville.skytta at iki.fi> - 1:1.0-2
 - Apply upstream patch to fix quoting issues with bash 4.x (#490322).
 


More information about the scm-commits mailing list