[yocto] [eclipse-poky][PATCH] plugins/org.yocto.sdk.ide: Account for multiple PATH exports

Adrian Dudau adrian.dudau at enea.com
Tue May 31 04:41:36 PDT 2016


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 <adrian.dudau at enea.com>
---
 .../src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java                 | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java
index 6afc185..5fe74a5 100644
--- a/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java
+++ b/plugins/org.yocto.sdk.ide/src/org/yocto/sdk/ide/utils/YoctoSDKUtils.java
@@ -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")) {
-- 
1.9.1




More information about the yocto mailing list