src/Pure/System/cygwin.scala
changeset 34258 e936d3c35ce0
parent 34256 da6573639ca1
child 36194 8e61560ded89
equal deleted inserted replaced
34257:b5176fd9ab3c 34258:e936d3c35ce0
   102     root
   102     root
   103   }
   103   }
   104 
   104 
   105   def setup(parent: Component, root: File)
   105   def setup(parent: Component, root: File)
   106   {
   106   {
   107     if (!root.mkdirs) error("Failed to create root directory: " + root)
   107     if (!root.isDirectory && !root.mkdirs) error("Failed to create root directory: " + root)
   108 
   108 
   109     val download = new File(root, "download")
   109     val download = new File(root, "download")
   110     if (!download.mkdir) error("Failed to create download directory: " + download)
   110     if (!download.mkdir) error("Failed to create download directory: " + download)
   111 
   111 
   112     val setup_exe = new File(root, "setup.exe")
   112     val setup_exe = new File(root, "setup.exe")
   113 
   113 
   114     try { Download.file(parent, new URL("http://www.cygwin.com/setup.exe"), setup_exe) }
   114     try { Download.file(parent, new URL("http://www.cygwin.com/setup.exe"), setup_exe) }
   115     catch { case _: RuntimeException => error("Failed to download Cygwin setup program") }
   115     catch { case _: RuntimeException => error("Failed to download Cygwin setup program") }
   116 
   116 
   117     val (_, rc) = Standard_System.process_output(
   117     val (_, rc) = Standard_System.raw_exec(root, null, true,
   118     	Standard_System.raw_execute(root, null, true,
   118         setup_exe.toString, "-R", root.toString, "-l", download.toString,
   119     	  setup_exe.toString, "-R", root.toString, "-l", download.toString,
   119     	    "-P", "make,perl,python", "-q", "-n")
   120     	    "-P", "make,perl,python", "-q", "-n"))
       
   121     if (rc != 0) error("Cygwin setup failed!")
   120     if (rc != 0) error("Cygwin setup failed!")
   122 
   121 
   123     sanity_check(root)
   122     sanity_check(root)
   124   }
   123   }
   125 }
   124 }