diff options
author | Wayne Davison <wayned@samba.org> | 2008-09-26 21:55:44 -0700 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2008-09-26 22:14:01 -0700 |
commit | e366e5303fa25e3d007691109293901ad7a7b6f6 (patch) | |
tree | 7022a9ddfe837ca09e2ae57c3e42b598ca818865 /receiver.c | |
parent | 0a23e33630d96f6083b40bc98d7a12d7ad7632f6 (diff) | |
download | rsync-e366e5303fa25e3d007691109293901ad7a7b6f6.tar.gz rsync-e366e5303fa25e3d007691109293901ad7a7b6f6.tar.bz2 rsync-e366e5303fa25e3d007691109293901ad7a7b6f6.zip |
Enhanced the --stats output:
- Mention how many files were created (protocol >= 29).
- Mention how many files were deleted (new in protocol 31).
- Follow the file-count, created-count, and deleted-count
with a break-out list of each count by type.
Diffstat (limited to 'receiver.c')
-rw-r--r-- | receiver.c | 24 |
1 files changed, 23 insertions, 1 deletions
@@ -487,6 +487,21 @@ int recv_files(int f_in, char *local_name) if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && !dry_run) set_file_attrs(fname, file, NULL, fname, 0); #endif + if (iflags & ITEM_IS_NEW) { + stats.created_files++; + if (S_ISREG(file->mode)) { + /* Nothing further to count. */ + } else if (S_ISDIR(file->mode)) + stats.created_dirs++; +#ifdef SUPPORT_LINKS + else if (S_ISLNK(file->mode)) + stats.created_symlinks++; +#endif + else if (IS_DEVICE(file->mode)) + stats.created_devices++; + else + stats.created_specials++; + } continue; } if (phase == 2) { @@ -516,11 +531,13 @@ int recv_files(int f_in, char *local_name) csum_length = SHORT_SUM_LENGTH; redoing = 0; } + if (iflags & ITEM_IS_NEW) + stats.created_files++; } if (!am_server && INFO_GTE(PROGRESS, 1)) set_current_file_index(file, ndx); - stats.num_transferred_files++; + stats.xferred_files++; stats.total_transferred_size += F_LENGTH(file); cleanup_got_literal = 0; @@ -808,6 +825,11 @@ int recv_files(int f_in, char *local_name) if (phase == 2 && delay_updates) /* for protocol_version < 29 */ handle_delayed_updates(local_name); + if (read_batch) { + read_int(batch_gen_fd); /* Discard -1 */ + read_del_stats(batch_gen_fd); + } + if (DEBUG_GTE(RECV, 1)) rprintf(FINFO,"recv_files finished\n"); |