From 46986ad4c27420e7edcbff10490694fe56f12de2 Mon Sep 17 00:00:00 2001 From: James Bowlin Date: Thu, 2 Dec 2010 01:33:56 +0800 Subject: [PATCH] Use eix instead of emerge when possible On Gentoo the eix program is MUCH faster than emerge for listing package names. I've left the emerge code in as a 2nd choice because not every Gentoo system has eix installed (although they should). Also, the emerge code didn't seem to produce any output on my system. Signed-off-by: Grissiom --- share/functions/__fish_print_packages.fish | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish index 8dae87b91..1991bd6d7 100644 --- a/share/functions/__fish_print_packages.fish +++ b/share/functions/__fish_print_packages.fish @@ -46,9 +46,17 @@ function __fish_print_packages # This completes the package name from the portage tree. # True for installing new packages. Function for printing # installed on the system packages is in completions/emerge.fish - if type -f emerge >/dev/null - emerge -s \^(commandline -tc) |sgrep "^*" |cut -d\ -f3 |cut -d/ -f2 + + # eix is MUCH faster than emerge so use it if it is available + if type -f eix > /dev/null + eix --only-names "^"(commandline -tc) | cut -d/ -f2 return + else + # FIXME? Seems to be broken + if type -f emerge >/dev/null + emerge -s \^(commandline -tc) |sgrep "^*" |cut -d\ -f3 |cut -d/ -f2 + return + end end end