diff --git a/share/functions/__fish_print_portage_available_pkgs.fish b/share/functions/__fish_print_portage_available_pkgs.fish index fcbf849c1..f4bf25c39 100644 --- a/share/functions/__fish_print_portage_available_pkgs.fish +++ b/share/functions/__fish_print_portage_available_pkgs.fish @@ -1,3 +1,6 @@ function __fish_print_portage_available_pkgs --description 'Print all available packages' - find (__fish_print_portage_repository_paths) -mindepth 2 -maxdepth 2 -type d ! '(' '(' -path '*/eclass/*' -o -path '*/metadata/*' -o -path '*/profiles/*' -o -path '*/.*/*' ')' -prune ')' -printf '%P\n' + set -l paths (__fish_print_portage_repository_paths) + set -q paths[1] + or return + find $paths -mindepth 2 -maxdepth 2 -type d ! '(' '(' -path '*/eclass/*' -o -path '*/metadata/*' -o -path '*/profiles/*' -o -path '*/.*/*' ')' -prune ')' -printf '%P\n' 2>/dev/null end diff --git a/share/functions/__fish_print_portage_installed_pkgs.fish b/share/functions/__fish_print_portage_installed_pkgs.fish index 136c8ac6e..a776d9e51 100644 --- a/share/functions/__fish_print_portage_installed_pkgs.fish +++ b/share/functions/__fish_print_portage_installed_pkgs.fish @@ -1,3 +1,3 @@ function __fish_print_portage_installed_pkgs --description 'Print all installed packages (non-deduplicated)' - find /var/db/pkg -mindepth 2 -maxdepth 2 -type d -printf '%P\n' | string replace -r -- '-[0-9][0-9.]*.*$' '' + find /var/db/pkg -mindepth 2 -maxdepth 2 -type d -printf '%P\n' 2>/dev/null | string replace -r -- '-[0-9][0-9.]*.*$' '' end diff --git a/share/functions/__fish_print_portage_repository_paths.fish b/share/functions/__fish_print_portage_repository_paths.fish index e2d76036a..f9370b8a1 100644 --- a/share/functions/__fish_print_portage_repository_paths.fish +++ b/share/functions/__fish_print_portage_repository_paths.fish @@ -3,12 +3,14 @@ function __fish_print_portage_repository_paths --description 'Print the paths of set -l b set -l c /usr/share/portage/config/repos.conf test -d $a - and set b (find $a -type f ) + and set b (find $a -type f 2>/dev/null) test -f $a and set b $a test -n "$b" - and string match -q "[gentoo]" -- (cat $b) + and string match -q "[gentoo]" -- (cat $b 2>/dev/null) and set c $b or set -a c $b - cat $c | string match -g -r '^location = (.*$)' + path is -r -- $c + or return + cat $c 2>/dev/null | string match -g -r '^location = (.*$)' end