src/Pure/System/isabelle_system.scala
changeset 75468 a1c7829ac2de
parent 75439 e1c9e4d59921
child 75471 63f904ae4134
equal deleted inserted replaced
75466:5f2a1efd0560 75468:a1c7829ac2de
   418 
   418 
   419     if (gnutar_check) bash("tar " + options + args, redirect = redirect)
   419     if (gnutar_check) bash("tar " + options + args, redirect = redirect)
   420     else error("Expected to find GNU tar executable")
   420     else error("Expected to find GNU tar executable")
   421   }
   421   }
   422 
   422 
       
   423   def rsync(
       
   424     cwd: JFile = null,
       
   425     progress: Progress = new Progress,
       
   426     echo: Boolean = false,
       
   427     verbose: Boolean = false,
       
   428     dry_run: Boolean = false,
       
   429     purge: Boolean = false,
       
   430     args: List[String] = Nil
       
   431   ): Process_Result = {
       
   432     val script =
       
   433       "rsync --protect-args --archive" +
       
   434         (if (verbose) " --verbose" else "") +
       
   435         (if (dry_run) " --dry-run" else "") +
       
   436         (if (purge) " --delete-excluded" else "") +
       
   437         (if (args.nonEmpty) " " + Bash.strings(args) else "")
       
   438     progress.bash(script, cwd = cwd, echo = echo || verbose)
       
   439   }
       
   440 
   423   def make_patch(base_dir: Path, src: Path, dst: Path, diff_options: String = ""): String = {
   441   def make_patch(base_dir: Path, src: Path, dst: Path, diff_options: String = ""): String = {
   424     with_tmp_file("patch") { patch =>
   442     with_tmp_file("patch") { patch =>
   425       Isabelle_System.bash(
   443       Isabelle_System.bash(
   426         "diff -ru " + diff_options + " -- " + File.bash_path(src) + " " + File.bash_path(dst) +
   444         "diff -ru " + diff_options + " -- " + File.bash_path(src) + " " + File.bash_path(dst) +
   427           " > " + File.bash_path(patch),
   445           " > " + File.bash_path(patch),