Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-updates-src > by-pkgid > 0ceee55209ad90bd69ea981a27155ea7 > files > 12

wget-1.15-5.3.mga5.src.rpm

--- src/ftp.c.clobber	2014-01-04 07:49:47.000000000 -0500
+++ src/ftp.c	2014-02-21 14:33:56.264884571 -0500
@@ -1226,7 +1226,7 @@
           fp = fopen (con->target, "ab");
 #endif /* def __VMS [else] */
         }
-      else if (opt.noclobber || opt.always_rest || opt.timestamping || opt.dirstruct
+      else if (opt.forceclobber || opt.noclobber || opt.always_rest || opt.timestamping || opt.dirstruct
                || opt.output_document || count > 0)
         {
           if (opt.unlink && file_exists_p (con->target))
--- src/url.h.clobber	2012-07-07 16:57:20.000000000 +0800
+++ src/url.h	2012-08-06 16:41:32.000000000 +0800
@@ -50,7 +50,7 @@
 /* The flags that allow clobbering the file (opening with "wb").
    Defined here to avoid repetition later.  #### This will require
    rework.  */
-#define ALLOW_CLOBBER (opt.noclobber || opt.always_rest || opt.timestamping \
+#define ALLOW_CLOBBER (opt.forceclobber || opt.noclobber || opt.always_rest || opt.timestamping \
                   || opt.dirstruct || opt.output_document || opt.backups > 0)
 
 /* Specifies how, or whether, user auth information should be included
--- src/init.c.clobber	2012-07-08 17:35:36.000000000 +0800
+++ src/init.c	2012-08-06 16:41:32.000000000 +0800
@@ -175,6 +175,7 @@
   { "excludedomains",   &opt.exclude_domains,   cmd_vector },
   { "followftp",        &opt.follow_ftp,        cmd_boolean },
   { "followtags",       &opt.follow_tags,       cmd_vector },
+  { "forceclobber",     &opt.forceclobber,      cmd_boolean },
   { "forcehtml",        &opt.force_html,        cmd_boolean },
   { "ftppasswd",        &opt.ftp_passwd,        cmd_string }, /* deprecated */
   { "ftppassword",      &opt.ftp_passwd,        cmd_string },
--- src/main.c.clobber	2012-07-07 16:26:21.000000000 +0800
+++ src/main.c	2012-08-06 16:41:32.000000000 +0800
@@ -198,6 +198,7 @@
     { "execute", 'e', OPT__EXECUTE, NULL, required_argument },
     { "follow-ftp", 0, OPT_BOOLEAN, "followftp", -1 },
     { "follow-tags", 0, OPT_VALUE, "followtags", -1 },
+    { "force-clobber", 0, OPT_BOOLEAN, "forceclobber", -1 },
     { "force-directories", 'x', OPT_BOOLEAN, "dirstruct", -1 },
     { "force-html", 'F', OPT_BOOLEAN, "forcehtml", -1 },
     { "ftp-password", 0, OPT_VALUE, "ftppassword", -1 },
@@ -481,6 +482,8 @@
     N_("\
   -O,  --output-document=FILE    write documents to FILE.\n"),
     N_("\
+  --force-clobber                clobber existing files.\n"),
+    N_("\
   -nc, --no-clobber              skip downloads that would download to\n\
                                  existing files (overwriting them).\n"),
     N_("\
@@ -1221,7 +1224,21 @@
   if (opt.timestamping && opt.noclobber)
     {
       fprintf (stderr, _("\
-Can't timestamp and not clobber old files at the same time.\n"));
+                         Can't timestamp and not clobber old files at the same time.\n"));
+      print_usage (1);
+      exit (1);
+    }
+    if (opt.timestamping && opt.forceclobber)
+    {
+      printf (_("\
+                +Can't timestamp and force clobber old files at the same time.\n"));
+      print_usage (1);
+      exit (1);
+    }
+    if (opt.forceclobber && opt.noclobber)
+    {
+      printf (_("\
+                +Can't force clobber and not clobber old files at the same time.\n"));
       print_usage (1);
       exit (1);
     }
--- src/options.h.clobber	2012-06-06 19:42:10.000000000 +0800
+++ src/options.h	2012-08-06 16:41:32.000000000 +0800
@@ -53,6 +53,7 @@
   int cut_dirs;			/* Number of directory components to cut. */
   bool add_hostdir;		/* Do we add hostname directory? */
   bool protocol_directories;	/* Whether to prepend "http"/"ftp" to dirs. */
+  int forceclobber;		/* Forces clobbering of existing files. */
   bool noclobber;		/* Disables clobbering of existing
 				   data. */
   bool unlink;			/* remove file before clobbering */
--- src/url.c.clobber	2012-05-15 04:43:33.000000000 +0800
+++ src/url.c	2012-08-06 16:41:32.000000000 +0800
@@ -1583,6 +1583,7 @@
   free (temp_fnres.base);
 
   /* Check the cases in which the unique extensions are not used:
+     0) Clobbering is forced (--force-clobber)
      1) Clobbering is turned off (-nc).
      2) Retrieval with regetting.
      3) Timestamping is used.