]> sjero.net Git - wget/commitdiff
[svn] Applied John Daily <jdaily@cyberdude.com>'s patch for his "quad" commands ...
authordan <devnull@localhost>
Fri, 20 Oct 2000 06:59:30 +0000 (23:59 -0700)
committerdan <devnull@localhost>
Fri, 20 Oct 2000 06:59:30 +0000 (23:59 -0700)
I renamed to "lockable_boolean") in the .wgetrc (currently just passive_ftp).
Wrote documentation for his changes and added the missing "referer" to the
.wgetrc section (making mention of the issue of "referrer" being the correct
spelling).

doc/ChangeLog
doc/wget.info
doc/wget.info-2
doc/wget.texi
src/ChangeLog
src/ftp.c
src/init.c

index 2127bd83b452d52963fe1abf6bcb89e23363be7c..e1b79ca7fd40227d3168a5e241a9c2889c3fd30c 100644 (file)
@@ -1,7 +1,11 @@
 2000-10-19  Dan Harkless  <dan-wget@dilvish.speed.net>
 
        * wget.texi (HTTP Options): Documented my new -E / --html-extension.
-
+       (Wgetrc Commands): Documented my new html_extension option and
+       John Daily's "quad" values (which I renamed to "lockable
+       Boolean").  When I documented Damir Dzeko's --referer, I forgot to
+       add the .wgetrc equivalent; mentioned the "referrer" spelling issue.
+       
 2000-10-09  Dan Harkless  <dan-wget@dilvish.speed.net>
 
        * wget.texi (FTP Options): --retr-symlinks wasn't documented properly.
@@ -9,7 +13,8 @@
 2000-08-30  Dan Harkless  <dan-wget@dilvish.speed.net>
 
        * wget.texi (Recursive Retrieval Options): Documented new -p option.
-
+       (Wgetrc Commands): Documented -p's equvialent, page_requisites.
+       
 2000-08-23  Dan Harkless  <dan-wget@dilvish.speed.net>
 
        * wget.texi (Download Options): Using -c on a file that's already fully
@@ -69,7 +74,7 @@
        
        * sample.wgetrc: Added entries for backup_converted and waitretry.
 
-       * wget.texi (Download Options): Herold Heiko
+       * wget.texi (Download Options and Wgetrc Commands): Herold Heiko
        <Heiko.Herold@previnet.it>'s new --waitretry option was
        undocumented until now.  Reworded the suggested documentation he
        sent to the list.
 
 2000-02-18  Dan Harkless  <dan-wget@dilvish.speed.net>
 
-       * wget.texi (-K / --backup-converted): Documented this new option.
+       * wget.texi (Recursive Retrieval Options): Documented my new -K /
+       --backup-converted option.
+       (Wgetrc Commands): Documented backup_converted equivalent.
 
 1998-09-10  Hrvoje Niksic  <hniksic@srce.hr>
 
index 468ec3cacfa00e669d87cb8f07d38a8f2a474849..a3e3fab5907b1fdd11ded2804d672124cf2d2d31 100644 (file)
@@ -27,7 +27,7 @@ notice identical to this one.
 Indirect:
 wget.info-1: 961
 wget.info-2: 48421
-wget.info-3: 96314
+wget.info-3: 96945
 \1f
 Tag Table:
 (Indirect)
@@ -61,28 +61,28 @@ Node: Startup File\7f57815
 Node: Wgetrc Location\7f58688
 Node: Wgetrc Syntax\7f59503
 Node: Wgetrc Commands\7f60218
-Node: Sample Wgetrc\7f67844
-Node: Examples\7f72863
-Node: Simple Usage\7f73470
-Node: Advanced Usage\7f75864
-Node: Guru Usage\7f78615
-Node: Various\7f80277
-Node: Proxies\7f80801
-Node: Distribution\7f83566
-Node: Mailing List\7f83917
-Node: Reporting Bugs\7f84616
-Node: Portability\7f86401
-Node: Signals\7f87776
-Node: Appendices\7f88430
-Node: Robots\7f88845
-Node: Introduction to RES\7f89992
-Node: RES Format\7f91885
-Node: User-Agent Field\7f92989
-Node: Disallow Field\7f93753
-Node: Norobots Examples\7f94364
-Node: Security Considerations\7f95318
-Node: Contributors\7f96314
-Node: Copying\7f98953
-Node: Concept Index\7f118116
+Node: Sample Wgetrc\7f68475
+Node: Examples\7f73494
+Node: Simple Usage\7f74101
+Node: Advanced Usage\7f76495
+Node: Guru Usage\7f79246
+Node: Various\7f80908
+Node: Proxies\7f81432
+Node: Distribution\7f84197
+Node: Mailing List\7f84548
+Node: Reporting Bugs\7f85247
+Node: Portability\7f87032
+Node: Signals\7f88407
+Node: Appendices\7f89061
+Node: Robots\7f89476
+Node: Introduction to RES\7f90623
+Node: RES Format\7f92516
+Node: User-Agent Field\7f93620
+Node: Disallow Field\7f94384
+Node: Norobots Examples\7f94995
+Node: Security Considerations\7f95949
+Node: Contributors\7f96945
+Node: Copying\7f99584
+Node: Concept Index\7f118747
 \1f
 End Tag Table
index c323b0e3b79b691e3aa6a84ef2868906cd9a3a91..474c32e7b974bb193b23040ed6c9e0b0a3d51a71 100644 (file)
@@ -333,15 +333,20 @@ File: wget.info,  Node: Wgetrc Commands,  Next: Sample Wgetrc,  Prev: Wgetrc Syn
 Wgetrc Commands
 ===============
 
-   The complete set of commands is listed below, the letter after `='
-denoting the value the command takes. It is `on/off' for `on' or `off'
-(which can also be `1' or `0'), STRING for any non-empty string or N
-for a positive integer.  For example, you may specify `use_proxy = off'
-to disable use of proxy servers by default. You may use `inf' for
-infinite values, where appropriate.
+   The complete set of commands is listed below.  Legal values are
+listed after the `='.  Simple Boolean values can be set or unset using
+`on' and `off' or `1' and `0'.  A fancier kind of Boolean allowed in
+some cases is the "lockable" Boolean, which may be set to `on', `off',
+`always', or `never'.  If an option is set to `always' or `never', that
+value will be locked in for the duration of the wget invocation -
+commandline options will not override.
 
-   Most of the commands have their equivalent command-line option
-(*Note Invoking::), except some more obscure or rarely used ones.
+   Some commands take pseudo-arbitrary values.  STRING values can be
+any non-empty string.  N can be any positive integer, or `inf' for
+infinity, where appropriate.
+
+   Most of these commands have commandline equivalents (*Note
+Invoking::), though some of the more obscure or rarely used ones do not.
 
 accept/reject = STRING
      Same as `-A'/`-R' (*Note Types of Files::).
@@ -501,8 +506,11 @@ page_requisites = on/off
      Download all ancillary documents necessary for a single HTML page
      to display properly - the same as `-p'.
 
-passive_ftp = on/off
-     Set passive FTP - the same as `--passive-ftp'.
+passive_ftp = on/off/always/never
+     Set passive FTP - the same as `--passive-ftp'.  Some scripts and
+     `.pm' (Perl module) files download files using `wget
+     --passive-ftp'.  If your firewall does not allow this, you can set
+     `passive_ftp = never' to override the commandline.
 
 passwd = STRING
      Set your FTP password to PASSWORD.  Without this setting, the
@@ -514,6 +522,11 @@ proxy_user = STRING
 proxy_passwd = STRING
      Set proxy authentication password to STRING, like `--proxy-passwd'.
 
+referer = STRING
+     Set HTTP `Referer:' header just like `--referer'.  (Note it was
+     the folks who wrote the HTTP spec who got the spelling of
+     "referrer" wrong.)
+
 quiet = on/off
      Quiet mode - the same as `-q'.
 
index 816e79eb36d8bb35ae03fac3f9c3527c6fe6464d..c492f0551a4144421816400141a1011c1309c44b 100644 (file)
@@ -1697,16 +1697,21 @@ reject =
 @section Wgetrc Commands
 @cindex wgetrc commands
 
-The complete set of commands is listed below, the letter after @samp{=}
-denoting the value the command takes. It is @samp{on/off} for @samp{on}
-or @samp{off} (which can also be @samp{1} or @samp{0}), @var{string} for
-any non-empty string or @var{n} for a positive integer.  For example,
-you may specify @samp{use_proxy = off} to disable use of proxy servers
-by default. You may use @samp{inf} for infinite values, where
-appropriate.
-
-Most of the commands have their equivalent command-line option
-(@xref{Invoking}), except some more obscure or rarely used ones.
+The complete set of commands is listed below.  Legal values are listed
+after the @samp{=}.  Simple Boolean values can be set or unset using
+@samp{on} and @samp{off} or @samp{1} and @samp{0}.  A fancier kind of
+Boolean allowed in some cases is the "lockable" Boolean, which may be
+set to @samp{on}, @samp{off}, @samp{always}, or @samp{never}.  If an
+option is set to @samp{always} or @samp{never}, that value will be
+locked in for the duration of the wget invocation -- commandline options
+will not override.
+
+Some commands take pseudo-arbitrary values.  @var{string} values can be
+any non-empty string.  @var{n} can be any positive integer, or
+@samp{inf} for infinity, where appropriate.
+
+Most of these commands have commandline equivalents (@xref{Invoking}),
+though some of the more obscure or rarely used ones do not.
 
 @table @asis
 @item accept/reject = @var{string}
@@ -1872,20 +1877,26 @@ Set the output filename -- the same as @samp{-O}.
 Download all ancillary documents necessary for a single HTML page to
 display properly -- the same as @samp{-p}.
 
-@item passive_ftp = on/off
-Set passive @sc{ftp} -- the same as @samp{--passive-ftp}.
+@item passive_ftp = on/off/always/never
+Set passive @sc{ftp} -- the same as @samp{--passive-ftp}.  Some scripts
+and @samp{.pm} (Perl module) files download files using @samp{wget
+--passive-ftp}.  If your firewall does not allow this, you can set
+@samp{passive_ftp = never} to override the commandline.
 
 @item passwd = @var{string}
 Set your @sc{ftp} password to @var{password}.  Without this setting, the
 password defaults to @samp{username@@hostname.domainname}.
 
 @item proxy_user = @var{string}
-Set proxy authentication user name to @var{string}, like
-@samp{--proxy-user}.
+Set proxy authentication user name to @var{string}, like @samp{--proxy-user}.
 
 @item proxy_passwd = @var{string}
-Set proxy authentication password to @var{string}, like
-@samp{--proxy-passwd}.
+Set proxy authentication password to @var{string}, like @samp{--proxy-passwd}.
+
+@item referer = @var{string}
+Set HTTP @samp{Referer:} header just like @samp{--referer}.  (Note it
+was the folks who wrote the @sc{http} spec who got the spelling of
+"referrer" wrong.)
 
 @item quiet = on/off
 Quiet mode -- the same as @samp{-q}.
index 54ccece33457fe9374b9575f0522ab43942cbf32..8bcf7308531a14361d69d8a7097aefa6e3c9a40c 100644 (file)
@@ -8,6 +8,9 @@
        the case of gethttp() called xrealloc() on u->local.
 
        * init.c (commands): Added new "htmlextension" command.
+       Also renamed John Daily's cmd_quad() to the more descriptive
+       cmd_lockable_boolean(), alpha-sorted the CMD_DECLARE()s and
+       removed duplicate cmd_boolean() declaration.
 
        * main.c (print_help): Added my new -E / --html-extension option.
        (main): Undocumented --email-address option previously used -E synonym.
                
        * main.c (print_help): Clarified what --retr-symlinks does.
        
+2000-09-15  John Daily  <jdaily@cyberdude.com>
+
+       * init.c: Add support for "always" and "never" values to allow
+       .wgetrc to override commandline (useful e.g. with .pm files
+       calling `wget --passive-ftp' when your firewall doesn't allow that).
+
+       * ftp.c (getftp): passive_ftp is first option to support always/never.
+
 2000-08-30  Dan Harkless  <dan-wget@dilvish.speed.net>
 
        * ftp.c (ftp_retrieve_list): Use new INFINITE_RECURSION #define.
index 1f65c254dd4b6bd804a36e52e7bd339f281ab009..bfb4e0284d6f2a4d9f605bb1369bd47ac6c71f65 100644 (file)
--- a/src/ftp.c
+++ b/src/ftp.c
@@ -337,7 +337,7 @@ Error in server response, closing control connection.\n"));
   /* If anything is to be retrieved, PORT (or PASV) must be sent.  */
   if (cmd & (DO_LIST | DO_RETR))
     {
-      if (opt.ftp_pasv)
+      if (opt.ftp_pasv > 0)
        {
          char thost[256];
          unsigned short tport;
index 874e05a9162a6090493b72bea1a70e30397a11b5..b1169b23d8fd8ecce1b6daa0adbac15e00680de3 100644 (file)
@@ -53,14 +53,14 @@ extern int errno;
   PARAMS ((const char *, const char *, void *))
 
 CMD_DECLARE (cmd_boolean);
-CMD_DECLARE (cmd_boolean);
+CMD_DECLARE (cmd_bytes);
+CMD_DECLARE (cmd_directory_vector);
+CMD_DECLARE (cmd_lockable_boolean);
 CMD_DECLARE (cmd_number);
 CMD_DECLARE (cmd_number_inf);
 CMD_DECLARE (cmd_string);
-CMD_DECLARE (cmd_vector);
-CMD_DECLARE (cmd_directory_vector);
-CMD_DECLARE (cmd_bytes);
 CMD_DECLARE (cmd_time);
+CMD_DECLARE (cmd_vector);
 
 CMD_DECLARE (cmd_spec_dirstruct);
 CMD_DECLARE (cmd_spec_dotstyle);
@@ -131,7 +131,7 @@ static struct {
   { "numtries",                &opt.ntry,              cmd_number_inf },/* deprecated*/
   { "outputdocument",  NULL,                   cmd_spec_outputdocument },
   { "pagerequisites",  &opt.page_requisites,   cmd_boolean },
-  { "passiveftp",      &opt.ftp_pasv,          cmd_boolean },
+  { "passiveftp",      &opt.ftp_pasv,          cmd_lockable_boolean },
   { "passwd",          &opt.ftp_pass,          cmd_string },
   { "proxypasswd",     &opt.proxy_passwd,      cmd_string },
   { "proxyuser",       &opt.proxy_user,        cmd_string },
@@ -499,6 +499,51 @@ cmd_boolean (const char *com, const char *val, void *closure)
   return 1;
 }
 
+/* Store the lockable_boolean {2, 1, 0, -1} value from VAL to CLOSURE.  COM is
+   ignored, except for error messages.  Values 2 and -1 indicate that once
+   defined, the value may not be changed by successive wgetrc files or
+   command-line arguments.
+
+   Values: 2 - Enable a particular option for good ("always")
+           1 - Enable an option ("on")
+           0 - Disable an option ("off")
+          -1 - Disable an option for good ("never") */
+static int
+cmd_lockable_boolean (const char *com, const char *val, void *closure)
+{
+  int lockable_boolean_value;
+
+  /*
+   * If a config file said "always" or "never", don't allow command line
+   * arguments to override the config file.
+   */
+  if (*(int *)closure == -1 || *(int *)closure == 2)
+    return 1;
+
+  if (!strcasecmp (val, "always")
+      || (*val == '2' && !*(val + 1)))
+    lockable_boolean_value = 2;
+  else if (!strcasecmp (val, "on")
+      || (*val == '1' && !*(val + 1)))
+    lockable_boolean_value = 1;
+  else if (!strcasecmp (val, "off")
+          || (*val == '0' && !*(val + 1)))
+    lockable_boolean_value = 0;
+  else if (!strcasecmp (val, "never")
+      || (*val == '-' && *(val + 1) == '1' && !*(val + 2)))
+    lockable_boolean_value = -1;
+  else
+    {
+      fprintf (stderr, _("%s: %s: Please specify always, on, off, "
+                        "or never.\n"),
+              exec_name, com);
+      return 0;
+    }
+
+  *(int *)closure = lockable_boolean_value;
+  return 1;
+}
+
 /* Set the non-negative integer value from VAL to CLOSURE.  With
    incorrect specification, the number remains unchanged.  */
 static int