diff options
author | axel <axel@liljencrantz.se> | 2006-03-14 10:21:27 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-03-14 10:21:27 +1000 |
commit | d58b9de63b7ac368ae67ab879c9a62df9ad46675 (patch) | |
tree | f87fb90559084b5b2fad4e03ad0569ebdc1e9cc7 /share/functions/__fish_print_packages.fish | |
parent | 99a93b5add6ce77b619f8b72499dc58a91024522 (diff) |
Use 'type -f' instead of 'which' to test for presense of command, since the latter does not set the exit status correctly on all platforms
darcs-hash:20060314002127-ac50b-6ed726bdcc9e3a7a9608a904c382973799dc73ef.gz
Diffstat (limited to 'share/functions/__fish_print_packages.fish')
-rw-r--r-- | share/functions/__fish_print_packages.fish | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/share/functions/__fish_print_packages.fish b/share/functions/__fish_print_packages.fish index 5c56a223..77a7da25 100644 --- a/share/functions/__fish_print_packages.fish +++ b/share/functions/__fish_print_packages.fish @@ -12,7 +12,7 @@ function __fish_print_packages #Get the word 'Package' in the current language set -l package (_ Package) - if which apt-cache >/dev/null ^/dev/null + if type -f apt-cache >/dev/null # Apply the following filters to output of apt-cache: # 1) Remove package names with parentesis in them, since these seem to not correspond to actual packages as reported by rpm # 2) Remove package names that are .so files, since these seem to not correspond to actual packages as reported by rpm @@ -25,7 +25,7 @@ function __fish_print_packages # Rpm is too slow for this job, so we set it up to do completions # as a background job and cache the results. - if which rpm >/dev/null ^/dev/null + if type -f rpm >/dev/null # If the cache is less than five minutes old, we do not recalculate it @@ -46,7 +46,7 @@ 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 which emerge >/dev/null ^/dev/null + if type -f emerge >/dev/null emerge -s \^(commandline -tc) |grep "^*" |cut -d\ -f3 |cut -d/ -f2 return end |