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-1.3-service-with-path.patch b/bash-completion-1.3-service-with-path.patch new file mode 100644 index 0000000..ba07166 --- /dev/null +++ b/bash-completion-1.3-service-with-path.patch @@ -0,0 +1,18 @@ +diff -up bash-completion-1.3/completions/service~ bash-completion-1.3/completions/service +--- bash-completion-1.3/completions/service~ 2011-02-06 18:50:38.000000000 +0200 ++++ bash-completion-1.3/completions/service 2013-04-02 17:23:13.705115463 +0300 +@@ -14,12 +14,12 @@ _service() + + # don't complete for things like killall, ssh and mysql if it's + # the standalone command, rather than the init script +- [[ ${COMP_WORDS[0]} != @(*init.d/!(functions|~)|service) ]] && return 0 ++ [[ ${COMP_WORDS[0]} != @(*init.d/!(functions|~)|?(*/)service) ]] && return 0 + + # don't complete past 2nd token + [ $COMP_CWORD -gt 2 ] && return 0 + +- if [[ $COMP_CWORD -eq 1 && $prev == "service" ]]; then ++ if [[ $COMP_CWORD -eq 1 && $prev == ?(*/)service ]]; then + _services + else + [ -d /etc/rc.d/init.d ] && \ diff --git a/bash-completion.spec b/bash-completion.spec index 909180b..3d76973 100644 --- a/bash-completion.spec +++ b/bash-completion.spec @@ -3,7 +3,7 @@ Name: bash-completion Version: 1.3 -Release: 5%{?dist} +Release: 7%{?dist} Epoch: 1 Summary: Programmable completion for Bash @@ -33,6 +33,10 @@ 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: %{name}-1.3-profile-hook.patch +# http://anonscm.debian.org/gitweb/?p=bash-completion/bash-completion.git;a=commitdiff;h=e21af9b +Patch10: %{name}-1.3-service-with-path.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -69,6 +73,8 @@ of the programmable completion feature of bash. %patch7 -p1 %endif %patch8 -p1 +%patch9 -p1 +%patch10 -p1 install -pm 644 %{SOURCE2} . @@ -409,6 +415,13 @@ fi %changelog +* Tue Apr 2 2013 Ville Skyttä - 1:1.3-7 +- Fix service completion when invoked with an explicit path. + +* Mon Sep 5 2011 Ville Skyttä - 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ä - 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).