269 var list =
new Gee.ArrayList<
FileItem>();
271 string log_file = log_file_path;
272 DataOutputStream dos_changes =
null;
274 if (!log_file.has_suffix(
"-changes")){
276 string log_file_changes = log_file_path +
"-changes";
280 log_file = log_file_changes;
285 var file = File.new_for_path(log_file_changes);
286 if (file.query_exists()){
289 var file_stream = file.create (FileCreateFlags.REPLACE_DESTINATION);
290 dos_changes =
new DataOutputStream (file_stream);
299 log_debug(
"log_file = %s".printf(log_file));
306 var file = File.new_for_path(log_file);
307 if (!file.query_exists ()) {
308 log_error(
_(
"File not found") +
": %s".printf(log_file));
312 var dis =
new DataInputStream (file.read());
314 string item_path =
"";
315 string item_disk_path =
"";
316 string item_status =
"";
320 while ((line = dis.read_line(
null)) !=
null) {
324 if (line.strip().length == 0) {
continue; }
332 if (dos_changes !=
null){
333 dos_changes.put_string(
"%s\n".printf(line));
338 item_path = match.fetch(3).split(
" -> ")[0].strip();
346 item_status =
"created";
353 if (dos_changes !=
null){
354 dos_changes.put_string(
"%s\n".printf(line));
357 item_path = match.fetch(1).split(
" -> ")[0].strip();
359 item_status =
"deleted";
366 if (dos_changes !=
null){
367 dos_changes.put_string(
"%s\n".printf(line));
370 item_path = match.fetch(12).split(
" -> ")[0].strip();
379 if (match.fetch(3) ==
"c"){
380 item_status =
"checksum";
382 else if (match.fetch(4) ==
"s"){
383 item_status =
"size";
385 else if (match.fetch(5) ==
"t"){
386 item_status =
"timestamp";
388 else if (match.fetch(6) ==
"p"){
389 item_status =
"permissions";
391 else if (match.fetch(7) ==
"o"){
392 item_status =
"owner";
394 else if (match.fetch(8) ==
"g"){
395 item_status =
"group";
402 log_debug(
"not-matched: %s".printf(line));
405 if ((item_path.length > 0) && (item_path !=
"/./") && (item_path !=
"./")){
407 item_disk_path =
path_combine(item_basepath, item_path);
410 item.file_status = item_status;
420 if (dos_changes !=
null){
422 log_msg(
"Archiving: %s".printf(log_file_path));
426 log_debug(
"RsyncTask: parse_log(): exit");
442 if ((line ==
null) || (line.length == 0)) {
468 status_line = match.fetch(3).split(
" -> ")[0].strip();
469 log.append(line +
"\n");
476 status_line = match.fetch(1).split(
" -> ")[0].strip();
477 log.append(line +
"\n");
484 status_line = match.fetch(3).split(
" -> ")[0].strip();
491 status_line = match.fetch(12).split(
" -> ")[0].strip();
492 log.append(line +
"\n");
494 if (match.fetch(3) ==
"c"){
497 else if (match.fetch(4) ==
"s"){
500 else if (match.fetch(5) ==
"t"){
503 else if (match.fetch(6) ==
"p"){
506 else if (match.fetch(7) ==
"o"){
509 else if (match.fetch(8) ==
"g"){
517 total_size = int64.parse(match.fetch(1).replace(
",",
""));