From: Micah Cowan Date: Sun, 10 Jan 2010 04:21:37 +0000 (-0800) Subject: --no-match-server-timestamps -> --no-use-server-timestamps X-Git-Tag: v1.13~200 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=7585b7019d5909428a477002579366a507e42b58 --no-match-server-timestamps -> --no-use-server-timestamps --- diff --git a/doc/ChangeLog b/doc/ChangeLog index 140018cd..7a0a9473 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2010-01-09 Micah Cowan + + * wget.texi (Download Options): Documented + --no-use-server-timestamps. + 2009-09-04 Micah Cowan * wget.texi (Time-Stamping): "older" -> "not newer". diff --git a/doc/wget.texi b/doc/wget.texi index af211e35..0f8f2663 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -719,6 +719,16 @@ use @samp{--progress=bar:force}. @itemx --timestamping Turn on time-stamping. @xref{Time-Stamping}, for details. +@item --no-use-server-timestamps +Don't set the local file's timestamp by the one on the server. + +By default, when a file is downloaded, it's timestamps are set to +match those from the remote file. This allows the use of +@samp{--timestamping} on subsequent invocations of wget. However, it +is sometimes useful to base the local file's timestamp on when it was +actually downloaded; for that purpose, the +@samp{--no-use-server-timestamps} option has been provided. + @cindex server response, print @item -S @itemx --server-response @@ -3157,6 +3167,10 @@ Set all applicable timeout values to @var{n}, the same as @samp{-T @item timestamping = on/off Turn timestamping on/off. The same as @samp{-N} (@pxref{Time-Stamping}). +@item use_server_timestamps = on/off +If set to @samp{off}, Wget won't set the local file's timestamp by the +one on the server (same as @samp{--no-use-server-timestamps}). + @item tries = @var{n} Set number of retries per @sc{url}---the same as @samp{-t @var{n}}. diff --git a/src/ChangeLog b/src/ChangeLog index 13943bf4..e13f6589 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,12 @@ +2010-01-09 Micah Cowan + + * init.c, main.c, http.c, ftp.c, options.h: Renamed + --no-match-server-timestamps to --no-use-server-timestamps, and + add it to print_help. + 2010-01-09 David Holman (tiny change) - * init.c, main.c, http.c, ftp.c: Added support for + * init.c, main.c, http.c, ftp.c, options.h: Added support for --no-match-server-timestamps. 2009-12-03 Peter Rosin diff --git a/src/ftp.c b/src/ftp.c index 73cade42..d141b024 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -1849,7 +1849,7 @@ Already have correct symlink %s -> %s\n\n"), original. :( */ if (actual_target != NULL) { - if (opt.matchservertimestamps + if (opt.useservertimestamps && !(f->type == FT_SYMLINK && !opt.retr_symlinks) && f->tstamp != -1 && dlthis diff --git a/src/http.c b/src/http.c index 5fdff618..b0a9f246 100644 --- a/src/http.c +++ b/src/http.c @@ -2909,7 +2909,7 @@ Remote file exists.\n\n")); } /* send_head_first */ } /* !got_head */ - if (opt.matchservertimestamps + if (opt.useservertimestamps && (tmr != (time_t) (-1)) && ((hstat.len == hstat.contlen) || ((hstat.res == 0) && (hstat.contlen == -1)))) diff --git a/src/init.c b/src/init.c index c04414a3..16a4d9d2 100644 --- a/src/init.c +++ b/src/init.c @@ -197,7 +197,6 @@ static const struct { { "localencoding", &opt.locale, cmd_string }, { "logfile", &opt.lfilename, cmd_file }, { "login", &opt.ftp_user, cmd_string },/* deprecated*/ - { "matchservertimestamps", &opt.matchservertimestamps, cmd_boolean }, { "maxredirect", &opt.max_redirect, cmd_number }, { "mirror", NULL, cmd_spec_mirror }, { "netrc", &opt.netrc, cmd_boolean }, @@ -256,6 +255,7 @@ static const struct { { "useproxy", &opt.use_proxy, cmd_boolean }, { "user", &opt.user, cmd_string }, { "useragent", NULL, cmd_spec_useragent }, + { "useservertimestamps", &opt.useservertimestamps, cmd_boolean }, { "verbose", NULL, cmd_spec_verbose }, { "wait", &opt.wait, cmd_time }, { "waitretry", &opt.waitretry, cmd_time }, @@ -355,7 +355,7 @@ defaults (void) opt.locale = NULL; opt.encoding_remote = NULL; - opt.matchservertimestamps = true; + opt.useservertimestamps = true; } /* Return the user's home directory (strdup-ed), or NULL if none is diff --git a/src/main.c b/src/main.c index a76eef03..b41277ba 100644 --- a/src/main.c +++ b/src/main.c @@ -218,7 +218,6 @@ static struct cmdline_option option_data[] = { "limit-rate", 0, OPT_VALUE, "limitrate", -1 }, { "load-cookies", 0, OPT_VALUE, "loadcookies", -1 }, { "local-encoding", 0, OPT_VALUE, "localencoding", -1 }, - { "match-server-timestamps", 0, OPT_BOOLEAN, "matchservertimestamps", -1 }, { "max-redirect", 0, OPT_VALUE, "maxredirect", -1 }, { "mirror", 'm', OPT_BOOLEAN, "mirror", -1 }, { "no", 'n', OPT__NO, NULL, required_argument }, @@ -267,6 +266,7 @@ static struct cmdline_option option_data[] = { "timeout", 'T', OPT_VALUE, "timeout", -1 }, { "timestamping", 'N', OPT_BOOLEAN, "timestamping", -1 }, { "tries", 't', OPT_VALUE, "tries", -1 }, + { "use-server-timestamps", 0, OPT_BOOLEAN, "useservertimestamps", -1 }, { "user", 0, OPT_VALUE, "user", -1 }, { "user-agent", 'U', OPT_VALUE, "useragent", -1 }, { "verbose", 'v', OPT_BOOLEAN, "verbose", -1 }, @@ -458,6 +458,9 @@ Download:\n"), -N, --timestamping don't re-retrieve files unless newer than\n\ local.\n"), N_("\ + --no-use-server-timestamps don't set the local file's timestamp by\n\ + the one on the server.\n"), + N_("\ -S, --server-response print server response.\n"), N_("\ --spider don't download anything.\n"), diff --git a/src/options.h b/src/options.h index 5488e268..4e5d7203 100644 --- a/src/options.h +++ b/src/options.h @@ -246,7 +246,7 @@ struct options int ftp_stmlf; /* Force Stream_LF format for binary FTP. */ #endif /* def __VMS */ - bool matchservertimestamps; /* Update downloaded files' timestamps to + bool useservertimestamps; /* Update downloaded files' timestamps to match those on server? */ };