Subject: Re: How to force pkgsrc FTP to use active?
To: David Hopper <dhop@nwlink.com>
From: Frederick Bruckman <fredb@immanent.net>
List: tech-pkg
Date: 06/04/2002 21:35:28
On Tue, 4 Jun 2002, David Hopper wrote:

> Frederick Bruckman wrote:
> >
> > On Tue, 4 Jun 2002, David Hopper wrote:
> >
> > > How do I force active connections in pkgsrc?
> >
> > In "/etc/mk.conf", set
> >
> > FETCH_CMD=      /usr/bin/ftp -A
>
> Okay, this is weird.  I even edited
> /usr/pkgsrc/mk/[bsd.pkg.mk|bsd.pkg.defaults.mk] directly to add
> /usr/bin/ftp -A to the FETCH_CMD?= lines.  Still no go, and ftp just
> won't fall back to active mode per the behavior described in
> Packages.txt.

Well, that may be, but setting FETCH_CMD as above will use "ftp -A" to
do the fetching. It's possible that "ftp -A" is broken lately -- what
happens when you invoke "ftp -A _URI_" manually?

I know for a fact that "lynx" uses active mode by default, unless you
have set `FTP_PASSIVE:TRUE' in ${LYNX_CFG}. To see if "lynx" works any
better, try

FETCH_CMD=	/usr/pkg/bin/lynx -source

assuming "lynx" is installed, of course.

> There's a config file I'm missing, but the only file I've found with
> /usr/bin/ftp defined is /usr/pkgsrc/mk/bsd.pkg.mk.  What's the read
> precedence for the various .mk files?  My guess is /etc/mk.conf -->
> /usr/pkgsrc/mk/bsd.pkg.defaults.mk --> /usr/pkgsrc/mk/bsd.pkg.mk.  Are
> there any others?

FYI, the pkgsrc makefiles all include bsd.pkg.mk, which include
bsd.prefs.mk near the top; bsd.prefs.mk includes bsd.own.mk, which
includes ${MAKECONF}, then includes bsd.pkg.defaults.mk. ${MAKECONF}
or "/etc/mk.conf" actually gets included before almost any variables
are set. Anything "set" later with `?=' will not override the earlier
setting. I'm quite sure that "pkgsrc" isn't the problem, BTW...

I have this:

FETCH_CMD=              /usr/bin/ftp -T get,10000,1000

in "/etc/mk.conf", and "make fetch" clearly says "Get transfer rate
throttle: on;  maximum: 10000; increment 1000.", so it's evident that
it's working as intended.

Frederick