From b78296cb0b14777a318635d0608a9bb55ac6ff0d Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 15 Feb 2005 07:41:13 +0000 Subject: [PATCH] Decided on a better option name --itemize-changes (-i). --- generator.c | 20 ++++++++++---------- main.c | 4 ++-- options.c | 14 +++++++------- receiver.c | 6 +++--- rsync.yo | 18 +++++++++--------- sender.c | 6 +++--- 6 files changed, 34 insertions(+), 34 deletions(-) diff --git a/generator.c b/generator.c index 1777ef22..aecf892f 100644 --- a/generator.c +++ b/generator.c @@ -25,7 +25,7 @@ extern int verbose; extern int dry_run; -extern int what_has_changed; +extern int itemize_changes; extern int relative_paths; extern int keep_dirlinks; extern int preserve_links; @@ -447,7 +447,7 @@ static void recv_generator(char *fname, struct file_list *flist, missing_below = file->dir.depth; dry_run++; } - if (what_has_changed && f_out != -1) + if (itemize_changes && f_out != -1) showchg(fname, file, statret, &st, 0); if (statret != 0 && do_mkdir(fname,file->mode) != 0 && errno != EEXIST) { if (!relative_paths || errno != ENOENT @@ -459,7 +459,7 @@ static void recv_generator(char *fname, struct file_list *flist, } } if (set_perms(fname, file, statret ? NULL : &st, 0) - && verbose && f_out != -1 && !what_has_changed) + && verbose && f_out != -1 && !itemize_changes) rprintf(FINFO, "%s/\n", safe_fname(fname)); if (delete_during && f_out != -1 && csum_length != SUM_LENGTH && (file->flags & FLAG_DEL_HERE)) @@ -498,7 +498,7 @@ static void recv_generator(char *fname, struct file_list *flist, * right place -- no further action * required. */ if (strcmp(lnk, file->u.link) == 0) { - if (what_has_changed) + if (itemize_changes) showchg(fname, file, 0, &st, 0); set_perms(fname, file, &st, PERMS_REPORT); @@ -514,14 +514,14 @@ static void recv_generator(char *fname, struct file_list *flist, full_fname(fname), safe_fname(file->u.link)); } else { set_perms(fname,file,NULL,0); - if (what_has_changed) { + if (itemize_changes) { showchg(fname, file, statret, &st, SC_SYMLINK_CHANGED | (verbose ? SC_NO_NL : 0)); } if (verbose) { rprintf(FINFO, "%s -> %s\n", - what_has_changed ? "" : safe_fname(fname), + itemize_changes ? "" : safe_fname(fname), safe_fname(file->u.link)); } } @@ -530,7 +530,7 @@ static void recv_generator(char *fname, struct file_list *flist, } if (am_root && preserve_devices && IS_DEVICE(file->mode)) { - if (what_has_changed) + if (itemize_changes) showchg(fname, file, statret, &st, 0); if (statret != 0 || st.st_mode != file->mode || @@ -547,7 +547,7 @@ static void recv_generator(char *fname, struct file_list *flist, full_fname(fname)); } else { set_perms(fname,file,NULL,0); - if (verbose && !what_has_changed) { + if (verbose && !itemize_changes) { rprintf(FINFO, "%s\n", safe_fname(fname)); } @@ -690,7 +690,7 @@ static void recv_generator(char *fname, struct file_list *flist, else if (fnamecmp_type == FNAMECMP_FUZZY) ; else if (unchanged_file(fnamecmp, file, &st)) { - if (what_has_changed) { + if (itemize_changes) { showchg(fname, file, statret, &st, fnamecmp_type == FNAMECMP_FNAME ? 0 : SC_NO_BASIS); @@ -793,7 +793,7 @@ notify_others: write_buf(f_out_name, fuzzy_file->basename, len); } } - if (what_has_changed) { + if (itemize_changes) { showchg(fname, file, statret, &st, (always_checksum ? SC_CHECKSUM_CHANGED : 0) | SC_SENDING_FILE); diff --git a/main.c b/main.c index 46d4f69f..4855a888 100644 --- a/main.c +++ b/main.c @@ -30,7 +30,7 @@ extern int am_sender; extern int am_generator; extern int am_daemon; extern int verbose; -extern int what_has_changed; +extern int itemize_changes; extern int blocking_io; extern int delete_before; extern int daemon_over_rsh; @@ -1174,7 +1174,7 @@ int main(int argc,char *argv[]) exit_cleanup(RERR_SYNTAX); } - if (dry_run && !verbose && !what_has_changed) + if (dry_run && !verbose && !itemize_changes) verbose = 1; if (am_server) { diff --git a/options.c b/options.c index efba0928..835ed7e7 100644 --- a/options.c +++ b/options.c @@ -141,7 +141,7 @@ int basis_dir_cnt = 0; int verbose = 0; int quiet = 0; -int what_has_changed = 0; +int itemize_changes = 0; int always_checksum = 0; int list_only = 0; @@ -326,7 +326,7 @@ void usage(enum logcode F) rprintf(F," --stats give some file-transfer stats\n"); rprintf(F," --progress show progress during transfer\n"); rprintf(F," -P same as --partial --progress\n"); - rprintf(F," -w, --what-has-changed output a change summary for all updates\n"); + rprintf(F," -i, --itemize-changes output a change-summary for all updates\n"); rprintf(F," --log-format=FORMAT log file-transfers using specified format\n"); rprintf(F," --password-file=FILE read password from FILE\n"); rprintf(F," --list-only list the files instead of copying them\n"); @@ -389,7 +389,7 @@ static struct poptOption long_options[] = { {"keep-dirlinks", 'K', POPT_ARG_NONE, &keep_dirlinks, 0, 0, 0 }, {"whole-file", 'W', POPT_ARG_VAL, &whole_file, 1, 0, 0 }, {"no-whole-file", 0, POPT_ARG_VAL, &whole_file, 0, 0, 0 }, - {"copy-unsafe-links", 0, POPT_ARG_NONE, ©_unsafe_links, 0, 0, 0 }, + {"copy-unsafe-links",0, POPT_ARG_NONE, ©_unsafe_links, 0, 0, 0 }, {"perms", 'p', POPT_ARG_NONE, &preserve_perms, 0, 0, 0 }, {"owner", 'o', POPT_ARG_NONE, &preserve_uid, 0, 0, 0 }, {"group", 'g', POPT_ARG_NONE, &preserve_gid, 0, 0, 0 }, @@ -430,7 +430,7 @@ static struct poptOption long_options[] = { {0, 'P', POPT_ARG_NONE, 0, 'P', 0, 0 }, {"port", 0, POPT_ARG_INT, &rsync_port, 0, 0, 0 }, {"log-format", 0, POPT_ARG_STRING, &log_format, 0, 0, 0 }, - {"what-has-changed",'w', POPT_ARG_NONE, &what_has_changed, 0, 0, 0 }, + {"itemize-changes", 'i', POPT_ARG_NONE, &itemize_changes, 0, 0, 0 }, {"bwlimit", 0, POPT_ARG_INT, &bwlimit, 0, 0, 0 }, {"backup-dir", 0, POPT_ARG_STRING, &backup_dir, 0, 0, 0 }, {"hard-links", 'H', POPT_ARG_NONE, &preserve_hard_links, 0, 0, 0 }, @@ -1050,7 +1050,7 @@ int parse_arguments(int *argc, const char ***argv, int frommain) return 0; } - if (do_progress && !verbose && !what_has_changed) { + if (do_progress && !verbose && !itemize_changes) { if (refused_verbose) { create_refuse_error(refused_verbose); return 0; @@ -1207,8 +1207,8 @@ void server_options(char **args,int *argc) * default for remote transfers, and in any case old versions * of rsync will not understand it. */ - if (what_has_changed && am_sender) - argstr[x++] = 'w'; + if (itemize_changes && am_sender) + argstr[x++] = 'i'; if (preserve_hard_links) argstr[x++] = 'H'; if (preserve_uid) diff --git a/receiver.c b/receiver.c index 92a2cf31..c1e4232e 100644 --- a/receiver.c +++ b/receiver.c @@ -21,7 +21,7 @@ #include "rsync.h" extern int verbose; -extern int what_has_changed; +extern int itemize_changes; extern int delete_after; extern int csum_length; extern struct stats stats; @@ -389,7 +389,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name, rprintf(FINFO, "recv_files(%s)\n", safe_fname(fname)); if (dry_run) { /* log the transfer */ - if (!am_server && verbose && !what_has_changed) + if (!am_server && verbose && !itemize_changes) rprintf(FINFO, "%s\n", safe_fname(fname)); continue; } @@ -533,7 +533,7 @@ int recv_files(int f_in, struct file_list *flist, char *local_name, } /* log the transfer */ - if (!am_server && verbose && !what_has_changed) + if (!am_server && verbose && !itemize_changes) rprintf(FINFO, "%s\n", safe_fname(fname)); /* recv file data */ diff --git a/rsync.yo b/rsync.yo index 0c21a922..7bc0e4c0 100644 --- a/rsync.yo +++ b/rsync.yo @@ -373,7 +373,7 @@ to the detailed description below for a complete description. verb( --stats give some file-transfer stats --progress show progress during transfer -P same as --partial --progress - -w, --what-has-changed output a change summary for all updates + -i, --itemize-changes output a change-summary for all updates --log-format=FORMAT log file-transfers using specified format --password-file=FILE read password from FILE --list-only list the files instead of copying them @@ -1012,7 +1012,7 @@ ssh prefers non-blocking I/O.) dit(bf(--no-blocking-io)) Turn off bf(--blocking-io), for use when it is the default. -dit(bf(--what-has-changed)) Outputs a change-summary for each updated +dit(bf(-i, --itemize-changes)) Outputs a change-summary for each updated item. The format is as follows: quote(tt( *XcstpogDL ITEM_NAME)) @@ -1026,8 +1026,8 @@ attribute for the item is being updated; if not the letter will be replaced by either a "-" if no change is occurring, or a "+" if this is a new item. The meanings of the attribute letters are as follows: -itemize( - it() The bf(c) means the checksum of the file is different and will be +quote(itemize( + it() A bf(c) means the checksum of the file is different and will be updated by the file transfer (requries bf(--checksum)). it() A bf(s) means the size of the file is different and will be updated by the file transfer. @@ -1036,14 +1036,14 @@ itemize( marked with a bf(T) because the time is updated to the transfer time). it() A bf(p) means the permissions are being updated (requires bf(--perms)). - it() The bf(o) means the owner is being updated (requires bf(--owner) and + it() An bf(o) means the owner is being updated (requires bf(--owner) and root privileges). - it() The bf(g) means the group is being updated (requires bf(--group)). - it() The bf(D) means the device is being updated (requires bf(--devices) + it() A bf(g) means the group is being updated (requires bf(--group)). + it() A bf(D) means the device is being updated (requires bf(--devices) and root privileges). - it() The bf(L) means the symlink value is being updated (requires + it() An bf(L) means the symlink value is being updated (requires --links). -) +)) dit(bf(--log-format=FORMAT)) This allows you to specify exactly what the rsync client logs to stdout on a per-file basis. The log format is diff --git a/sender.c b/sender.c index a3cdff40..30640f13 100644 --- a/sender.c +++ b/sender.c @@ -20,7 +20,7 @@ #include "rsync.h" extern int verbose; -extern int what_has_changed; +extern int itemize_changes; extern int csum_length; extern struct stats stats; extern int io_error; @@ -169,7 +169,7 @@ void send_files(struct file_list *flist, int f_out, int f_in) rprintf(FINFO, "send_files(%d, %s)\n", i, fname); if (dry_run) { /* log the transfer */ - if (!am_server && verbose && !what_has_changed) + if (!am_server && verbose && !itemize_changes) rprintf(FINFO, "%s\n", safe_fname(fname2)); write_int(f_out, i); continue; @@ -231,7 +231,7 @@ void send_files(struct file_list *flist, int f_out, int f_in) } /* log the transfer */ - if (!am_server && verbose && !what_has_changed) + if (!am_server && verbose && !itemize_changes) rprintf(FINFO, "%s\n", safe_fname(fname2)); set_compression(fname); -- 2.34.1