tcmode: don't early expand PATH in its adjustments

To avoid issues when a user installed a Sourcery toolchain to the default path
and let it modify their PATH, we iterate over PATH and remove the problematic
elements. Unfortunately, in doing so, we inadvertently forced an early
expansion of PATH due to getting it in its expanded form, then setting PATH
based on that form. Instead, operate against the unexpanded PATH.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
This commit is contained in:
Christopher Larson
2012-10-26 10:24:37 -07:00
parent 2845e07df7
commit d6bbda9d7d

View File

@@ -103,7 +103,7 @@ python toolchain_metadata_setup () {
# break the build (in particular, the ia32 toolchain, as it provdes
# non-prefixed binaries).
install_prefix_default = bb.data.expand('${HOME}/CodeSourcery/', l)
path = d.getVar('PATH', True).split(':')
path = d.getVar('PATH', False).split(':')
path = filter(lambda p: not p.startswith(install_prefix_default), path)
d.setVar('PATH', ':'.join(path))