[bash-completion/el6: 3/3] Fix service completion when invoked with an explicit path.

Ville Skyttä scop at fedoraproject.org
Tue Apr 2 14:55:45 UTC 2013


commit b521bbb3a785d33ceebe755cb1004c6e70c41036
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Tue Apr 2 17:55:12 2013 +0300

    Fix service completion when invoked with an explicit path.

 bash-completion-1.3-service-with-path.patch |   18 ++++++++++++++++++
 bash-completion.spec                        |   10 ++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
---
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 9584003..3d76973 100644
--- a/bash-completion.spec
+++ b/bash-completion.spec
@@ -3,7 +3,7 @@
 
 Name:           bash-completion
 Version:        1.3
-Release:        6%{?dist}
+Release:        7%{?dist}
 Epoch:          1
 Summary:        Programmable completion for Bash
 
@@ -34,7 +34,9 @@ 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
+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
@@ -72,6 +74,7 @@ of the programmable completion feature of bash.
 %endif
 %patch8 -p1
 %patch9 -p1
+%patch10 -p1
 install -pm 644 %{SOURCE2} .
 
 
@@ -412,6 +415,9 @@ fi
 
 
 %changelog
+* Tue Apr  2 2013 Ville Skyttä <ville.skytta at iki.fi> - 1:1.3-7
+- Fix service completion when invoked with an explicit path.
+
 * 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.


More information about the scm-commits mailing list