]> sjero.net Git - wget/commitdiff
--no-match-server-timestamps
authorDavid Holman <holman.david@gmail.com>
Sun, 10 Jan 2010 02:57:18 +0000 (18:57 -0800)
committerDavid Holman <holman.david@gmail.com>
Sun, 10 Jan 2010 02:57:18 +0000 (18:57 -0800)
src/ChangeLog
src/ftp.c
src/http.c
src/init.c
src/main.c
src/options.h

index 9480dc197c6f6d2b547d3efa2ae1a51ab3a9f8f1..9ae5092d1f86ec6b9c9d7c0fad0b8e8d1560d97f 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-09  David Holman  <holman.david@gmail.com>
+
+       * init.c, main.c, http.c, ftp.c: Added support for
+       --no-match-server-timestamps.
+
 2009-12-03  Peter Rosin  <peda@lysator.liu.se>
 
        * snprintf.c (dopr): Output %p as unsigned.
index 881c99be5139596ecd9d61fcd02ec16230432873..73cade4227bda82466704d46435e3955f62fdbfa 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -1849,7 +1849,8 @@ Already have correct symlink %s -> %s\n\n"),
          original.  :( */
       if (actual_target != NULL)
         {
-          if (!(f->type == FT_SYMLINK && !opt.retr_symlinks)
+          if (opt.matchservertimestamps
+              && !(f->type == FT_SYMLINK && !opt.retr_symlinks)
               && f->tstamp != -1
               && dlthis
               && file_exists_p (con->target))
index c7de37d81a90e2885558ee5451624bdb4aad0ba0..5fdff618396bd5926d77f24f570afd0a0ded180d 100644 (file)
@@ -2909,7 +2909,8 @@ Remote file exists.\n\n"));
             } /* send_head_first */
         } /* !got_head */
 
-      if ((tmr != (time_t) (-1))
+      if (opt.matchservertimestamps
+          && (tmr != (time_t) (-1))
           && ((hstat.len == hstat.contlen) ||
               ((hstat.res == 0) && (hstat.contlen == -1))))
         {
index 49c6ea3d7d2a8787550d7f2faab47ca52c172517..c04414a3b2fb63f66c6eaae590ed678fb8e11172 100644 (file)
@@ -197,6 +197,7 @@ 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 },
@@ -353,6 +354,8 @@ defaults (void)
 #endif
   opt.locale = NULL;
   opt.encoding_remote = NULL;
+
+  opt.matchservertimestamps = true;
 }
 \f
 /* Return the user's home directory (strdup-ed), or NULL if none is
index fda7d0f3a20f732932fd5480abe49a04fda5b28a..a76eef03481845167ee92fa03d0f56eded74e2b1 100644 (file)
@@ -218,6 +218,7 @@ 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 },
index a895863792044219535ae93f87e81e22ae9b6816..5488e2687d6d4ecf1f301f76f47005918b1fde02 100644 (file)
@@ -246,6 +246,9 @@ struct options
   int ftp_stmlf;                /* Force Stream_LF format for binary FTP. */
 #endif /* def __VMS */
 
+  bool matchservertimestamps;  /* Update downloaded files' timestamps to
+                                  match those on server? */
+
 };
 
 extern struct options opt;