src/Pure/System/standard_system.scala
changeset 39709 1fa4c5c7d534
parent 39708 c3239be617f4
child 39732 4dbc72759706
     1.1 --- a/src/Pure/System/standard_system.scala	Mon Sep 27 13:38:35 2010 +0200
     1.2 +++ b/src/Pure/System/standard_system.scala	Mon Sep 27 14:34:55 2010 +0200
     1.3 @@ -160,7 +160,7 @@
     1.4    /* unpack tar archive */
     1.5  
     1.6    def posix_untar(url: URL, root: File, gunzip: Boolean = false,
     1.7 -    tar: String = "tar", progress: Int => Unit = _ => ()): String =
     1.8 +    tar: String = "tar", gzip: String = "", progress: Int => Unit = _ => ()): String =
     1.9    {
    1.10      if (!root.isDirectory && !root.mkdirs)
    1.11        error("Failed to create root directory: " + root)
    1.12 @@ -189,7 +189,11 @@
    1.13        override def close() { stream.close }
    1.14      }
    1.15  
    1.16 -    val proc = raw_execute(root, null, false, tar, if (gunzip) "-xz" else "-x", "-f-")
    1.17 +    val cmdline =
    1.18 +      List(tar, "-o", "-x", "-f-") :::
    1.19 +        (if (!gunzip) Nil else if (gzip == "") List("-z") else List("-I", gzip))
    1.20 +
    1.21 +    val proc = raw_execute(root, null, false, cmdline:_*)
    1.22      val stdout = Simple_Thread.future("tar_stdout") { slurp(proc.getInputStream) }
    1.23      val stderr = Simple_Thread.future("tar_stderr") { slurp(proc.getErrorStream) }
    1.24      val stdin = new BufferedOutputStream(proc.getOutputStream)