The following commit has been merged in the master branch:
commit c922626d4b9b78d266c8336c702b4c5e9a0325d4
Author: Ville Skyttä <[email protected]>
Date:   Sun Oct 23 11:13:50 2011 +0300

    cpan2dist: Don't hang if no package list files exist.

diff --git a/completions/cpan2dist b/completions/cpan2dist
index 9845a0a..4ec33c0 100644
--- a/completions/cpan2dist
+++ b/completions/cpan2dist
@@ -30,9 +30,8 @@ _cpan2dist()
             [[ -d "$dir" && -r "$dir/02packages.details.txt.gz" ]] && \
                 packagelist="$dir/02packages.details.txt.gz"
         done
-        COMPREPLY=( $( zgrep "^${cur//-/::}" \
-            $packagelist 2>/dev/null \
-            | awk '{print $1}' | sed -e 's/::/-/g' ) )
+        [[ $packagelist ]] && COMPREPLY=( $( zgrep "^${cur//-/::}" \
+            $packagelist 2>/dev/null | awk '{print $1}' | sed -e 's/::/-/g' ) )
     fi
 } &&
 complete -F _cpan2dist -o default cpan2dist

-- 
bash-completion

_______________________________________________
Bash-completion-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/bash-completion-commits

Reply via email to