diff --git a/share/functions/__fish_portage_print_repository_names.fish b/share/functions/__fish_portage_print_repository_names.fish index 47e204570..336567ff4 100644 --- a/share/functions/__fish_portage_print_repository_names.fish +++ b/share/functions/__fish_portage_print_repository_names.fish @@ -1,4 +1,4 @@ function __fish_portage_print_repository_names --description 'Print the names of all configured repositories' # repos.conf may be a file or a directory - find /etc/portage/repos.conf -type f -exec sed -ne '/^[[:blank:]]*\[[[:alnum:]_][[:alnum:]_-]*\]/{s!^.*\[\(.*\)\].*$!\1!; /DEFAULT/!p}' '{}' + + find /etc/portage/repos.conf -type f -exec cat '{}' + | string replace -r --filter '^\s*\[([[:alnum:]_][[:alnum:]_-]*)\]' '$1' | string match -v -e DEFAULT end diff --git a/share/functions/__fish_portage_print_repository_paths.fish b/share/functions/__fish_portage_print_repository_paths.fish index cfe23f715..48dd738a5 100644 --- a/share/functions/__fish_portage_print_repository_paths.fish +++ b/share/functions/__fish_portage_print_repository_paths.fish @@ -1,4 +1,4 @@ function __fish_portage_print_repository_paths --description 'Print the paths of all configured repositories' # repos.conf may be a file or a directory - find /etc/portage/repos.conf -type f -exec awk 'BEGIN { FS="[[:blank:]]*=[[:blank:]]*" } $1 == "location" { print $2 }' '{}' + + find /etc/portage/repos.conf -type f -exec cat '{}' + | string replace -r --filter '^\s*location\s*=\s*(\S+)' '$1' end