Blame SOURCES/wget-1.14-doc-missing-opts-and-fix-preserve-permissions.patch

226bdc
From c78caecbb4209ce2e36a587497cf1d6b350e513a Mon Sep 17 00:00:00 2001
226bdc
From: Tomas Hozza <thozza@redhat.com>
226bdc
Date: Thu, 11 Jul 2013 15:52:28 +0000
226bdc
Subject: Document missing options and fix --preserve-permissions
226bdc
226bdc
Added documentation for --regex-type and --preserve-permissions
226bdc
options.
226bdc
226bdc
Fixed --preserve-permissions to work properly also if downloading a
226bdc
single file from FTP.
226bdc
226bdc
Signed-off-by: Tomas Hozza <thozza@redhat.com>
226bdc
---
226bdc
diff --git a/doc/wget.texi b/doc/wget.texi
226bdc
index 710f0ac..5054382 100644
226bdc
--- a/doc/wget.texi
226bdc
+++ b/doc/wget.texi
226bdc
@@ -1816,6 +1816,10 @@ in some rare firewall configurations, active FTP actually works when
226bdc
 passive FTP doesn't.  If you suspect this to be the case, use this
226bdc
 option, or set @code{passive_ftp=off} in your init file.
226bdc
 
226bdc
+@cindex file permissions
226bdc
+@item --preserve-permissions
226bdc
+Preserve remote file permissions instead of permissions set by umask.
226bdc
+
226bdc
 @cindex symbolic links, retrieving
226bdc
 @item --retr-symlinks
226bdc
 Usually, when retrieving @sc{ftp} directories recursively and a symbolic
226bdc
@@ -2057,6 +2061,11 @@ it will be treated as a pattern, rather than a suffix.
226bdc
 @itemx --reject-regex @var{urlregex}
226bdc
 Specify a regular expression to accept or reject the complete URL.
226bdc
 
226bdc
+@item --regex-type @var{regextype}
226bdc
+Specify the regular expression type.  Possible types are @samp{posix} or
226bdc
+@samp{pcre}.  Note that to be able to use @samp{pcre} type, wget has to be
226bdc
+compiled with libpcre support.
226bdc
+
226bdc
 @item -D @var{domain-list}
226bdc
 @itemx --domains=@var{domain-list}
226bdc
 Set domains to be followed.  @var{domain-list} is a comma-separated list
226bdc
diff --git a/src/ftp.c b/src/ftp.c
226bdc
index 9b3d81c..1fe2bac 100644
226bdc
--- a/src/ftp.c
226bdc
+++ b/src/ftp.c
226bdc
@@ -2285,11 +2285,11 @@ ftp_loop (struct url *u, char **local_file, int *dt, struct url *proxy,
226bdc
             file_part = u->path;
226bdc
           ispattern = has_wildcards_p (file_part);
226bdc
         }
226bdc
-      if (ispattern || recursive || opt.timestamping)
226bdc
+      if (ispattern || recursive || opt.timestamping || opt.preserve_perm)
226bdc
         {
226bdc
           /* ftp_retrieve_glob is a catch-all function that gets called
226bdc
-             if we need globbing, time-stamping or recursion.  Its
226bdc
-             third argument is just what we really need.  */
226bdc
+             if we need globbing, time-stamping, recursion or preserve
226bdc
+             permissions.  Its third argument is just what we really need.  */
226bdc
           res = ftp_retrieve_glob (u, &con,
226bdc
                                    ispattern ? GLOB_GLOBALL : GLOB_GETONE);
226bdc
         }
226bdc
--
226bdc
cgit v0.9.0.2