equal
deleted
inserted
replaced
431 |
431 |
432 if (gnutar_check) bash("tar " + options + args, redirect = redirect) |
432 if (gnutar_check) bash("tar " + options + args, redirect = redirect) |
433 else error("Expected to find GNU tar executable") |
433 else error("Expected to find GNU tar executable") |
434 } |
434 } |
435 |
435 |
|
436 def extract(archive: Path, dir: Path): Unit = |
|
437 archive.get_ext match { |
|
438 case "zip" => |
|
439 Isabelle_System.bash("unzip -x " + File.bash_path(archive.absolute), cwd = dir.file).check |
|
440 case "tar.gz" | "tgz" => |
|
441 Isabelle_System.gnutar("-xzf " + File.bash_path(archive), dir = dir).check |
|
442 case _ => error("Cannot extract " + archive) |
|
443 } |
|
444 |
436 def make_patch(base_dir: Path, src: Path, dst: Path, diff_options: String = ""): String = { |
445 def make_patch(base_dir: Path, src: Path, dst: Path, diff_options: String = ""): String = { |
437 with_tmp_file("patch") { patch => |
446 with_tmp_file("patch") { patch => |
438 Isabelle_System.bash( |
447 Isabelle_System.bash( |
439 "diff -ru " + diff_options + " -- " + File.bash_path(src) + " " + File.bash_path(dst) + |
448 "diff -ru " + diff_options + " -- " + File.bash_path(src) + " " + File.bash_path(dst) + |
440 " > " + File.bash_path(patch), |
449 " > " + File.bash_path(patch), |