src/Pure/System/isabelle_system.scala
changeset 34196 c352f679dcca
parent 34195 d58da36d1a30
child 34198 ff5486262cd6
equal deleted inserted replaced
34195:d58da36d1a30 34196:c352f679dcca
    88           if (path == null || path == "") error("Unknown Isabelle home directory")
    88           if (path == null || path == "") error("Unknown Isabelle home directory")
    89           else path
    89           else path
    90         case Some(path) => path
    90         case Some(path) => path
    91       }
    91       }
    92 
    92 
    93     val dump = File.createTempFile("isabelle", null)
    93     Library.with_tmp_file("isabelle_settings") { dump =>
    94     try {
       
    95       val cmdline = shell_prefix :::
    94       val cmdline = shell_prefix :::
    96         List(isabelle_home + "/bin/isabelle", "getenv", "-d", dump.toString)
    95         List(isabelle_home + "/bin/isabelle", "getenv", "-d", dump.toString)
    97       val (output, rc) =
    96       val (output, rc) =
    98         Isabelle_System.process_output(Isabelle_System.raw_execute(env0, true, cmdline: _*))
    97         Isabelle_System.process_output(Isabelle_System.raw_execute(env0, true, cmdline: _*))
    99       if (rc != 0) error(output)
    98       if (rc != 0) error(output)
   106         }
   105         }
   107       Map(entries: _*) +
   106       Map(entries: _*) +
   108         ("HOME" -> java.lang.System.getenv("HOME")) +
   107         ("HOME" -> java.lang.System.getenv("HOME")) +
   109         ("PATH" -> java.lang.System.getenv("PATH"))
   108         ("PATH" -> java.lang.System.getenv("PATH"))
   110     }
   109     }
   111     finally { dump.delete }
       
   112   }
   110   }
   113 
   111 
   114 
   112 
   115   /* getenv */
   113   /* getenv */
   116 
   114