[bash-completion] Apply upstream patch providing a config and profile hook to make it easier to disable bash-completio

Ville Skyttä scop at fedoraproject.org
Sun Sep 4 21:19:23 UTC 2011


commit 1e98654271ecc32e0b0011b62faf59049d2bf605
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Sep 5 00:15:27 2011 +0300

    Apply upstream patch providing a config and profile hook to make it easier to disable bash-completion on per user basis.

 bash-completion-1.3-profile-hook.patch |   30 ++++++++++++++++++++++++++++++
 bash-completion.spec                   |    9 ++++++++-
 2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/bash-completion-1.3-profile-hook.patch b/bash-completion-1.3-profile-hook.patch
new file mode 100644
index 0000000..28a77fd
--- /dev/null
+++ b/bash-completion-1.3-profile-hook.patch
@@ -0,0 +1,30 @@
+diff -up bash-completion-1.3/bash_completion.sh.in~ bash-completion-1.3/bash_completion.sh.in
+--- bash-completion-1.3/bash_completion.sh.in~	2011-01-21 11:36:11.000000000 +0200
++++ bash-completion-1.3/bash_completion.sh.in	2011-09-05 00:08:06.654679539 +0300
+@@ -4,6 +4,8 @@
+ # Check for recent enough version of bash.
+ bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.}
+ if [ $bmajor -gt 3 ] || [ $bmajor -eq 3 -a $bminor -ge 2 ]; then
++    [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion" ] && \
++        . "${XDG_CONFIG_HOME:-$HOME/.config}/bash_completion"
+     if shopt -q progcomp && [ -r @sysconfdir@/bash_completion ]; then
+         # Source completion code.
+         . @sysconfdir@/bash_completion
+diff -up bash-completion-1.3/README~ bash-completion-1.3/README
+--- bash-completion-1.3/README~	2011-01-21 11:36:11.000000000 +0200
++++ bash-completion-1.3/README	2011-09-05 00:07:50.822210890 +0300
+@@ -30,6 +30,14 @@ mechanism, i.e. does not automatically s
+ can source the $sysconfdir/profile.d/bash_completion.sh script in
+ /etc/bashrc or ~/.bashrc.
+ 
++The profile.d script provides a configuration file hook that can be
++used to prevent loading bash_completion on per user basis when it's
++installed system wide.  To do this, turn off programmable completion
++with "shopt -u progcomp" in $XDG_CONFIG_HOME/bash_completion
++(~/.config/bash_completion if $XDG_CONFIG_HOME is not set), and turn
++it back on for example in ~/.bashrc if you want to use programmable
++completion for other purposes.
++
+ If you're using MacOS X, /etc/bashrc is apparently not sourced at all.
+ In that case, you should put the bash_completion file in /sw/etc and add
+ the following code to ~/.bash_profile:
diff --git a/bash-completion.spec b/bash-completion.spec
index 909180b..9584003 100644
--- a/bash-completion.spec
+++ b/bash-completion.spec
@@ -3,7 +3,7 @@
 
 Name:           bash-completion
 Version:        1.3
-Release:        5%{?dist}
+Release:        6%{?dist}
 Epoch:          1
 Summary:        Programmable completion for Bash
 
@@ -33,6 +33,8 @@ Patch6:         %{name}-1.3-xspec-726220.patch
 Patch7:         %{name}-1.3-selfparse-479936.patch
 # http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=e7b3abf
 Patch8:         %{name}-1.3-sum-717341.patch
+# http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=525d6e7
+Patch9:         bash-completion-1.3-profile-hook.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
@@ -69,6 +71,7 @@ of the programmable completion feature of bash.
 %patch7 -p1
 %endif
 %patch8 -p1
+%patch9 -p1
 install -pm 644 %{SOURCE2} .
 
 
@@ -409,6 +412,10 @@ fi
 
 
 %changelog
+* Mon Sep  5 2011 Ville Skyttä <ville.skytta at iki.fi> - 1:1.3-6
+- Apply upstream patch providing a config and profile hook to make it
+  easier to disable bash-completion on per user basis.
+
 * Mon Aug 15 2011 Ville Skyttä <ville.skytta at iki.fi> - 1:1.3-5
 - Fix ant completion when complete-ant-cmd.pl is N/A (#729771).
 - Fix bash < 4 _filedir_xspec uppercase expansion issue (#726220).


More information about the scm-commits mailing list