commit:     aa32f1e126bdf947efc012d4d6b93a7150d74b24
Author:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Fri May 10 11:59:16 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat May 11 03:11:17 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-bashcomp.git/commit/?id=aa32f1e1

portageq envvar: preserve PATH to avoid command validation warnings

Some of Portage's environment variables undergo command validation.
When one is set to a relative value, Portage relies on PATH to find the
binary.
We need to preserve it after purging the environment (`env -i`) if we
want to avoid "<key> is invalid: <value>" warnings.

For Portage 3.0.63, this affects
PORTAGE_{B{,UN}ZIP2_COMMAND,LOG_FILTER_FILE_CMD}.

Bug: https://bugs.gentoo.org/588642
Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 completions/portageq | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/completions/portageq b/completions/portageq
index 7922e59..a8a113b 100644
--- a/completions/portageq
+++ b/completions/portageq
@@ -47,7 +47,7 @@ _portageq() {
 
     # this also isn't the fastest, but I welcome an alternative method
     envvar)
-        COMPREPLY=($(compgen -W "$(env -i emerge -v --info | \
+        COMPREPLY=($(compgen -W "$(env -i PATH="${PATH}" emerge -v --info | \
                 sed -n -e '/^[[:upper:]].*=".*"/s/^\(.*\)=".*$/\1/p')" -- 
${cur}))
         ;;
 

Reply via email to