tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: "sa-update" in SpamAssassin 3.4.0

On Sat, Apr 26, 2014 at 07:13:15AM -0400, D'Arcy J.M. Cain wrote:
> > # Do a GET request via HTTP for a given URL using an external program,
> > # or fall back to LWP if no external downloading program is available.
> Looks like there is a fallback if no external programs are loaded.

Yes, I know.

> > # Use the optional time_t value to do an IMS GET
> > sub http_get {
> > [...]
> >   foreach my $try_prog ('curl', 'wget', 'fetch') {
> >     $cmd =
> > Mail::SpamAssassin::Util::find_executable_in_env_path($try_prog); if
> > (defined $cmd && $cmd ne '') { $ext_prog = $try_prog; last } }
> > [...]
> > 
> > So basically it checks for a bunch of external programs and uses them
> > if available. If none can be found it uses the Perl library.
> > 
> > The result on my system is that it uses "curl" because that is
> > installed anyway. What would be the appropriate way to handle this?
> > Should I add a dependence on "curl" to get predictable behaviour?
> Does using wget, fetch or the builtin function break something?

I don't think so.

> What does "predictable" buy you in this case?

It might avoid subtle e.g. proxy support or IPv6 support/preference
which could cause the same binary package to work on one system
which has "curl" installed and fail on another system which
doesn't have "curl" installed.

I'm currently leaning toward using "TOOLS.curl" or "TOOLS.fetch" if set
and otherwise use the "wget" package (which has less dependences than
the "curl" package").

        Kind regards

Matthias Scheler                       

Home | Main Index | Thread Index | Old Index