more robust handling of PATH vs PATH_JVM -- required for cold start of Cygwin from Windows (e.g. Isabelle.exe);
authorwenzelm
Sun, 22 Apr 2012 19:04:30 +0200
changeset 47674 cdf95042e09c
parent 47673 dd253cfa5b23
child 47678 c04b223d661e
more robust handling of PATH vs PATH_JVM -- required for cold start of Cygwin from Windows (e.g. Isabelle.exe);
lib/Tools/getenv
lib/scripts/getsettings
src/Pure/System/isabelle_system.scala
--- a/lib/Tools/getenv	Sun Apr 22 16:33:41 2012 +0200
+++ b/lib/Tools/getenv	Sun Apr 22 19:04:30 2012 +0200
@@ -76,6 +76,7 @@
 fi
 
 if [ -n "$DUMP" ]; then
+  export PATH_JVM="$(jvmpath "$PATH")"
   exec perl -w -e 'for $key (keys %ENV) { print $key, "=", $ENV{$key}, "\x00"; }' > "$DUMP"
 fi
 
--- a/src/Pure/System/isabelle_system.scala	Sun Apr 22 16:33:41 2012 +0200
+++ b/src/Pure/System/isabelle_system.scala	Sun Apr 22 19:04:30 2012 +0200
@@ -74,12 +74,12 @@
               if (rc != 0) error(output)
 
               val entries =
-                for (entry <- Source.fromFile(dump).mkString split "\0" if entry != "") yield {
+                (for (entry <- Source.fromFile(dump).mkString split "\0" if entry != "") yield {
                   val i = entry.indexOf('=')
                   if (i <= 0) (entry -> "")
                   else (entry.substring(0, i) -> entry.substring(i + 1))
-                }
-              Map(entries: _*) + ("PATH" -> System.getenv("PATH"))
+                }).toMap
+              entries + ("PATH" -> entries("PATH_JVM")) - "PATH_JVM"
             }
           }
       _state = Some(State(standard_system, settings))