mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 12:21:19 -03:00
remove sed (and awk) from gentoo-portage completions
This commit is contained in:
committed by
Fabian Homborg
parent
70c80c9d0e
commit
02ae926c8e
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user