On 2015-12-27, Raf Czlonka <[email protected]> wrote:
> On Sun, Dec 27, 2015 at 01:58:53AM GMT, Luke Small wrote:
>
>> Come to think about it, it might to be good to do tiny standalone
>> program called pkg_ping and then I could make it in C like I'd prefer.
>> I'd hope to make a port maybe, but then it would functionally defeat
>> the intent.
>
> I think you're wasting your time and skills - a service akin to Debian's
> redirector[0] would be much better!
>
> Raf
>
> [0] http://httpredir.debian.org/

This would work for releases, though unless pkg_add was changed to cache
the redirect it would slow things down compared to fetching directly from
the mirror.

For snapshots, caching the redirect would be essential, otherwise it
could switch mirror mid-update, and it is common that mirrors are not all
in-sync.

Caching the redirect is a bigger change than it seems because pkg_add
doesn't have its own network code but defers to $FETCH_CMD which could
be one of a number of programs.

(yes this has been thought about already :)

I think the best that can be done relatively easily would be to have
pkg_add fetch ftplist.cgi and pick the first result as a default if
neither pkg.conf nor PKG_PATH are set.

Reply via email to