eliminated unused Cygwin download;
authorwenzelm
Thu, 24 May 2012 23:28:58 +0200
changeset 490120a43fc778cd2
parent 49011 25b9f59ab1b9
child 49013 969457d93f75
eliminated unused Cygwin download;
src/Pure/System/cygwin.scala
src/Pure/System/download.scala
src/Pure/build-jars
     1.1 --- a/src/Pure/System/cygwin.scala	Thu May 24 23:13:06 2012 +0200
     1.2 +++ b/src/Pure/System/cygwin.scala	Thu May 24 23:28:58 2012 +0200
     1.3 @@ -36,27 +36,5 @@
     1.4      sanity_check(new File(root))
     1.5      root
     1.6    }
     1.7 -
     1.8 -  def setup(parent: Component, root: File)
     1.9 -  {
    1.10 -    if (!root.isDirectory && !root.mkdirs) error("Failed to create root directory: " + root)
    1.11 -
    1.12 -    val download = new File(root, "download")
    1.13 -    if (!download.mkdir) error("Failed to create download directory: " + download)
    1.14 -
    1.15 -    val setup_exe = new File(root, "setup.exe")
    1.16 -
    1.17 -    try {
    1.18 -      Download.file(parent, "Downloading", new URL("http://www.cygwin.com/setup.exe"), setup_exe)
    1.19 -    }
    1.20 -    catch { case ERROR(_) => error("Failed to download Cygwin setup program") }
    1.21 -
    1.22 -    val (_, rc) = Standard_System.raw_exec(root, null, true,
    1.23 -        setup_exe.toString, "-R", root.toString, "-l", download.toString,
    1.24 -          "-P", "libgmp3,make,perl,python", "-q", "-n")
    1.25 -    if (rc != 0) error("Cygwin setup failed!")
    1.26 -
    1.27 -    sanity_check(root)
    1.28 -  }
    1.29  }
    1.30  
     2.1 --- a/src/Pure/System/download.scala	Thu May 24 23:13:06 2012 +0200
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,54 +0,0 @@
     2.4 -/*  Title:      Pure/System/download.scala
     2.5 -    Module:     PIDE
     2.6 -    Author:     Makarius
     2.7 -
     2.8 -Download URLs -- with progress monitor.
     2.9 -*/
    2.10 -
    2.11 -package isabelle
    2.12 -
    2.13 -
    2.14 -import java.io.{BufferedInputStream, BufferedOutputStream, FileOutputStream,
    2.15 -  File, InterruptedIOException}
    2.16 -import java.net.{URL, URLConnection}
    2.17 -import java.awt.{Component, HeadlessException}
    2.18 -import javax.swing.ProgressMonitorInputStream
    2.19 -
    2.20 -
    2.21 -object Download
    2.22 -{
    2.23 -  def stream(parent: Component, title: String, url: URL): (URLConnection, BufferedInputStream) =
    2.24 -  {
    2.25 -    val connection = url.openConnection
    2.26 -
    2.27 -    val stream = new ProgressMonitorInputStream(parent, title, connection.getInputStream)
    2.28 -    val monitor = stream.getProgressMonitor
    2.29 -    monitor.setNote(connection.getURL.toString)
    2.30 -
    2.31 -    val length = connection.getContentLength
    2.32 -    if (length != -1) monitor.setMaximum(length)
    2.33 -
    2.34 -    (connection, new BufferedInputStream(stream))
    2.35 -  }
    2.36 -
    2.37 -  def file(parent: Component, title: String, url: URL, file: File)
    2.38 -  {
    2.39 -    val (connection, instream) = stream(parent, title, url)
    2.40 -    val mod_time = connection.getLastModified
    2.41 -
    2.42 -    def read() =
    2.43 -      try { instream.read }
    2.44 -      catch { case _ : InterruptedIOException => error("Canceled by user") }
    2.45 -    try {
    2.46 -      val outstream = new BufferedOutputStream(new FileOutputStream(file))
    2.47 -      try {
    2.48 -        var c: Int = 0
    2.49 -        while ({ c = read(); c != -1 }) outstream.write(c)
    2.50 -      }
    2.51 -      finally { outstream.close }
    2.52 -      if (mod_time > 0) file.setLastModified(mod_time)
    2.53 -    }
    2.54 -    finally { instream.close }
    2.55 -  }
    2.56 -}
    2.57 -
     3.1 --- a/src/Pure/build-jars	Thu May 24 23:13:06 2012 +0200
     3.2 +++ b/src/Pure/build-jars	Thu May 24 23:28:58 2012 +0200
     3.3 @@ -40,7 +40,6 @@
     3.4    PIDE/xml.scala
     3.5    PIDE/yxml.scala
     3.6    System/cygwin.scala
     3.7 -  System/download.scala
     3.8    System/event_bus.scala
     3.9    System/gui_setup.scala
    3.10    System/invoke_scala.scala