diff -Nru bash-completion-1.2/debian/changelog bash-completion-1.2/debian/changelog --- bash-completion-1.2/debian/changelog 2011-01-10 20:57:38.000000000 +0100 +++ bash-completion-1.2/debian/changelog 2011-02-02 15:59:44.000000000 +0100 @@ -1,3 +1,10 @@ +bash-completion (1:1.2-3ubuntu4) natty; urgency=low + + * debian/patches/fix_p4_completion.patch: + - Fix p4 completion (LP: #652104) + + -- Angel Abad Wed, 02 Feb 2011 15:59:27 +0100 + bash-completion (1:1.2-3ubuntu3) natty; urgency=low [ Marian Sigler ] diff -Nru bash-completion-1.2/debian/patches/fix_p4_completion.patch bash-completion-1.2/debian/patches/fix_p4_completion.patch --- bash-completion-1.2/debian/patches/fix_p4_completion.patch 1970-01-01 01:00:00.000000000 +0100 +++ bash-completion-1.2/debian/patches/fix_p4_completion.patch 2011-02-02 15:55:32.000000000 +0100 @@ -0,0 +1,47 @@ +Description: Fix p4 completion +Author: Ville Skytt +Bug-Ubuntu: https://bugs.launchpad.net/bugs/652104 +Origin: upstream, http://git.debian.org/?p=bash-completion/bash-completion.git;a=commitdiff;h=5eead0ebeecf7d3212df3fea9cfe0fa88b6d0274 + +diff --git a/contrib/p4 b/contrib/p4 +index 0795a28..59b02c1 100644 +--- a/contrib/p4 ++++ b/contrib/p4 +@@ -3,10 +3,10 @@ + have p4 && + _p4() + { +- local cur prev preprev p4commands p4filetypes ++ local cur prev words cword p4commands p4filetypes + + COMPREPLY=() +- _get_comp_words_by_ref cur prev preprev ++ _get_comp_words_by_ref cur prev words cword + + # rename isn't really a command + p4commands="$( p4 help commands | awk 'NF>3 {print $1}' )" +@@ -14,9 +14,9 @@ _p4() + uresource uxbinary xbinary xltext xtempobj xtext \ + text binary resource" + +- if [ $COMP_CWORD -eq 1 ]; then ++ if [ $cword -eq 1 ]; then + COMPREPLY=( $( compgen -W "$p4commands" -- "$cur" ) ) +- elif [ $COMP_CWORD -eq 2 ]; then ++ elif [ $cword -eq 2 ]; then + case $prev in + help) + COMPREPLY=( $( compgen -W "simple commands \ +@@ -29,10 +29,10 @@ _p4() + *) + ;; + esac +- elif [ $COMP_CWORD -gt 2 ]; then ++ elif [ $cword -gt 2 ]; then + case $prev in + -t) +- case $preprev in ++ case ${words[$cword-2]} in + add|edit|reopen) + COMPREPLY=( $( compgen -W "$p4filetypes" -- "$cur") ) + ;; diff -Nru bash-completion-1.2/debian/patches/series bash-completion-1.2/debian/patches/series --- bash-completion-1.2/debian/patches/series 2011-01-10 20:57:35.000000000 +0100 +++ bash-completion-1.2/debian/patches/series 2011-02-02 15:46:54.000000000 +0100 @@ -1,3 +1,4 @@ +fix_p4_completion.patch 00-fix_586210.patch disable-avahi-browse.diff apt-get-changelog.patch