From cb358c0a847173a2e83a37d903af4ebef3253183 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 22 Dec 2013 13:59:45 +0100 Subject: [PATCH 1/9] gnulib: add as a git submodule --- .gitmodules | 3 +++ ChangeLog | 4 ++++ gnulib | 1 + 3 files changed, 8 insertions(+) create mode 100644 .gitmodules create mode 160000 gnulib diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..acb26693 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "gnulib"] + path = gnulib + url = git://git.sv.gnu.org/gnulib.git diff --git a/ChangeLog b/ChangeLog index a0b99df9..5eaa01f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-12-22 Giuseppe Scrivano + + * gnulib: add git submodule. + 2013-09-13 Tim Ruehsen * configure.ac: added a summary of build options diff --git a/gnulib b/gnulib new file mode 160000 index 00000000..0ac90c5a --- /dev/null +++ b/gnulib @@ -0,0 +1 @@ +Subproject commit 0ac90c5a98030c998f3e1db3a0d7f19d4630b6b6 From fb23bc0611f20a493e990caaec3884a738b7505b Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 22 Dec 2013 22:23:36 -0500 Subject: [PATCH 2/9] sample.wgetrc: add links to the manual --- doc/ChangeLog | 4 ++++ doc/sample.wgetrc | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3b057561..9f05df5e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2013-12-22 Mike Frysinger + + * sample.wgetrc: add links to the manual. + 2013-10-06 Tim Ruehsen * wget.texi: add/explain quoting of wildcard patterns diff --git a/doc/sample.wgetrc b/doc/sample.wgetrc index eaf2bc81..ad86be32 100644 --- a/doc/sample.wgetrc +++ b/doc/sample.wgetrc @@ -5,7 +5,10 @@ ## You can use this file to change the default behaviour of wget or to ## avoid having to type many many command-line options. This file does ## not contain a comprehensive list of commands -- look at the manual -## to find out what you can put into this file. +## to find out what you can put into this file. You can find this here: +## $ info wget.info 'Startup File' +## Or online here: +## https://www.gnu.org/software/wget/manual/wget.html#Startup-File ## ## Wget initialization file can reside in /usr/local/etc/wgetrc ## (global, for all users) or $HOME/.wgetrc (for a single user). From 3b6a3e84a013b53b03a8965e91aa0e9478c77841 Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Thu, 26 Dec 2013 21:17:07 +0100 Subject: [PATCH 3/9] fix GnuTLS connect timeout --- src/ChangeLog | 4 ++++ src/gnutls.c | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 42ce3e40..b3766ced 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2013-12-26 Tim Ruehsen + + * gnutls.c (ssl_connect_wget): Fix connect timeout failure + 2013-11-02 Giuseppe Scrivano * http.c (gethttp): Increase max header value length to 512. diff --git a/src/gnutls.c b/src/gnutls.c index 9b4b1ec0..4f0fa962 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -526,8 +526,7 @@ ssl_connect_wget (int fd, const char *hostname) break; } - if (err <= 0) - break; + err = GNUTLS_E_AGAIN; } else if (err < 0) { @@ -543,7 +542,7 @@ ssl_connect_wget (int fd, const char *hostname) } } } - while (err == GNUTLS_E_WARNING_ALERT_RECEIVED && gnutls_error_is_fatal (err) == 0); + while (err && gnutls_error_is_fatal (err) == 0); if (opt.connect_timeout) { From 351d328c07f04e72153af3a3acb54502054315be Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 29 Dec 2013 11:41:22 +0100 Subject: [PATCH 4/9] doc: use GFDL 1.3 --- doc/ChangeLog | 4 ++++ doc/wget.texi | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 9f05df5e..58d14395 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2013-12-29 Giuseppe Scrivano + + * wget.texi: Update to GFDL 1.3. + 2013-12-22 Mike Frysinger * sample.wgetrc: add links to the manual. diff --git a/doc/wget.texi b/doc/wget.texi index 4a1f7f1e..6a8c6a33 100644 --- a/doc/wget.texi +++ b/doc/wget.texi @@ -47,11 +47,11 @@ notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy, distribute and/or modify this document -under the terms of the GNU Free Documentation License, Version 1.2 or +under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no -Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A -copy of the license is included in the section entitled ``GNU Free -Documentation License''. +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover +Texts. A copy of the license is included in the section entitled +``GNU Free Documentation License''. @c man end @end copying @@ -4390,7 +4390,7 @@ subscribers of the Wget mailing list. @appendix Copying this manual @menu -* GNU Free Documentation License:: Licnse for copying this manual. +* GNU Free Documentation License:: License for copying this manual. @end menu @node GNU Free Documentation License, , Copying this manual, Copying this manual From 70f7cdf1af06adaaac906d92cdb78938838f144a Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 29 Dec 2013 11:46:04 +0100 Subject: [PATCH 5/9] Remove some useless if statements --- src/ChangeLog | 7 +++++++ src/init.c | 3 +-- src/warc.c | 16 ++++++---------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index b3766ced..3d6699cb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2013-12-29 Giuseppe Scrivano + + * init.c (home_dir): Remove useless 'if'. + * warc.c (warc_start_new_file): Likewise. + (warc_process_cdx_line): Likewise. + (warc_write_response_record): Likewise. + 2013-12-26 Tim Ruehsen * gnutls.c (ssl_connect_wget): Fix connect timeout failure diff --git a/src/init.c b/src/init.c index 84ae654c..a64dabe6 100644 --- a/src/init.c +++ b/src/init.c @@ -462,8 +462,7 @@ home_dir (void) } ret = home ? xstrdup (home) : NULL; - if (buf) - free (buf); + free (buf); return ret; } diff --git a/src/warc.c b/src/warc.c index 41f522af..c3a58572 100644 --- a/src/warc.c +++ b/src/warc.c @@ -726,10 +726,9 @@ warc_start_new_file (bool meta) if (warc_current_file != NULL) fclose (warc_current_file); - if (warc_current_warcinfo_uuid_str) - free (warc_current_warcinfo_uuid_str); - if (warc_current_filename) - free (warc_current_filename); + + free (warc_current_warcinfo_uuid_str); + free (warc_current_filename); warc_current_file_number++; @@ -918,8 +917,7 @@ warc_process_cdx_line (char *lineptr, int field_num_original_url, else { free (original_url); - if (checksum_v != NULL) - free (checksum_v); + free (checksum_v); free (record_id); } } @@ -1417,10 +1415,8 @@ warc_write_response_record (char *url, char *timestamp_str, response_uuid); } - if (block_digest) - free (block_digest); - if (payload_digest) - free (payload_digest); + free (block_digest); + free (payload_digest); return warc_write_ok; } From d260ded06063cd974b50ea061641c98b64fe25a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20V=C3=A5gsether?= Date: Sun, 5 Jan 2014 00:19:14 +0100 Subject: [PATCH 6/9] Fix checking the URL length when filename is specified --- src/ChangeLog | 5 +++++ src/http.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3d6699cb..0ac1ac61 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-01-05 Håkon Vågsether (tiny change) + + * http.c (http_loop): Fix checking the URL length when filename is + specified. + 2013-12-29 Giuseppe Scrivano * init.c (home_dir): Remove useless 'if'. diff --git a/src/http.c b/src/http.c index 754b7eca..5715df65 100644 --- a/src/http.c +++ b/src/http.c @@ -3043,7 +3043,10 @@ http_loop (struct url *u, struct url *original_url, char **newloc, /* Send preliminary HEAD request if -N is given and we have an existing * destination file. */ - file_name = url_file_name (opt.trustservernames ? u : original_url, NULL); + if (!opt.output_document) + file_name = url_file_name (opt.trustservernames ? u : original_url, NULL); + else + file_name = xstrdup (opt.output_document); if (opt.timestamping && (file_exists_p (file_name) || opt.content_disposition)) send_head_first = true; From f694b2ea24772e74bec8caf3bfb8dcd509b9f364 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Sun, 12 Jan 2014 22:01:44 +0100 Subject: [PATCH 7/9] Prepare release 1.15 --- NEWS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 5605e1b3..aef48ea3 100644 --- a/NEWS +++ b/NEWS @@ -6,7 +6,7 @@ See the end for copying conditions. Please send GNU Wget bug reports to . -* Changes in Wget X.Y.Z +* Changes in Wget 1.15 ** Add support for --method. @@ -35,6 +35,8 @@ Please send GNU Wget bug reports to . ** Support some FTP servers that return an empty list with "LIST -a". ** Specify Host with the HTTP CONNECT method. + +** Use the correct HTTP method on a redirection. * Changes in Wget 1.14 From 87186cbc2f83abfe3d09aa9a9ca1d81af5e24d19 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 22 Jan 2014 19:45:21 +0100 Subject: [PATCH 8/9] NEWS: placeholder for the new release --- NEWS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS b/NEWS index aef48ea3..a4bcb527 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,8 @@ See the end for copying conditions. Please send GNU Wget bug reports to . +* Changes in Wget X.Y.Z + * Changes in Wget 1.15 ** Add support for --method. From b9e5c3e8b342c2fedfd4465191dfef85132ada58 Mon Sep 17 00:00:00 2001 From: Darshit Shah Date: Fri, 17 Jan 2014 15:16:38 +0530 Subject: [PATCH 9/9] Introduce --no-config. The wgetrc files will not be read In case of a conflict between --config and --no-config, the one that appears first will be considered and the other ignored. --- NEWS | 2 ++ src/ChangeLog | 8 ++++++++ src/init.c | 3 ++- src/main.c | 15 ++++++++++++--- src/options.h | 1 + 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index a4bcb527..1de425dd 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ See the end for copying conditions. Please send GNU Wget bug reports to . * Changes in Wget X.Y.Z + +** Introduce --no-config. * Changes in Wget 1.15 diff --git a/src/ChangeLog b/src/ChangeLog index 0ac1ac61..12f2a048 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2014-01-17 Darshit Shah + + * init.c (commands[]): Add --no-config. + * options.h: Same. + * main.c (option_data[]): Same. + (print_help): Same. + (main): If --no-config is set, then do not read the wgetrc files. + 2014-01-05 Håkon Vågsether (tiny change) * http.c (http_loop): Fix checking the URL length when filename is diff --git a/src/init.c b/src/init.c index a64dabe6..43d5ae98 100644 --- a/src/init.c +++ b/src/init.c @@ -160,7 +160,7 @@ static const struct { #ifdef ENABLE_DEBUG { "debug", &opt.debug, cmd_boolean }, #endif - { "defaultpage", &opt.default_page, cmd_string }, + { "defaultpage", &opt.default_page, cmd_string }, { "deleteafter", &opt.delete_after, cmd_boolean }, { "dirprefix", &opt.dir_prefix, cmd_directory }, { "dirstruct", NULL, cmd_spec_dirstruct }, @@ -220,6 +220,7 @@ static const struct { { "mirror", NULL, cmd_spec_mirror }, { "netrc", &opt.netrc, cmd_boolean }, { "noclobber", &opt.noclobber, cmd_boolean }, + { "noconfig", &opt.noconfig, cmd_boolean }, { "noparent", &opt.no_parent, cmd_boolean }, { "noproxy", &opt.no_proxy, cmd_vector }, { "numtries", &opt.ntry, cmd_number_inf },/* deprecated*/ diff --git a/src/main.c b/src/main.c index 19d7253d..2aa961da 100644 --- a/src/main.c +++ b/src/main.c @@ -238,6 +238,7 @@ static struct cmdline_option option_data[] = { "mirror", 'm', OPT_BOOLEAN, "mirror", -1 }, { "no", 'n', OPT__NO, NULL, required_argument }, { "no-clobber", 0, OPT_BOOLEAN, "noclobber", -1 }, + { "no-config", 0, OPT_BOOLEAN, "noconfig", -1}, { "no-parent", 0, OPT_BOOLEAN, "noparent", -1 }, { "output-document", 'O', OPT_VALUE, "outputdocument", -1 }, { "output-file", 'o', OPT_VALUE, "logfile", -1 }, @@ -473,7 +474,9 @@ Logging and input file:\n"), -B, --base=URL resolves HTML input-file links (-i -F)\n\ relative to URL.\n"), N_("\ - --config=FILE Specify config file to use.\n"), + --config=FILE Specify config file to use.\n"), + N_("\ + --no-config Do not read any config file.\n"), "\n", N_("\ @@ -1045,6 +1048,7 @@ main (int argc, char **argv) longindex = -1; int retconf; bool use_userconfig = false; + bool noconfig = false; while ((retconf = getopt_long (argc, argv, short_options, long_options, &longindex)) != -1) @@ -1057,7 +1061,12 @@ main (int argc, char **argv) { confval = long_options[longindex].val; config_opt = &option_data[confval & ~BOOLEAN_NEG_MARKER]; - if (strcmp (config_opt->long_name, "config") == 0) + if (strcmp (config_opt->long_name, "no-config") == 0) + { + noconfig = true; + break; + } + else if (strcmp (config_opt->long_name, "config") == 0) { bool userrc_ret = true; userrc_ret &= run_wgetrc (optarg); @@ -1074,7 +1083,7 @@ main (int argc, char **argv) } /* If the user did not specify a config, read the system wgetrc and ~/.wgetrc. */ - if (use_userconfig == false) + if (noconfig == false && use_userconfig == false) initialize (); opterr = 0; diff --git a/src/options.h b/src/options.h index ad896275..e00fadc7 100644 --- a/src/options.h +++ b/src/options.h @@ -60,6 +60,7 @@ struct options char *lfilename; /* Log filename */ char *input_filename; /* Input filename */ char *choose_config; /* Specified config file */ + bool noconfig; bool force_html; /* Is the input file an HTML file? */ char *default_page; /* Alternative default page (index file) */