commit: 5eafc6b22479d263b46f2f9cda5ccb46acb62c54
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Mon Jul 28 17:57:10 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 25 09:51:35 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5eafc6b2
special_env_vars.py: add GLOBSORT to the environ_filter set
The traditional behaviour of bash has been to sort the words produced by
pathname expansion by name, in ascending lexicographical order, and in
accordance with the collation defined by the 'LC_COLLATE' variable.
However, bash-5.3 introduces the new 'GLOBSORT' variable which provides
a means of controlling how the words are sorted. For example, setting
GLOBSORT="-mtime" will sort by reverse order of modification time.
Given that bash is capable of inheriting this variable from its process
environment, portage must not be allowed to propagate the variable to
the "ebuild.sh" utility or any other programs that it executes. To that
end, incorporate the 'GLOBSORT' variable into the 'environ_filter' set
defined by the "special_env_vars.py" unit.
See-also: 8a607ed23beb4995627f9c4e2c7580469ace56bb
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 | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/portage/package/ebuild/_config/special_env_vars.py
b/lib/portage/package/ebuild/_config/special_env_vars.py
index 17f7bf0f76..e4cfc727fc 100644
--- a/lib/portage/package/ebuild/_config/special_env_vars.py
+++ b/lib/portage/package/ebuild/_config/special_env_vars.py
@@ -265,6 +265,7 @@ environ_filter = frozenset(
"MANPATH",
"USER",
# variables that break bash
+ "GLOBSORT",
"HISTFILE",
"POSIXLY_CORRECT",
# portage config variables and variables set directly by portage