# HG changeset patch # User wenzelm # Date 1337894938 -7200 # Node ID 0a43fc778cd25d18281d5ba12d84b48032340561 # Parent 25b9f59ab1b9ecddecd4dd456bb9b0307d487fb3 eliminated unused Cygwin download; diff -r 25b9f59ab1b9 -r 0a43fc778cd2 src/Pure/System/cygwin.scala --- a/src/Pure/System/cygwin.scala Thu May 24 23:13:06 2012 +0200 +++ b/src/Pure/System/cygwin.scala Thu May 24 23:28:58 2012 +0200 @@ -36,27 +36,5 @@ sanity_check(new File(root)) root } - - def setup(parent: Component, root: File) - { - if (!root.isDirectory && !root.mkdirs) error("Failed to create root directory: " + root) - - val download = new File(root, "download") - if (!download.mkdir) error("Failed to create download directory: " + download) - - val setup_exe = new File(root, "setup.exe") - - try { - Download.file(parent, "Downloading", new URL("http://www.cygwin.com/setup.exe"), setup_exe) - } - catch { case ERROR(_) => error("Failed to download Cygwin setup program") } - - val (_, rc) = Standard_System.raw_exec(root, null, true, - setup_exe.toString, "-R", root.toString, "-l", download.toString, - "-P", "libgmp3,make,perl,python", "-q", "-n") - if (rc != 0) error("Cygwin setup failed!") - - sanity_check(root) - } } diff -r 25b9f59ab1b9 -r 0a43fc778cd2 src/Pure/System/download.scala --- a/src/Pure/System/download.scala Thu May 24 23:13:06 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/* Title: Pure/System/download.scala - Module: PIDE - Author: Makarius - -Download URLs -- with progress monitor. -*/ - -package isabelle - - -import java.io.{BufferedInputStream, BufferedOutputStream, FileOutputStream, - File, InterruptedIOException} -import java.net.{URL, URLConnection} -import java.awt.{Component, HeadlessException} -import javax.swing.ProgressMonitorInputStream - - -object Download -{ - def stream(parent: Component, title: String, url: URL): (URLConnection, BufferedInputStream) = - { - val connection = url.openConnection - - val stream = new ProgressMonitorInputStream(parent, title, connection.getInputStream) - val monitor = stream.getProgressMonitor - monitor.setNote(connection.getURL.toString) - - val length = connection.getContentLength - if (length != -1) monitor.setMaximum(length) - - (connection, new BufferedInputStream(stream)) - } - - def file(parent: Component, title: String, url: URL, file: File) - { - val (connection, instream) = stream(parent, title, url) - val mod_time = connection.getLastModified - - def read() = - try { instream.read } - catch { case _ : InterruptedIOException => error("Canceled by user") } - try { - val outstream = new BufferedOutputStream(new FileOutputStream(file)) - try { - var c: Int = 0 - while ({ c = read(); c != -1 }) outstream.write(c) - } - finally { outstream.close } - if (mod_time > 0) file.setLastModified(mod_time) - } - finally { instream.close } - } -} - diff -r 25b9f59ab1b9 -r 0a43fc778cd2 src/Pure/build-jars --- a/src/Pure/build-jars Thu May 24 23:13:06 2012 +0200 +++ b/src/Pure/build-jars Thu May 24 23:28:58 2012 +0200 @@ -40,7 +40,6 @@ PIDE/xml.scala PIDE/yxml.scala System/cygwin.scala - System/download.scala System/event_bus.scala System/gui_setup.scala System/invoke_scala.scala