1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Applied Dennis Smit's --preserve-permissions patch.

This commit is contained in:
hniksic 2003-11-06 12:33:20 -08:00
parent b46a8df58d
commit ad75dd2662
5 changed files with 29 additions and 9 deletions

View File

@ -1,3 +1,14 @@
2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
* main.c: (main): added --preserve-permissions option.
* ftp.c (ftp_retrieve_list): added support for
--preserve-permissions option.
* init.c: added support for --preserve-permission option.
* option.h: added support for --preserve-permission option.
2003-11-06 Hrvoje Niksic <hniksic@xemacs.org> 2003-11-06 Hrvoje Niksic <hniksic@xemacs.org>
* main.c (init_switches): New function. Convert option_data to * main.c (init_switches): New function. Convert option_data to

View File

@ -1630,7 +1630,10 @@ Already have correct symlink %s -> %s\n\n"),
logprintf (LOG_NOTQUIET, _("%s: corrupt time-stamp.\n"), con->target); logprintf (LOG_NOTQUIET, _("%s: corrupt time-stamp.\n"), con->target);
if (f->perms && f->type == FT_PLAINFILE && dlthis) if (f->perms && f->type == FT_PLAINFILE && dlthis)
chmod (con->target, f->perms); {
if (opt.preserve_perm)
chmod (con->target, f->perms);
}
else else
DEBUGP (("Unrecognized permissions for %s.\n", con->target)); DEBUGP (("Unrecognized permissions for %s.\n", con->target));

View File

@ -185,6 +185,7 @@ static struct {
{ "passwd", &opt.ftp_pass, cmd_string }, { "passwd", &opt.ftp_pass, cmd_string },
{ "postdata", &opt.post_data, cmd_string }, { "postdata", &opt.post_data, cmd_string },
{ "postfile", &opt.post_file_name, cmd_file }, { "postfile", &opt.post_file_name, cmd_file },
{ "preservepermissions", &opt.preserve_perm, cmd_boolean },
{ "progress", &opt.progress_type, cmd_spec_progress }, { "progress", &opt.progress_type, cmd_spec_progress },
{ "proxypasswd", &opt.proxy_passwd, cmd_string }, { "proxypasswd", &opt.proxy_passwd, cmd_string },
{ "proxyuser", &opt.proxy_user, cmd_string }, { "proxyuser", &opt.proxy_user, cmd_string },

View File

@ -212,6 +212,7 @@ struct cmdline_option option_data[] =
{ "passive-ftp", 0, OPT_BOOLEAN, "passiveftp", -1 }, { "passive-ftp", 0, OPT_BOOLEAN, "passiveftp", -1 },
{ "post-data", 0, OPT_VALUE, "postdata", -1 }, { "post-data", 0, OPT_VALUE, "postdata", -1 },
{ "post-file", 0, OPT_VALUE, "postfile", -1 }, { "post-file", 0, OPT_VALUE, "postfile", -1 },
{ "preserve-permissions", 0, OPT_BOOLEAN, "preservepermissions", -1 },
{ "progress", 0, OPT_VALUE, "progress", -1 }, { "progress", 0, OPT_VALUE, "progress", -1 },
{ "proxy", 'Y', OPT_BOOLEAN, "useproxy", -1 }, { "proxy", 'Y', OPT_BOOLEAN, "useproxy", -1 },
{ "proxy-passwd", 0, OPT_VALUE, "proxypasswd", -1 }, { "proxy-passwd", 0, OPT_VALUE, "proxypasswd", -1 },
@ -462,14 +463,15 @@ FTP options:\n\
\n"), stdout); \n"), stdout);
fputs (_("\ fputs (_("\
Recursive retrieval:\n\ Recursive retrieval:\n\
-r, --recursive recursive download.\n\ -r, --recursive recursive download.\n\
-l, --level=NUMBER maximum recursion depth (inf or 0 for infinite).\n\ -l, --level=NUMBER maximum recursion depth (inf or 0 for infinite).\n\
--delete-after delete files locally after downloading them.\n\ --delete-after delete files locally after downloading them.\n\
-k, --convert-links convert non-relative links to relative.\n\ -k, --convert-links convert non-relative links to relative.\n\
-K, --backup-converted before converting file X, back up as X.orig.\n\ -K, --backup-converted before converting file X, back up as X.orig.\n\
-m, --mirror shortcut option equivalent to -r -N -l inf -nr.\n\ -m, --mirror shortcut option equivalent to -r -N -l inf -nr.\n\
-p, --page-requisites get all images, etc. needed to display HTML page.\n\ -p, --page-requisites get all images, etc. needed to display HTML page.\n\
--strict-comments turn on strict (SGML) handling of HTML comments.\n\ --strict-comments turn on strict (SGML) handling of HTML comments.\n\
--preserve-permissions preserve remote file permissions.\n\
\n"), stdout); \n"), stdout);
fputs (_("\ fputs (_("\
Recursive accept/reject:\n\ Recursive accept/reject:\n\

View File

@ -196,6 +196,9 @@ struct options
int strict_comments; /* whether strict SGML comments are int strict_comments; /* whether strict SGML comments are
enforced. */ enforced. */
int preserve_perm; /* whether remote permissions are used
or that what is set by umask. */
}; };
extern struct options opt; extern struct options opt;