Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2012-02-28 22:48:40 +0000
committerJeff Johnston2012-02-28 23:16:58 +0000
commit9bd0adf77de59cd8f686fa4e6d01a101780744cb (patch)
tree845db82c6fd5b128d41a70125bd422f4bf16f75c
parent734cd989232540586b4b8311e883c2b530e517e0 (diff)
downloadorg.eclipse.linuxtools-9bd0adf77de59cd8f686fa4e6d01a101780744cb.tar.gz
org.eclipse.linuxtools-9bd0adf77de59cd8f686fa4e6d01a101780744cb.tar.xz
org.eclipse.linuxtools-9bd0adf77de59cd8f686fa4e6d01a101780744cb.zip
Fix bug #371277 for Autotools UI
- switch to use sh -c for autotool invocation
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog6
-rw-r--r--autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java31
2 files changed, 15 insertions, 22 deletions
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog
index 48310ee8c3..4a03463cca 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-28 Jeff Johnston <jjohnstn@redhat.com>
+
+ Bug #371277
+ * src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java (..run): Use sh -c to execute
+ the autotool scripts.
+
2011-12-16 Jeff Johnston <jjohnstn@redhat.com>
* src/org/eclipse/linuxtools/internal/cdt/autotools/ui/preferences/AutoconfEditorPreferencePage.java (fACVersions): Add
diff --git a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java
index 2dd7930f56..ef93e8c092 100644
--- a/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java
+++ b/autotools/org.eclipse.linuxtools.cdt.autotools.ui/src/org/eclipse/linuxtools/internal/cdt/autotools/ui/actions/InvokeAction.java
@@ -39,7 +39,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
@@ -389,29 +388,17 @@ public abstract class InvokeAction extends AbstractTargetAction {
String[] newArgumentList;
- // Fix for bug #343905
+ // Fix for bug #343905 and bug #371277
// For Windows and Mac, we cannot run a script directly (in this case, the
// autotools are scripts). We need to run "sh -c command args where command
- // plus args is represented in a single string.
- if (Platform.getOS().equals(Platform.OS_WIN32)
- || Platform.getOS().equals(Platform.OS_MACOSX)) {
- // Neither Mac or Windows support calling scripts directly.
- StringBuffer command = new StringBuffer(strippedCommand);
- for (String arg : argumentList) {
- command.append(" " + arg);
- }
- newArgumentList = new String[] { "-c", command.toString() };
- } else {
- // Otherwise, we don't need the -c argument and can present the command
- // name and arguments as individual arguments
- if (argumentList == null)
- newArgumentList = new String[1];
- else
- newArgumentList = new String[argumentList.length + 1];
- newArgumentList[0] = strippedCommand;
- if (argumentList != null)
- System.arraycopy(argumentList, 0, newArgumentList, 1, argumentList.length);
- }
+ // plus args is represented in a single string. The same applies for
+ // some Linux shells such as dash. Using sh -c will work on all Linux
+ // POSIX-compliant shells.
+ StringBuffer command = new StringBuffer(strippedCommand);
+ for (String arg : argumentList) {
+ command.append(" " + arg);
+ }
+ newArgumentList = new String[] { "-c", command.toString() };
OutputStream stdout = consoleOutStream;
OutputStream stderr = consoleOutStream;

Back to the top