commit:     4cf0144f2b931f93146734c0c866f727c8e0369c
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Mon Jul 28 16:51:38 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 25 09:51:34 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4cf0144f

special_env_vars.py: add {FETCH,RESUME}COMMAND_SSH to the environ_filter set

Portage is supposed to prevent configuration variables in both the
FETCHCOMMAND_ and RESUMECOMMAND_ namespaces from being propagated to the
environment of the "ebuild.sh" utility and its subprocesses. To that
end, the "special_env_vars.py" unit defines the 'environ_filter' set,
which includes the following twelve variables among its members.

- FETCHCOMMAND
- FETCHCOMMAND_FTP
- FETCHCOMMAND_HTTP
- FETCHCOMMAND_HTTPS
- FETCHCOMMAND_RSYNC
- FETCHCOMMAND_SFTP
- RESUMECOMMAND
- RESUMECOMMAND_FTP
- RESUMECOMMAND_HTTP
- RESUMECOMMAND_HTTPS
- RESUMECOMMAND_RSYNC
- RESUMECOMMAND_SFTP

However, it does not account for the fact that the SSH protocol is
supported. Address this by incorporating both the 'FETCHCOMMAND_SSH' and
'RESUMECOMMAND_SSH' variables into the set. Assuming their default
values, this saves 568 bytes of environment space, as well as preventing
them from unnecessarily leaking into "environment.bz2" files.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/portage/package/ebuild/_config/special_env_vars.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/portage/package/ebuild/_config/special_env_vars.py 
b/lib/portage/package/ebuild/_config/special_env_vars.py
index a8e3c11419..17f7bf0f76 100644
--- a/lib/portage/package/ebuild/_config/special_env_vars.py
+++ b/lib/portage/package/ebuild/_config/special_env_vars.py
@@ -289,6 +289,7 @@ environ_filter = frozenset(
         "FETCHCOMMAND_HTTPS",
         "FETCHCOMMAND_RSYNC",
         "FETCHCOMMAND_SFTP",
+        "FETCHCOMMAND_SSH",
         "GENTOO_MIRRORS",
         "NOCONFMEM",
         "O",
@@ -330,6 +331,7 @@ environ_filter = frozenset(
         "RESUMECOMMAND_HTTPS",
         "RESUMECOMMAND_RSYNC",
         "RESUMECOMMAND_SFTP",
+        "RESUMECOMMAND_SSH",
         "UNINSTALL_IGNORE",
         "USE_EXPAND_HIDDEN",
         "USE_ORDER",

Reply via email to