Standard_System.raw_exec;
authorwenzelm
Mon Jan 04 22:43:07 2010 +0100 (2010-01-04 ago)
changeset 34258e936d3c35ce0
parent 34257 b5176fd9ab3c
child 34259 2ba492b8b6e8
Standard_System.raw_exec;
more robust root.mkdirs;
src/Pure/System/cygwin.scala
src/Pure/System/isabelle_system.scala
src/Pure/System/standard_system.scala
     1.1 --- a/src/Pure/System/cygwin.scala	Mon Jan 04 22:35:32 2010 +0100
     1.2 +++ b/src/Pure/System/cygwin.scala	Mon Jan 04 22:43:07 2010 +0100
     1.3 @@ -104,7 +104,7 @@
     1.4  
     1.5    def setup(parent: Component, root: File)
     1.6    {
     1.7 -    if (!root.mkdirs) error("Failed to create root directory: " + root)
     1.8 +    if (!root.isDirectory && !root.mkdirs) error("Failed to create root directory: " + root)
     1.9  
    1.10      val download = new File(root, "download")
    1.11      if (!download.mkdir) error("Failed to create download directory: " + download)
    1.12 @@ -114,10 +114,9 @@
    1.13      try { Download.file(parent, new URL("http://www.cygwin.com/setup.exe"), setup_exe) }
    1.14      catch { case _: RuntimeException => error("Failed to download Cygwin setup program") }
    1.15  
    1.16 -    val (_, rc) = Standard_System.process_output(
    1.17 -    	Standard_System.raw_execute(root, null, true,
    1.18 -    	  setup_exe.toString, "-R", root.toString, "-l", download.toString,
    1.19 -    	    "-P", "make,perl,python", "-q", "-n"))
    1.20 +    val (_, rc) = Standard_System.raw_exec(root, null, true,
    1.21 +        setup_exe.toString, "-R", root.toString, "-l", download.toString,
    1.22 +    	    "-P", "make,perl,python", "-q", "-n")
    1.23      if (rc != 0) error("Cygwin setup failed!")
    1.24  
    1.25      sanity_check(root)
     2.1 --- a/src/Pure/System/isabelle_system.scala	Mon Jan 04 22:35:32 2010 +0100
     2.2 +++ b/src/Pure/System/isabelle_system.scala	Mon Jan 04 22:43:07 2010 +0100
     2.3 @@ -42,8 +42,7 @@
     2.4            if (Platform.is_windows) List(platform_root + "\\bin\\bash", "-l") else Nil
     2.5          val cmdline =
     2.6            shell_prefix ::: List(isabelle_home + "/bin/isabelle", "getenv", "-d", dump.toString)
     2.7 -        val (output, rc) =
     2.8 -          Standard_System.process_output(Standard_System.raw_execute(null, env0, true, cmdline: _*))
     2.9 +        val (output, rc) = Standard_System.raw_exec(null, env0, true, cmdline: _*)
    2.10          if (rc != 0) error(output)
    2.11  
    2.12          val entries =
     3.1 --- a/src/Pure/System/standard_system.scala	Mon Jan 04 22:35:32 2010 +0100
     3.2 +++ b/src/Pure/System/standard_system.scala	Mon Jan 04 22:43:07 2010 +0100
     3.3 @@ -132,6 +132,9 @@
     3.4        }
     3.5      (output, rc)
     3.6    }
     3.7 +
     3.8 +  def raw_exec(cwd: File, env: Map[String, String], redirect: Boolean, args: String*):
     3.9 +    (String, Int) = process_output(raw_execute(cwd, env, redirect, args: _*))
    3.10  }
    3.11  
    3.12