ports/128754: [port infrastructure] implement master sites randomization

RW fbsd06 at mlists.homeunix.com
Mon Nov 10 19:39:42 PST 2008

On Mon, 10 Nov 2008 18:56:16 +0300 (MSK)
Eygene Ryabinkin <rea-fbsd at codelabs.ru> wrote:

> Today I was hit by the very bad connectivity with twaren.net and
> nchc.dl.sourceforge.net (the first site in the SF mirrors list in the
> FreeBSD ports .mk files) is hosted by Taiwan REN.  So, I decided to
> implement simple randomization that will enable to evenly distribute
> the downloads between SF mirrors.

> ...
> +# Need to drop a couple of initial rand() values: they tend
> +# to be around 0.8 - 0.9, so for fairly small array lenght
> +# they will produce identical values at the beginning.
> +	srand(); rand(); rand(); rand(); rand();

I think it would be sensible to seed srand from a hash of something
reproducible to make better use of caches - maybe DISTNAME+DISTVERSION.

More information about the freebsd-ports mailing list