remove sed (and awk) from gentoo-portage completions

This commit is contained in:
Wilke Schwiedop 2018-04-15 20:52:51 +02:00 committed by Fabian Homborg
parent 70c80c9d0e
commit 02ae926c8e
2 changed files with 2 additions and 2 deletions

View file

@ -1,4 +1,4 @@
function __fish_portage_print_repository_names --description 'Print the names of all configured repositories' function __fish_portage_print_repository_names --description 'Print the names of all configured repositories'
# repos.conf may be a file or a directory # 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 end

View file

@ -1,4 +1,4 @@
function __fish_portage_print_repository_paths --description 'Print the paths of all configured repositories' function __fish_portage_print_repository_paths --description 'Print the paths of all configured repositories'
# repos.conf may be a file or a directory # 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 end