Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoberto Oliveira2015-05-22 10:19:25 -0400
committerWainer dos Santos Moschetta2015-06-03 11:26:25 -0400
commit2997450907150d1c4c7ff1c8e8c9d2995c09e4bf (patch)
tree8404c77f45f368a494c41a7476fb7cd39545bc34
parentba4ec789a96cc8cb0316dbe49e64d1c9b64d8405 (diff)
downloadorg.eclipse.linuxtools-2997450907150d1c4c7ff1c8e8c9d2995c09e4bf.tar.gz
org.eclipse.linuxtools-2997450907150d1c4c7ff1c8e8c9d2995c09e4bf.tar.xz
org.eclipse.linuxtools-2997450907150d1c4c7ff1c8e8c9d2995c09e4bf.zip
Bug 469184: Fix an issue when there are functions exported in ENV.
- Fixed pattern that ignores functions exported in ENV. The pattern was not working for BASH_FUNC_scl() function in newer distributions. Change-Id: I68ba57d64ad4c07c2f46ed56baf5616f7a0912ff Signed-off-by: Roberto Oliveira <rdutra@linux.vnet.ibm.com> Reviewed-on: https://git.eclipse.org/r/49230 Tested-by: Hudson CI Reviewed-by: Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com> Tested-by: Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com> (cherry picked from commit 3ad80ee3ea3267c2ab8d9bd998d9f5afd7af0b70) Reviewed-on: https://git.eclipse.org/r/49372
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTProxyManager.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTProxyManager.java b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTProxyManager.java
index d5e6e13c46..20e9b5dc94 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTProxyManager.java
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTProxyManager.java
@@ -90,9 +90,15 @@ public class RDTProxyManager implements IRemoteEnvProxyManager {
* and none of LT plugins working remotely because they are not find on
* path.
*
- * ie: BASH_FUNC_module()=() { eval `/usr/bin/modulecmd bash $*`, }
+ * Patterns added in the env list:
+ * var=value
+ * i.e: SHELL=/bin/bash
+ *
+ * Patterns not added in the env list:
+ * var=() { foo
+ * i.e: BASH_FUNC_module()=() { eval `/usr/bin/modulecmd bash $*`, }
*/
- Pattern functionPattern = Pattern.compile("(.+)\\(\\)=([\\(\\)\\s{].+[\n]*.+)"); //$NON-NLS-1$
+ Pattern variablePattern = Pattern.compile("^(.+)=([^\\(\\)\\s{].*|)$"); //$NON-NLS-1$
Matcher m;
Map<String, String> envMap = new HashMap<>();
IRemoteProcessService ps = connection.getService(IRemoteProcessService.class);
@@ -100,8 +106,8 @@ public class RDTProxyManager implements IRemoteEnvProxyManager {
for (String key : envTemp.keySet()) {
String value = envTemp.get(key);
String env = key + "=" + value; //$NON-NLS-1$
- m = functionPattern.matcher(env);
- if (!m.matches()) {
+ m = variablePattern.matcher(env);
+ if (m.matches()) {
envMap.put(key, value);
}
}

Back to the top