diff -u bash-completion-1.0/debian/changelog bash-completion-1.0/debian/changelog --- bash-completion-1.0/debian/changelog +++ bash-completion-1.0/debian/changelog @@ -1,3 +1,12 @@ +bash-completion (1:1.0-3ubuntu3) lucid; urgency=medium + + * Fix regression in scp completion + - No completion at all after : (LP: #449349) + - Completion doesn't correctly handle spaces (LP: #482753) + - Homedir completion also fixed + + -- Martin Eve (www.martineve.com) Mon, 23 Nov 2009 10:53:40 +0000 + bash-completion (1:1.0-3ubuntu2) karmic; urgency=low * Backport quote_readline fix for bash 4, since double-quoting for compgen diff -u bash-completion-1.0/debian/patches/series bash-completion-1.0/debian/patches/series --- bash-completion-1.0/debian/patches/series +++ bash-completion-1.0/debian/patches/series @@ -6,0 +7 @@ +fix_scp_completion.diff only in patch2: unchanged: --- bash-completion-1.0.orig/debian/patches/fix_scp_completion.diff +++ bash-completion-1.0/debian/patches/fix_scp_completion.diff @@ -0,0 +1,47 @@ +Index: bash-completion-1.0/contrib/ssh +=================================================================== +--- bash-completion-1.0.orig/contrib/ssh 2009-11-23 10:57:41.317385085 +0000 ++++ bash-completion-1.0/contrib/ssh 2009-11-23 11:01:26.789419406 +0000 +@@ -62,22 +62,34 @@ + local optconfigfile + + COMPREPLY=() +- cur=`_get_cword ":"` ++ ++ COMPREPLY=() + +- _expand || return 0 ++ cur="${COMP_WORDS[COMP_CWORD]}" ++ prev="${COMP_WORDS[COMP_CWORD-1]}" + ++ # let the user press tab immediately to get home dir + if [[ "$cur" == *:* ]]; then ++ userhost=$prev ++ path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null) ++ # escape spaces; remove executables, aliases, pipes and sockets; ++ # add space at end of file names ++ COMPREPLY=( $( ssh -o 'Batchmode yes' $userhost \ ++ command ls -aF1d "$path*" 2>/dev/null | \ ++ sed -e "s/[][(){}<>\",:;^&\!$=?\`|\\ ']/\\\\\\\\\\\\&/g" \ ++ -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ) ) ++ return 0 ++ fi ++ ++ if [[ "$prev" == *:* ]]; then + local IFS=$'\t\n' + # remove backslash escape from : + cur=${cur/\\:/:} +- userhost=${cur%%?(\\):*} ++ userhost=${COMP_WORDS[COMP_CWORD-2]} + path=${cur#*:} + # unescape spaces +- path=${path//\\\\\\\\ / } +- if [ -z "$path" ]; then +- # default to home dir of specified user on remote host +- path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null) +- fi ++ path=${path//\\\\ / } ++ + # escape spaces; remove executables, aliases, pipes and sockets; + # add space at end of file names + COMPREPLY=( $( ssh -o 'Batchmode yes' $userhost \