[Laszlo-checkins] r10473 - openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc
dda@openlaszlo.org
dda at openlaszlo.org
Fri Jul 25 05:57:22 PDT 2008
Author: dda
Date: 2008-07-25 05:57:15 -0700 (Fri, 25 Jul 2008)
New Revision: 10473
Modified:
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
Log:
Change 20080724-dda-z by dda at lester.local on 2008-07-24 21:55:54 EDT
in /Users/dda/laszlo/src/svn/openlaszlo/trunk-a
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Add more environment variables for invoking external compiler
New Features:
Bugs Fixed:
Technical Reviewer: hminsky (pending)
QA Reviewer: mamye (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
When execing an external process, make sure HOME and PATH are copied
to the new environment, as well as FLEX_HOME.
Not sure if this will help our troubles, but possibly some
systems will be confused without HOME/PATH set.
Tests:
Ran SWF9 hello on my machine for regression.
Need Mamye to try on machines that currently have problems.
Modified: openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java 2008-07-25 08:30:05 UTC (rev 10472)
+++ openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9External.java 2008-07-25 12:57:15 UTC (rev 10473)
@@ -426,6 +426,16 @@
}
/**
+ * Copy an environment variable from the current system environment.
+ */
+ public static void copyEnvVar(List envvars, String varname) {
+ String val = System.getenv(varname);
+ if (val != null) {
+ envvars.add(varname + "=" + val);
+ }
+ }
+
+ /**
* Run the compiler using the command/arguments in cmd.
* Collect and report any errors, and check for the existence
* of the output file.
@@ -449,9 +459,11 @@
buildsh += prettycmd + "\n";
Compiler.emitFile(workDirectoryName("build.sh"), buildsh);
- String flexhome_env[] = {"FLEX_HOME="+FLEX_HOME()};
-
- Process proc = Runtime.getRuntime().exec(cmdstr, flexhome_env, null);
+ List newenv = new ArrayList();
+ newenv.add("FLEX_HOME="+FLEX_HOME());
+ copyEnvVar(newenv, "HOME");
+ copyEnvVar(newenv, "PATH");
+ Process proc = Runtime.getRuntime().exec(cmdstr, (String[])newenv.toArray(new String[0]), null);
try {
OutputStream os = proc.getOutputStream();
OutputCollector outcollect = new OutputCollector(proc.getInputStream());
More information about the Laszlo-checkins
mailing list