[Bash-completion-commits] [SCM] debian-package branch, master, updated. upstream/1.1-42-g77e920a

David Paleino dapal at debian.org
Sat Nov 14 16:56:33 UTC 2009


The following commit has been merged in the master branch:
commit 77e920a7a350dc80e0ea66620d87ba543643ff4b
Author: David Paleino <dapal at debian.org>
Date:   Sat Nov 14 17:53:19 2009 +0100

    03-fix_552631.patch added (Closes: #552631)

diff --git a/debian/changelog b/debian/changelog
index 6b93161..528fd6c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,11 +5,12 @@ bash-completion (1:1.1-2) UNRELEASED; urgency=low
     - 01-fix_550943.patch added, fixes function names (Closes: #550943)
     - 02-fix_552109.patch added, fixes -W and --show completion for
       dpkg-deb (Closes: #552109)
+    - 03-fix_552631.patch added (Closes: #552631)
   * debian/control:
     - updated my email address
     - DMUA removed
 
- -- David Paleino <dapal at debian.org>  Sun, 08 Nov 2009 23:52:43 +0100
+ -- David Paleino <dapal at debian.org>  Sat, 14 Nov 2009 17:52:41 +0100
 
 bash-completion (1:1.1-1) unstable; urgency=low
 
diff --git a/debian/patches/03-fix_552631.patch b/debian/patches/03-fix_552631.patch
new file mode 100644
index 0000000..98d57f6
--- /dev/null
+++ b/debian/patches/03-fix_552631.patch
@@ -0,0 +1,205 @@
+From: David Paleino <d.paleino at gmail.com>
+Description: backports for #552631
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=552631
+
+commit ac644578e07720281452d5ed8c22181365a27d87
+Author: Ville Skyttä <ville.skytta at iki.fi>
+Date:   Sun Nov 1 21:01:18 2009 +0200
+
+    More compgen -W instead of embedding user input in sed/awk/grep fixes.
+
+commit 1d74adc296c7f5d744c29481536cbd8948768ae5                                        
+Author: Ville Skyttä <ville.skytta at iki.fi>                                             
+Date:   Thu Oct 29 19:15:53 2009 +0200
+
+    Fix sed error in qdbus completions containing slashes (Debian: 552631).
+
+---
+ bash_completion   |   54 ++++++++++++++++++++++++++++--------------------------
+ contrib/configure |   14 ++++++++------
+ contrib/getent    |    8 ++++----
+ contrib/qdbus     |   10 +++-------
+ 4 files changed, 43 insertions(+), 43 deletions(-)
+
+--- bash-completion-debian.orig/bash_completion
++++ bash-completion-debian/bash_completion
+@@ -470,23 +470,23 @@ _configured_interfaces()
+ {
+     if [ -f /etc/debian_version ]; then
+         # Debian system
+-        COMPREPLY=( $( sed -ne 's|^iface \([^ ]\+\).*$|\1|p' \
+-        /etc/network/interfaces ) )
++        COMPREPLY=( $( compgen -W "$( sed -ne 's|^iface \([^ ]\+\).*$|\1|p' \
++            /etc/network/interfaces )" -- "$cur" ) )
+     elif [ -f /etc/SuSE-release ]; then
+         # SuSE system
+-        COMPREPLY=( $( command ls \
+-        /etc/sysconfig/network/ifcfg-* | \
+-        sed -ne 's|.*ifcfg-\('"$cur"'.*\)|\1|p' ) )
++        COMPREPLY=( $( compgen -W "$( command ls \
++            /etc/sysconfig/network/ifcfg-* | \
++            sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) )
+     elif [ -f /etc/pld-release ]; then
+         # PLD Linux
+-        COMPREPLY=( $( command ls -B \
+-        /etc/sysconfig/interfaces | \
+-        sed -ne 's|.*ifcfg-\('"$cur"'.*\)|\1|p' ) )
++        COMPREPLY=( $( compgen -W "$( command ls -B \
++            /etc/sysconfig/interfaces | \
++            sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) )
+     else
+         # Assume Red Hat
+-        COMPREPLY=( $( command ls \
+-        /etc/sysconfig/network-scripts/ifcfg-* | \
+-        sed -ne 's|.*ifcfg-\('"$cur"'.*\)|\1|p' ) )
++        COMPREPLY=( $( compgen -W "$( command ls \
++            /etc/sysconfig/network-scripts/ifcfg-* | \
++            sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) )
+     fi
+ }
+ 
+@@ -514,7 +514,8 @@ _available_interfaces()
+     fi
+ 
+     COMPREPLY=( $( eval $cmd 2>/dev/null | \
+-    sed -ne 's|^\('"$cur"'[^[:space:][:punct:]]\{1,\}\).*$|\1|p') )
++        awk '/^[^[:space:]]/ { print $1 }' ) )
++    COMPREPLY=( $( compgen -W '${COMPREPLY[@]/%[[:punct:]]/}' -- "$cur" ) )
+ }
+ 
+ # This function expands tildes in pathnames
+@@ -608,14 +609,13 @@ _uids()
+ _gids()
+ {
+     if type getent &>/dev/null; then
+-        COMPREPLY=( $( getent group | \
+-        awk -F: '{if ($3 ~ /^'"$cur"'/) print $3}' ) )
++        COMPREPLY=( $( compgen -W '$( getent group | cut -d: -f3 )' \
++            -- "$cur" ) )
+     elif type perl &>/dev/null; then
+         COMPREPLY=( $( compgen -W '$( perl -e '"'"'while (($gid) = (getgrent)[2]) { print $gid . "\n" }'"'"' )' -- "$cur" ) )
+     else
+         # make do with /etc/group
+-        COMPREPLY=( $( awk 'BEGIN {FS=":"} {if ($3 ~ /^'"$cur"'/) print $3}'\
+-        /etc/group ) )
++        COMPREPLY=( $( compgen -W '$( cut -d: -f3 /etc/group )' -- "$cur" ) )
+     fi
+ }
+ 
+@@ -641,8 +641,8 @@ _modules()
+ {
+     local modpath
+     modpath=/lib/modules/$1
+-    COMPREPLY=( $( command ls -R $modpath | \
+-    sed -ne 's/^\('"$cur"'.*\)\.k\?o\(\|.gz\)$/\1/p') )
++    COMPREPLY=( $( compgen -W "$( command ls -R $modpath | \
++        sed -ne 's/^\(.*\)\.k\?o\(\|.gz\)$/\1/p' )" -- "$cur" ) )
+ }
+ 
+ # This function completes on installed modules
+@@ -650,7 +650,7 @@ _modules()
+ _installed_modules()
+ {
+     COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" lsmod | \
+-    awk '{if (NR != 1) print $1}' )" -- $1 ) )
++        awk '{if (NR != 1) print $1}' )" -- "$1" ) )
+ }
+ 
+ # This function completes on user:group format
+@@ -885,15 +885,17 @@ deinstall clean clean-depends kernel bui
+         for i in {,/usr}/{,s}bin/showmount; do [ -x $i ] && sm=$i && break; done
+ 
+         if [ -n "$sm" ] && [[ "$cur" == *:* ]]; then
+-            COMPREPLY=( $( $sm -e ${cur%%:*} | sed 1d | \
+-            grep ^${cur#*:} | awk '{print $1}' ) )
++            COMPREPLY=( $( compgen -W "$( $sm -e ${cur%%:*} | sed 1d | \
++                awk '{print $1}' )" -- "$cur" ) )
+         elif [[ "$cur" == //* ]]; then
+             host=${cur#//}
+             host=${host%%/*}
+             if [ -n "$host" ]; then
+-                COMPREPLY=( $( compgen -W "$( echo $( smbclient -d 0 -NL $host 2>/dev/null|
+-                sed -ne '/^['"$'\t '"']*Sharename/,/^$/p' |
+-                sed -ne '3,$s|^[^A-Za-z]*\([^'"$'\t '"']*\).*$|//'$host'/\1|p' ) )" -- "$cur" ) )
++                COMPREPLY=( $( compgen -P "//$host" -W \
++                    "$( smbclient -d 0 -NL $host 2>/dev/null |
++                    sed -ne '/^['"$'\t '"']*Sharename/,/^$/p' |
++                    sed -ne '3,$s|^[^A-Za-z]*\([^'"$'\t '"']*\).*$|/\1|p' )" \
++                    -- "${cur#//$host}" ) )
+             fi
+         elif [ -r /etc/vfstab ]; then
+             # Solaris
+@@ -960,8 +962,8 @@ deinstall clean clean-depends kernel bui
+         if [ $COMP_CWORD -gt 1 ] &&
+             [[ "${COMP_WORDS[COMP_CWORD-1]}" != -* ]]; then
+             # do module parameter completion
+-            COMPREPLY=( $( /sbin/modinfo -p ${COMP_WORDS[1]} 2>/dev/null | \
+-            awk '{if ($1 ~ /^parm:/ && $2 ~ /^'"$cur"'/) { print $2 } \
++            COMPREPLY=( $( compgen -W "$( /sbin/modinfo -p ${COMP_WORDS[1]} | \
++                cut -d: -f1 )" -- "$cur" ) )
+         else if ($1 !~ /:/ && $1 ~ /^'"$cur"'/) { print $1 }}' ) )
+         else
+             _modules $(uname -r)
+--- bash-completion-debian.orig/contrib/configure
++++ bash-completion-debian/contrib/configure
+@@ -12,13 +12,15 @@ _configure()
+     [[ "$cur" != -* ]] && return 0
+ 
+     if [ -n "$COMP_CONFIGURE_HINTS" ]; then
+-        COMPREPLY=( $( $1 --help 2>&1 | awk '/^  --[A-Za-z]/ { print $1; \
+-            if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' | \
+-            grep ^$cur ) )
++        COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
++            awk '/^  --[A-Za-z]/ { print $1; \
++            if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' )" \
++            -- "$cur" ) )
+     else
+-        COMPREPLY=( $( $1 --help 2>&1 | awk '/^  --[A-Za-z]/ { print $1; \
+-            if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' | \
+-            grep ^$cur ) )
++        COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
++            awk '/^  --[A-Za-z]/ { print $1; \
++            if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' )" \
++            -- "$cur" ) )
+     fi
+ }
+ complete -F _configure $default configure
+--- bash-completion-debian.orig/contrib/getent
++++ bash-completion-debian/contrib/getent
+@@ -27,13 +27,13 @@ _getent()
+             return 0
+             ;;
+         protocols|networks|ahosts|ahostsv4|ahostsv6|rpc)
+-            COMPREPLY=( $( getent "$prev" | \
+-                sed -ne 's|^\('"$cur"'[^[:space:]]*\).*|\1|p' ) )
++            COMPREPLY=( $( compgen -W "$( getent "$prev" | \
++                awk '{ print $1 }' )" -- "$cur" ) )
+             return 0
+             ;;
+         aliases|shadow)
+-            COMPREPLY=( $( getent "$prev" | \
+-                sed -ne 's|^\('"$cur"'[^:]*\).*|\1|p' ) )
++            COMPREPLY=( $( compgen -W "$( getent "$prev" | cut -d: -f1 )" \
++                -- "$cur" ) )
+             return 0
+             ;;
+     esac
+--- bash-completion-debian.orig/contrib/qdbus
++++ bash-completion-debian/contrib/qdbus
+@@ -7,13 +7,9 @@ _qdbus()
+ 
+     COMPREPLY=()
+     cur=`_get_cword`
+-    if [ -z "$cur" ]; then
+-        compstr=${COMP_WORDS[*]}
+-    else
+-        compstr=$( command echo ${COMP_WORDS[*]} | sed "s/ ${cur/\//\\/}$//" )
+-    fi
+-        COMPREPLY=( $( compgen -W '$( command $compstr | sed s/\(.*\)// )' \
+-            -- "$cur" ) )
++    [ -n "$cur" ] && unset COMP_WORDS[${#COMP_WORDS[@]}-1]
++    COMPREPLY=( $( compgen -W '$( command ${COMP_WORDS[@]} | sed s/\(.*\)// )' \
++        -- "$cur" ) )
+ } &&
+ complete -F _qdbus qdbus
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 0a3fe47..3ddbe5e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 01-fix_550943.patch
 02-fix_552109.patch
+03-fix_552631.patch

-- 
debian-package



More information about the Bash-completion-commits mailing list