plugins/org.yocto.sdk.ide: Account for multiple PATH exports
PATCH 1/1 plugins/org.yocto.sdk.ide: Account for multiple PATH exports
In the current implementation of the HashMap parsing of the source script only the last $PATH export is considered, which leads to issues in the case of eSDK.
By concatenating the new value with HashMap values from previous iterations we make sure that previous exports are not lost.
[YOCTO #9361]
Signed-off-by Adrian Dudau <[email protected]>
--- .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java +5 -2
@@ -223,9 +223,12 @@ public class YoctoSDKUtils { if (sValue.startsWith("\"") && sValue.endsWith("\"")) sValue = sValue.substring(sValue.indexOf('"') + 1, sValue.lastIndexOf('"')); /* If PATH ending with $PATH, we need to join with current system path */ - if (sKey.equalsIgnoreCase("PATH")) { - if (sValue.lastIndexOf("$PATH") >= 0) + if (sKey.equalsIgnoreCase("PATH") && (sValue.lastIndexOf("$PATH") >= 0)) { + if (envMap.containsKey(sKey)) { + sValue = sValue.substring(0, sValue.lastIndexOf("$PATH")) + envMap.get(sKey); + } else { sValue = sValue.substring(0, sValue.lastIndexOf("$PATH")) + System.getenv("PATH"); + } } if(sValue.toUpperCase().contains("$SDKTARGETSYSROOT")) {
Signature · 1 line
1.9.1