src/Pure/Tools/build.scala
changeset 67025 961285f581e6
parent 67011 bab3208d8d37
child 67026 687c822ee5e3
     1.1 --- a/src/Pure/Tools/build.scala	Tue Nov 07 15:50:36 2017 +0100
     1.2 +++ b/src/Pure/Tools/build.scala	Tue Nov 07 16:44:25 2017 +0100
     1.3 @@ -391,9 +391,9 @@
     1.4        SHA1.digest(cat_lines(digests.map(_.toString).sorted)).toString
     1.5      }
     1.6  
     1.7 -    val (selected, selected_sessions, deps) =
     1.8 +    val (selected_sessions, deps) =
     1.9      {
    1.10 -      val (selected0, selected_sessions0) =
    1.11 +      val selected_sessions0 =
    1.12          full_sessions.selection(
    1.13              Sessions.Selection(requirements, all_sessions, base_sessions, exclude_session_groups,
    1.14                exclude_sessions, session_groups, sessions) ++ selection)
    1.15 @@ -405,7 +405,7 @@
    1.16  
    1.17        if (soft_build && !fresh_build) {
    1.18          val outdated =
    1.19 -          selected0.flatMap(name =>
    1.20 +          selected_sessions0.build_topological_order.flatMap(name =>
    1.21              store.find_database(name) match {
    1.22                case Some(database) =>
    1.23                  using(SQLite.open_database(database))(store.read_build(_, name)) match {
    1.24 @@ -415,14 +415,14 @@
    1.25                  }
    1.26                case None => Some(name)
    1.27              })
    1.28 -        val (selected, selected_sessions) =
    1.29 +        val selected_sessions =
    1.30            full_sessions.selection(Sessions.Selection(sessions = outdated))
    1.31          val deps =
    1.32            Sessions.deps(selected_sessions, full_sessions.global_theories, inlined_files = true)
    1.33              .check_errors
    1.34 -        (selected, selected_sessions, deps)
    1.35 +        (selected_sessions, deps)
    1.36        }
    1.37 -      else (selected0, selected_sessions0, deps0)
    1.38 +      else (selected_sessions0, deps0)
    1.39      }
    1.40  
    1.41  
    1.42 @@ -450,7 +450,7 @@
    1.43  
    1.44      // optional cleanup
    1.45      if (clean_build) {
    1.46 -      for (name <- full_sessions.build_descendants(selected)) {
    1.47 +      for (name <- full_sessions.build_descendants(selected_sessions.build_topological_order)) {
    1.48          val files =
    1.49            List(Path.basic(name), store.database(name), store.log(name), store.log_gz(name)).
    1.50              map(store.output_dir + _).filter(_.is_file)