src/Pure/Admin/build_jdk.scala
changeset 69186 573b7fbd96a8
parent 69128 016715f1c107
child 69277 258bef08b31e
--- a/src/Pure/Admin/build_jdk.scala	Thu Oct 25 15:41:40 2018 +0200
+++ b/src/Pure/Admin/build_jdk.scala	Thu Oct 25 17:08:04 2018 +0200
@@ -7,6 +7,7 @@
 package isabelle
 
 
+import java.io.{File => JFile}
 import java.nio.file.Files
 import java.nio.file.attribute.PosixFilePermission
 
@@ -19,7 +20,7 @@
 
   def detect_version(s: String): String =
   {
-    val Version_Dir_Entry = """^jdk-(\d+)(?:\.jdk)?$""".r
+    val Version_Dir_Entry = """^jdk-(\d+\+\d+)$""".r
     s match {
       case Version_Dir_Entry(version) => version
       case _ => error("Cannot detect JDK version from " + quote(s))
@@ -56,7 +57,7 @@
   def readme(version: String): String =
 """This is OpenJDK """ + version + """ as required for Isabelle.
 
-See http://jdk.java.net for the original downloads, which are covered
+See https://adoptopenjdk.net for the original downloads, which are covered
 the GPL2 (with various liberal exceptions, see legal/*).
 
 Linux, Windows, Mac OS X all work uniformly, depending on certain
@@ -88,6 +89,8 @@
 
   /* extract archive */
 
+  private def suppress_name(name: String): Boolean = name.startsWith("._")
+
   def extract_archive(dir: Path, archive: Path): (String, JDK_Platform) =
   {
     try {
@@ -104,7 +107,7 @@
       }
 
       val dir_entry =
-        File.read_dir(tmp_dir) match {
+        File.read_dir(tmp_dir).filterNot(suppress_name(_)) match {
           case List(s) => s
           case _ => error("Archive contains multiple directories")
         }
@@ -183,7 +186,7 @@
         }
 
         File.find_files((component_dir + Path.explode("x86_64-darwin")).file,
-          file => file.getName.startsWith("._")).foreach(_.delete)
+          file => suppress_name(file.getName)).foreach(_.delete)
 
         progress.echo("Sharing ...")
         val main_dir :: other_dirs =