clarified signature;
authorwenzelm
Thu, 12 Aug 2021 13:55:45 +0200
changeset 74146 dd1639961016
parent 74145 608f8ae89cac
child 74147 d030b988d470
clarified signature;
src/Pure/System/isabelle_system.scala
--- a/src/Pure/System/isabelle_system.scala	Thu Aug 12 13:19:56 2021 +0200
+++ b/src/Pure/System/isabelle_system.scala	Thu Aug 12 13:55:45 2021 +0200
@@ -7,7 +7,7 @@
 package isabelle
 
 
-import java.util.{Map => JMap}
+import java.util.{Map => JMap, HashMap}
 import java.io.{File => JFile, IOException}
 import java.nio.file.{Path => JPath, Files, SimpleFileVisitor, FileVisitResult,
   StandardCopyOption, FileSystemException}
@@ -20,7 +20,16 @@
 {
   /* settings */
 
-  def settings(): JMap[String, String] = isabelle.setup.Environment.settings()
+  def settings(putenv: List[(String, String)] = Nil): JMap[String, String] =
+  {
+    val env0 = isabelle.setup.Environment.settings()
+    if (putenv.isEmpty) env0
+    else {
+      val env = new HashMap(env0)
+      for ((a, b) <- putenv) env.put(a, b)
+      env
+    }
+  }
 
   def getenv(name: String, env: JMap[String, String] = settings()): String =
     Option(env.get(name)).getOrElse("")