src/Pure/System/isabelle_system.scala
changeset 64935 9437a117408b
parent 64657 6209e0f7a4e8
child 65083 9a0e34edfad1
--- a/src/Pure/System/isabelle_system.scala	Sun Jan 22 15:02:06 2017 +0100
+++ b/src/Pure/System/isabelle_system.scala	Sun Jan 22 16:15:08 2017 +0100
@@ -302,6 +302,16 @@
       result(progress_stdout, progress_stderr, progress_limit, strict)
   }
 
+  private lazy val gnutar_check: Boolean =
+    try { bash("tar --version").check.out.containsSlice("GNU tar") || error("") }
+    catch { case ERROR(_) => false }
+
+  def gnutar(args: String, cwd: JFile = null, redirect: Boolean = false): Process_Result =
+  {
+    if (gnutar_check) bash("tar " + args, cwd = cwd, redirect = redirect)
+    else error("Expected to find GNU tar executable")
+  }
+
   def hostname(): String = bash("hostname -s").check.out
 
   def open(arg: String): Unit =