mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
updated function __fish_print_portage_repository_paths.fish (#9012)
* updated function __fish_print_portage_repository_paths.fish to support file, dir and modified defaults * Revised version of share/functions/__fish_print_portage_repository_paths.fish * improved syntax and regex as suggested
This commit is contained in:
parent
93eb8e9928
commit
b4ec84d8a1
1 changed files with 12 additions and 2 deletions
|
@ -1,4 +1,14 @@
|
||||||
function __fish_print_portage_repository_paths --description 'Print the paths of all configured repositories'
|
function __fish_print_portage_repository_paths --description 'Print the paths of all configured repositories'
|
||||||
# repos.conf may be a file or a directory
|
set -l a /etc/portage/repos.conf
|
||||||
find /etc/portage/repos.conf -type f -exec cat '{}' + | string replace -r --filter '^\s*location\s*=\s*(\S+)' '$1'
|
set -l b
|
||||||
|
set -l c /usr/share/portage/config/repos.conf
|
||||||
|
test -d $a
|
||||||
|
and set b (find $a -type f )
|
||||||
|
test -f $a
|
||||||
|
and set b $a
|
||||||
|
test -n "$b"
|
||||||
|
and string match -q "[gentoo]" -- (cat $b)
|
||||||
|
and set c $b
|
||||||
|
or set -a c $b
|
||||||
|
cat $c | string match -g -r '^location = (.*$)'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue