commit: 9c80c1b5ee3bfe832a114f33970f0dbad7c3f713
Author: Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Fri Jun 27 08:22:11 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jun 28 02:30:24 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9c80c1b5
phase-functions.sh: merge bash_misc_vars and readonly_bash_vars
Presently, the __filter_readonly_variables() function declares two array
variables named 'bash_misc_vars' and 'readonly_bash_vars'. The
distinction between them isn't important enough to merit two separate
variables, as should become clear upon further refactoring of the
function. Merge these two arrays into one that is named 'bash_vars'.
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
bin/phase-functions.sh | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index a2325a76a4..dee18d3ceb 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -86,17 +86,15 @@ PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNAME"
# builtin command. To avoid this problem, this function filters those
# variables out and discards them. See bug #190128.
__filter_readonly_variables() {
- local -a
{binpkg_untrusted,filtered_sandbox,readonly_bash,misc_garbage,bash_misc}_vars
words
+ local -a {binpkg_untrusted,filtered_sandbox,misc_garbage,bash}_vars
words
local IFS
- readonly_bash_vars=(
- BASHOPTS BASHPID DIRSTACK EUID FUNCNAME GROUPS PIPESTATUS PPID
- SHELLOPTS UID
- )
- bash_misc_vars=(
- BASH "BASH_.*" COLUMNS COMP_WORDBREAKS HISTCMD HISTFILE
- HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD OPTERR OPTIND
- OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM SECONDS SHLVL _
+ bash_vars=(
+ "BASH_.*" BASH BASHOPTS BASHPID COLUMNS COMP_WORDBREAKS
+ DIRSTACK EUID FUNCNAME GROUPS HISTCMD HISTFILE HOSTNAME
+ HOSTTYPE IFS LINENO MACHTYPE OLDPWD OPTERR OPTIND OSTYPE
+ PIPESTATUS POSIXLY_CORRECT PPID PS4 PWD RANDOM SECONDS
+ SHELLOPTS SHLVL UID _
)
filtered_sandbox_vars=(
SANDBOX_ACTIVE SANDBOX_BASHRC SANDBOX_DEBUG_LOG
@@ -111,9 +109,8 @@ __filter_readonly_variables() {
)
read -rd '' -a words <<<"${PORTAGE_READONLY_VARS}"
filtered_vars+=(
- "${readonly_bash_vars[@]}"
"${misc_garbage_vars[@]}"
- "${bash_misc_vars[@]}"
+ "${bash_vars[@]}"
"${words[@]}"
"___.*"
)