aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_print_packages.fish
diff options
context:
space:
mode:
authorGravatar James Bowlin <bowlin@mindspring.com>2010-12-02 01:33:56 +0800
committerGravatar Grissiom <chaos.proton@gmail.com>2010-12-02 01:33:56 +0800
commit46986ad4c27420e7edcbff10490694fe56f12de2 (patch)
tree4b9524f1c5323c153e912005ce7ee89fe925dd83 /share/functions/__fish_print_packages.fish
parent6a5d6471c5493269d057d0b9d1f59ba18753c1da (diff)
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 <chaos.proton@gmail.com>
Diffstat (limited to 'share/functions/__fish_print_packages.fish')
-rw-r--r--share/functions/__fish_print_packages.fish12
1 files changed, 10 insertions, 2 deletions
diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish
index 8dae87b9..1991bd6d 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