# CSIRO-ASC patches for rsync. # # Note: name this so that it's called after rsync_link_dest_from_bryant # # Rowan McKenzie 27/7/2012 # Warnings for --max-size ignored files are displayed if -w/--warning is specified diff -Naur orig/options.c new/options.c --- orig/options.c 2012-07-26 16:36:59.201899312 +1000 +++ new/options.c 2012-07-26 16:49:40.065898039 +1000 @@ -173,6 +173,7 @@ char *dest_option = NULL; int verbose = 0; +int warn = 0; int quiet = 0; int output_motd = 1; int log_before_transfer = 0; @@ -313,6 +314,7 @@ rprintf(F,"\n"); rprintf(F,"Options\n"); rprintf(F," -v, --verbose increase verbosity\n"); + rprintf(F," -w, --warn display warnings\n"); rprintf(F," -q, --quiet suppress non-error messages\n"); rprintf(F," --no-motd suppress daemon-mode MOTD (see manpage caveat)\n"); rprintf(F," -c, --checksum skip based on checksum, not mod-time & size\n"); @@ -453,6 +455,7 @@ {"help", 0, POPT_ARG_NONE, 0, OPT_HELP, 0, 0 }, {"version", 0, POPT_ARG_NONE, 0, OPT_VERSION, 0, 0}, {"verbose", 'v', POPT_ARG_NONE, 0, 'v', 0, 0 }, + {"warn", 'w', POPT_ARG_NONE, 0, 'w', 0, 0 }, {"no-verbose", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 }, {"no-v", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 }, {"quiet", 'q', POPT_ARG_NONE, 0, 'q', 0, 0 }, @@ -671,6 +674,7 @@ rprintf(F," --log-file-format=FMT override the \"log format\" setting\n"); rprintf(F," --sockopts=OPTIONS specify custom TCP options\n"); rprintf(F," -v, --verbose increase verbosity\n"); + rprintf(F," -w, --warn display warnings\n"); rprintf(F," -4, --ipv4 prefer IPv4\n"); rprintf(F," -6, --ipv6 prefer IPv6\n"); rprintf(F," --help show this help screen\n"); @@ -698,6 +702,7 @@ {"server", 0, POPT_ARG_NONE, &am_server, 0, 0, 0 }, {"temp-dir", 'T', POPT_ARG_STRING, &tmpdir, 0, 0, 0 }, {"verbose", 'v', POPT_ARG_NONE, 0, 'v', 0, 0 }, + {"warn", 'w', POPT_ARG_NONE, 0, 'w', 0, 0 }, {"no-verbose", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 }, {"no-v", 0, POPT_ARG_VAL, &verbose, 0, 0, 0 }, {"help", 'h', POPT_ARG_NONE, 0, 'h', 0, 0 }, @@ -978,6 +983,10 @@ verbose++; break; + case 'w': + warn++; + break; + default: rprintf(FERROR, "rsync: %s: %s (in daemon mode)\n", @@ -1095,6 +1104,10 @@ verbose++; break; + case 'w': + warn++; + break; + case 'q': quiet++; break; # Warnings for --max-size ignored files are displayed if -w/--warning is specified diff -Naur orig/generator.c new/generator.c --- orig/generator.c 2012-07-26 16:56:13.773898292 +1000 +++ new/generator.c 2012-07-26 16:44:19.597902412 +1000 @@ -24,6 +24,7 @@ #include "same-inode.h" extern int verbose; +extern int warn; extern int dry_run; extern int do_xfers; extern int stdout_format_has_i; @@ -1796,7 +1796,7 @@ } if (max_size > 0 && F_LENGTH(file) > max_size) { - if (verbose > 1) { + if (verbose > 1 || warn) { if (solo_file) fname = f_name(file, NULL); rprintf(FINFO, "%s is over max-size\n", fname); # Only output '=>' notifications when -v/--verbose specified (it's a patch to the rsync_link_dest_from_bryant patch) diff -Naur orig/generator.c new/generator.c --- orig/generator.c 2012-07-26 16:56:13.773898292 +1000 +++ new/generator.c 2012-07-26 16:44:19.597902412 +1000 @@ -1066,7 +1066,7 @@ * doesn't exist... */ if (!statres || stat_err == ENOENT) { if (!SAME_INODE(sxp->st, st_tmp)) { - if (!statres) { + /*if (!statres) {*/ if (!statres && verbose) { rprintf(FCLIENT, "%s => %s\n", fname, cmpbuf); } if (!hard_link_one(file, fname, cmpbuf, 1)) {