Created attachment 541722 [details] patch for c352c8742ae24e09b2b513aa4f168b44e4eabeb9 If current version of bash is >= 4.4, portage can use ${param@a} to get a variable's attributes, and then test the expansion directly. This avoids the subshell, unnecessary printing of values, and temporary internal IO. See attachment.
(In reply to konsolebox from comment #0) > Created attachment 541722 [details] > patch for c352c8742ae24e09b2b513aa4f168b44e4eabeb9 This is great, thanks! I'd like to make a couple minor changes: 1) Move the function declaration to bin/isolated-functions.sh, which is where all the general purpose functions are. 2) Make the function start with triple underscore, since this namespace is reserved and automatically filtered from the saved environment as shown here: https://gitweb.gentoo.org/proj/portage.git/commit/?id=29f3837382babcac38d4c0e6498620b0dbc6df67
Created attachment 541942 [details] Move and rename function as requested
@Zed Are you still gonna merge this?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=5473a2695aa3fb3a7cdee889fe8c861fcb274277 commit 5473a2695aa3fb3a7cdee889fe8c861fcb274277 Author: Ross Konsolebox <konsolebox@gmail.com> AuthorDate: 2018-08-01 14:40:59 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2019-05-20 00:04:12 +0000 Add bash ___is_indexed_array_var function (bug 662468) Closes: https://bugs.gentoo.org/662468 Signed-off-by: Zac Medico <zmedico@gentoo.org> bin/isolated-functions.sh | 10 ++++++++++ bin/phase-helpers.sh | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-)
Thanks!