From 63aae2a1775e501678290c6dbeac53215decffc2 Mon Sep 17 00:00:00 2001 From: Lucio Sauer Date: Fri, 10 May 2024 14:07:16 +0200 Subject: portageq envvar: fix variables selected for completion With lines like VAR="foo" BAZ="1 2 3", \(.*\)=".*$ not only matches VAR, but also VAR="foo" BAZ. This applies at line ^USE=.*, where the regular USE flags are followed by a list of all present USE_EXPAND variables together with their respective values. The current sed invocation also ignores environment variables that start with a lowercase letter, such as gl_cv_compiler_check_decl_option. Closes: https://bugs.gentoo.org/931671 Signed-off-by: Lucio Sauer Signed-off-by: Sam James --- completions/portageq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/completions/portageq b/completions/portageq index a8a113b..7775cc4 100644 --- a/completions/portageq +++ b/completions/portageq @@ -48,7 +48,7 @@ _portageq() { # this also isn't the fastest, but I welcome an alternative method envvar) COMPREPLY=($(compgen -W "$(env -i PATH="${PATH}" emerge -v --info | \ - sed -n -e '/^[[:upper:]].*=".*"/s/^\(.*\)=".*$/\1/p')" -- ${cur})) + cut -s -d = -f 1)" -- ${cur})) ;; *v@(isible|ersion)|match) -- cgit v1.2.3-65-gdbad