Refactor _python_any_set_globals() to use local variables while
generating all output, and copy it to final vars at the end. This is
in preparation for integrity checks. NFC.
Add integrity check for multi-inherits, i.e. ensure that PYTHON_COMPAT
has not changed between successive calls to _python_set_impls. If it did
(e.g. because of eclass+ebuild setting different values), then we abort
not to give surprising results to the user.
Refactor _python_set_impls to use local variables throughout
the function and assign global values at the end. This prepares it for
double-inherit integrity checks. NFC.
Fix python_wrapper_setup function to move setting environment variables
for PATH and PKG_CONFIG_PATH outside the 'if'. Otherwise, they are only
set on the initial invocation of python_wrapper_setup for the particular
impl and do not apply to subsequent invocations (e.g. further
distutils-r1 phases).
Replace the unnecessary use of 'eval ls -d ...' with much simpler
and safer filename expansion via bash array. The 'eval' was completely
unnecessary in the original code; however, the late addition of quoting
would have broken it if eval did not implicitly discard the quotes.
The 'ls -d' was unnecessary as well since bash performs filename
expansion before passing the parameter to 'ls'.
Furthermore, a check for accidental multiple expansion has been added.
A complementary check for failed expansion can not be added since
the function is called in src_unpack() as well and the expansion fails
then.
Filename expansion is performed when the variable is referenced unquoted
already. There is really no need to call 'ls' on top of that, and even
less reason to wrap it all in 'eval'.
Replace the horrifying use of evals along with quoting to pass multiple
filenames whitespace-safe with much simpler bash arrays. While at it,
also simplify the find-read loop.
Replace the evals used to export variables with plain export calls. Bash
expands variable references for exported variable name anyway, rendering
the eval completely unnecessary.
Replace the single eval used for indirect variable reference with the
${!...} substitution which serves that exact purpose in bash.
Replace the eval used to pass quoted password in with simpler and safer
bash arrays. Using eval is strongly discouraged as it is error-prone
and confusing.