more robust handling of PATH vs PATH_JVM -- required for cold start of Cygwin from Windows (e.g. Isabelle.exe);
authorwenzelm
Sun Apr 22 19:04:30 2012 +0200 (2012-04-22)
changeset 47674cdf95042e09c
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
     1.1 --- a/lib/Tools/getenv	Sun Apr 22 16:33:41 2012 +0200
     1.2 +++ b/lib/Tools/getenv	Sun Apr 22 19:04:30 2012 +0200
     1.3 @@ -76,6 +76,7 @@
     1.4  fi
     1.5  
     1.6  if [ -n "$DUMP" ]; then
     1.7 +  export PATH_JVM="$(jvmpath "$PATH")"
     1.8    exec perl -w -e 'for $key (keys %ENV) { print $key, "=", $ENV{$key}, "\x00"; }' > "$DUMP"
     1.9  fi
    1.10  
     3.1 --- a/src/Pure/System/isabelle_system.scala	Sun Apr 22 16:33:41 2012 +0200
     3.2 +++ b/src/Pure/System/isabelle_system.scala	Sun Apr 22 19:04:30 2012 +0200
     3.3 @@ -74,12 +74,12 @@
     3.4                if (rc != 0) error(output)
     3.5  
     3.6                val entries =
     3.7 -                for (entry <- Source.fromFile(dump).mkString split "\0" if entry != "") yield {
     3.8 +                (for (entry <- Source.fromFile(dump).mkString split "\0" if entry != "") yield {
     3.9                    val i = entry.indexOf('=')
    3.10                    if (i <= 0) (entry -> "")
    3.11                    else (entry.substring(0, i) -> entry.substring(i + 1))
    3.12 -                }
    3.13 -              Map(entries: _*) + ("PATH" -> System.getenv("PATH"))
    3.14 +                }).toMap
    3.15 +              entries + ("PATH" -> entries("PATH_JVM")) - "PATH_JVM"
    3.16              }
    3.17            }
    3.18        _state = Some(State(standard_system, settings))