diff options
author | Jeff Johnston | 2013-12-05 21:16:51 +0000 |
---|---|---|
committer | Jeff Johnston | 2013-12-05 22:28:40 +0000 |
commit | bd84e07bc62eb24a354c659d5ebf618fcc5bcf60 (patch) | |
tree | 3aa28c88634ac0bf5be8966eec2a47b926c7f108 | |
parent | 4dab99404c4652336af7c74662304a1a40a6f29b (diff) | |
download | org.eclipse.cdt-bd84e07bc62eb24a354c659d5ebf618fcc5bcf60.tar.gz org.eclipse.cdt-bd84e07bc62eb24a354c659d5ebf618fcc5bcf60.tar.xz org.eclipse.cdt-bd84e07bc62eb24a354c659d5ebf618fcc5bcf60.zip |
Bug 423192 - Fix AutotoolsNewMakeGenerator getWinOSType method
- Fix AutotoolsNewMakeGenerator.getWinOSType method to
use the build env variables when invoking the sh
command because the path to "sh" may be specified there
Change-Id: Ibcde5de924c50b6557fb4264572ddd59b02bb99a
Reviewed-on: https://git.eclipse.org/r/19400
Tested-by: Hudson CI
Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>
IP-Clean: Jeff Johnston <jjohnstn@redhat.com>
Tested-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r-- | build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java index 10e703376f0..2d3c4106517 100644 --- a/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java +++ b/build/org.eclipse.cdt.autotools.core/src/org/eclipse/cdt/internal/autotools/core/AutotoolsNewMakeGenerator.java @@ -996,10 +996,24 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator { try { CommandLauncher launcher = new CommandLauncher(); ByteArrayOutputStream out = new ByteArrayOutputStream(); + // Fix Bug 423192 - use environment variables when checking the Win OS Type using + // a shell command as the path to sh may be specified there + IEnvironmentVariable variables[] = + CCorePlugin.getDefault().getBuildEnvironmentManager().getVariables(cdesc, true); + String[] env = new String[0]; + ArrayList<String> envList = new ArrayList<String>(); + if (variables != null) { + for (int i = 0; i < variables.length; i++) { + envList.add(variables[i].getName() + + "=" + variables[i].getValue()); //$NON-NLS-1$ + } + env = (String[]) envList.toArray(new String[envList.size()]); + } + launcher.execute( new Path(SHELL_COMMAND), //$NON-NLS-1$ new String[] { "-c", "echo $OSTYPE" }, //$NON-NLS-1$ //$NON-NLS-2$ - new String[0], + env, new Path("."), //$NON-NLS-1$ new NullProgressMonitor()); if (launcher.waitAndRead(out, out) == CommandLauncher.OK) |