tuned signature;
authorwenzelm
Wed, 21 Jun 2023 11:15:04 +0200
changeset 78185 26b9b40ec1af
parent 78184 4309bcc8f28b
child 78186 721c118f7001
tuned signature;
src/Pure/Thy/store.scala
src/Pure/Tools/build_process.scala
--- a/src/Pure/Thy/store.scala	Wed Jun 21 11:05:20 2023 +0200
+++ b/src/Pure/Thy/store.scala	Wed Jun 21 11:15:04 2023 +0200
@@ -299,7 +299,7 @@
 
   def prepare_output(): Unit = Isabelle_System.make_directory(output_dir + Path.basic("log"))
 
-  def clean_output(name: String): Option[Boolean] = {
+  def clean_output(name: String, init: Boolean = false): Option[Boolean] = {
     val relevant_db =
       build_database_server &&
         using_option(try_open_database(name))(init_session_info(_, name)).getOrElse(false)
@@ -312,12 +312,9 @@
         path = dir + file if path.is_file
       } yield path.file.delete
 
-    if (relevant_db || del.nonEmpty) Some(del.forall(identity)) else None
-  }
+    if (init) using(open_database(name, output = true))(init_session_info(_, name))
 
-  def init_output(name: String): Unit = {
-    clean_output(name)
-    using(open_database(name, output = true))(init_session_info(_, name))
+    if (relevant_db || del.nonEmpty) Some(del.forall(identity)) else None
   }
 
   def check_output(
--- a/src/Pure/Tools/build_process.scala	Wed Jun 21 11:05:20 2023 +0200
+++ b/src/Pure/Tools/build_process.scala	Wed Jun 21 11:15:04 2023 +0200
@@ -939,7 +939,7 @@
         (if (store_heap) "Building " else "Running ") + session_name +
           if_proper(node_info.numa_node, " on " + node_info) + " ...")
 
-      store.init_output(session_name)
+      store.clean_output(session_name, init = true)
 
       val build =
         Build_Job.start_session(build_context, progress, log,