Subject: pkg/11028: pkgsrc: broken patch to wget
To: None <gnats-bugs@gnats.netbsd.org>
From: Eric Mumpower <nocturne@arepa.com>
List: netbsd-bugs
Date: 09/15/2000 23:35:12
>Number:         11028
>Category:       pkg
>Synopsis:       Patch to wget breaks -I flag
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 15 23:36:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Eric Mumpower
>Release:        Stock 1.4.1 base install <NetBSD-current source date>
>Organization:
Arepa
	
>Environment:
	
System: NetBSD dr-teeth 1.4.1 NetBSD 1.4.1 (TEETH) #1: Fri Sep 15 18:27:55 EDT 2000 nocturne@dr-teeth:/usr/src/sys/arch/i386/compile/TEETH i386


>Description:
Someone wasn't paying adequately close attention when they wrote the IPv6
patch to wget, I guess. They broke the '-I' flag due to a mis-alphabetization.
Function init.c:comind() requires the commands[] structure to be strictly
alphabetized, which it isn't after the application of wget's patch-ae.

>How-To-Repeat:
Build and install wget from the -current pkgsrc release.
Run "wget -I foo http://www.mit.edu", note the error you get:
 "get: BUG: unknown command `includedirectories', value `foo'."
	
>Fix:
Note that init.c EXPLICITLY documents itself to indicate that additions to
commands[] must be made *alphabetically*. wget/patches/patch-ae ignores this,
or else was written by someone with an inadequate knowledge of ASCII
alphabetization, as it files "inet" and "inet6" *before* "includedirectories".

The correct fix is to change patch-ae to something like this:

*** init.c.orig Thu Sep 10 20:20:23 1998
--- init.c      Sat Sep 16 02:31:41 2000
***************
*** 114,119 ****
--- 114,121 ----
    { "httpuser",               &opt.http_user,         cmd_string },
    { "ignorelength",   &opt.ignore_length,     cmd_boolean },
    { "includedirectories", &opt.includes,      cmd_directory_vector },
+   { "inet",           &opt.inet,              cmd_boolean },
+   { "inet6",          &opt.inet6,             cmd_boolean },
    { "input",          &opt.input_filename,    cmd_string },
    { "killlonger",     &opt.kill_longer,       cmd_boolean },
    { "logfile",                &opt.lfilename,         cmd_string },

>Release-Note:
>Audit-Trail:
>Unformatted: