[Bash-completion-commits] [bash-completion] 03/03: slapt-{get, src}: Fix issue with sed not being able to handle some characters

Igor Murzov garik-guest at moszumanska.debian.org
Wed Jun 4 22:11:36 UTC 2014


This is an automated email from the git hooks/post-receive script.

garik-guest pushed a commit to branch master
in repository bash-completion.

commit 70e52c8a1fc4ebc3ea5516879505ca5da504b32b
Author: Igor Murzov <e-mail at date.by>
Date:   Thu Jun 5 01:51:16 2014 +0400

    slapt-{get,src}: Fix issue with sed not being able to handle some characters
    
     # LC_ALL=C slapt-get --search "^moo" | sed -ne "/^moo/{s/ .*$//;p}"
     moos-project-viewer-2.8.1-x86_64-1sl [inst=no]: moos-project-viewer - Free Viewer for Microsoft®
    
     # LC_ALL=C slapt-get --search "^moo" | LC_ALL=C sed -ne "/^moo/{s/ .*$//;p}"
     moos-project-viewer-2.8.1-x86_64-1sl
---
 completions/slapt-get | 8 ++++----
 completions/slapt-src | 9 +++++----
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/completions/slapt-get b/completions/slapt-get
index 93d110b..b94c1f0 100644
--- a/completions/slapt-get
+++ b/completions/slapt-get
@@ -55,13 +55,13 @@ _slapt_get()
             # slapt-get will fail to search for "^name-version"
             # it can search for names only
             local name=${cur%%-*}
-            COMPREPLY=( $( slapt-get -c $config --search "^$name" 2>/dev/null |\
-                sed -ne "/^$cur/{s/ .*$//;p}" ) )
+            COMPREPLY=( $( LC_ALL=C "$1" -c "$config" --search "^$name" 2> \
+                /dev/null | LC_ALL=C sed -ne "/^$cur/{s/ .*$//;p}" ) )
             return
             ;;
         avl) # --install|-i|
-            COMPREPLY=( $( slapt-get -c $config --available 2>/dev/null | \
-                sed -ne "/^$cur/{s/ .*$//;p}" ) )
+            COMPREPLY=( $( LC_ALL=C "$1" -c "$config" --available 2> \
+                /dev/null | LC_ALL=C sed -ne "/^$cur/{s/ .*$//;p}" ) )
             return
             ;;
         ins) # --remove|--filelist
diff --git a/completions/slapt-src b/completions/slapt-src
index 9b6f501..a3a646a 100644
--- a/completions/slapt-src
+++ b/completions/slapt-src
@@ -49,11 +49,12 @@ _slapt_src()
     if [[ "$cur" == *:* ]]; then
         local name=${cur%:*}
         local version=${cur##*:}
-        COMPREPLY=( $( slapt-src --config "$config" --search "^$name" 2> \
-            /dev/null | sed -ne "/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p}" ) )
+        COMPREPLY=( $( LC_ALL=C "$1" --config "$config" --search "^$name" 2> \
+            /dev/null | LC_ALL=C sed -ne \
+            "/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p}" ) )
     else
-        COMPREPLY=( $( slapt-src --config "$config" --search "^$cur" 2> \
-            /dev/null | sed -ne "/^$cur/{s/ .*$//;p}" ) )
+        COMPREPLY=( $( LC_ALL=C "$1" --config "$config" --search "^$cur" 2> \
+            /dev/null | LC_ALL=C sed -ne "/^$cur/{s/ .*$//;p}" ) )
     fi
 } && complete -F _slapt_src slapt-src
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/bash-completion/bash-completion.git



More information about the Bash-completion-commits mailing list