src/Pure/General/rsync.scala
changeset 76170 5912209b4fb6
parent 76136 1bb677cceea4
child 76616 e6c11ef4fb51
equal deleted inserted replaced
76169:a3c694039fd6 76170:5912209b4fb6
    12     ssh_port: Int = 0,
    12     ssh_port: Int = 0,
    13     ssh_control_path: String = "",
    13     ssh_control_path: String = "",
    14     archive: Boolean = true,
    14     archive: Boolean = true,
    15     protect_args: Boolean = true  // requires rsync 3.0.0, or later
    15     protect_args: Boolean = true  // requires rsync 3.0.0, or later
    16   ) {
    16   ) {
    17     require(ssh_control_path.isEmpty || ssh_control_path == Bash.string(ssh_control_path),
       
    18       "Malformed socket path: " + quote(ssh_control_path))
       
    19 
       
    20     def command: String = {
    17     def command: String = {
    21       val ssh_command =
    18       val ssh_command = SSH.client_command(port = ssh_port, control_path = ssh_control_path)
    22         "ssh" + (if (ssh_port > 0) " -p " + ssh_port else "") +
       
    23         (if (ssh_control_path.nonEmpty) " -o ControlPath=" + ssh_control_path else "")
       
    24 
       
    25       "rsync --rsh=" + Bash.string(ssh_command) +
    19       "rsync --rsh=" + Bash.string(ssh_command) +
    26         (if (archive) " --archive" else "") +
    20         (if (archive) " --archive" else "") +
    27         (if (protect_args) " --protect-args" else "")
    21         (if (protect_args) " --protect-args" else "")
    28     }
    22     }
    29   }
    23   }