Before I got delayed and my JSAN timeslice ended, I had a work in
progress to automate mirror selection.
The idea was to write a single small file into the repository containing
the index build time and the name of the mirror.
So something like
mirror: openjsan.org
created: $iso_utc_timestamp
This served three purposes.
1. Validate a JSAN mirror URI
You just appended $URI/mirror.conf, and tried to GET it. If the content
of the file was correct, the URI was valid
2. Determine the age of the mirror
Diff the current time to the timestamp in the file. If older than a
certain threshold (say, 1 week in the CPAN case) you then know the
mirror has gone stale.
3. Determine the fastest mirror.
Given a arbitrary list of mirror, you can hit each one in turn and pull
the file. The amount of time it takes to pull the file gives you some
comparison of the speed of the repository. Then taking the top $few, you
pull a slightly larger file, say 50k or so, to find the best mirror in
terms of sustained speed.
-----------
While I haven't got another timeslice yet available for the JSAN client
to finish this, you could fairly easily write this in a reusable way.
Say, Mirror::Select?
Adam K
Tyler MacDonald wrote:
Randy W. Sims <[EMAIL PROTECTED]> wrote:
This is a problem with CPAN.pm as well; if you try to do the initial
setup with PERL_MM_USE_DEFAULT=1, it loops forever on the "Select a mirror"
prompt. :-/ I've been meaning to discuss this more / submit a patch, but my
backlog has been insane lately...
We can:
die "ERROR: This build script not safe for unattended installs. Please
notify @{[$self->dist_author]} that they wrote a bad bad Build.PL.
Please ask them to provide reasonable defaults or switch to the new
ask() method."
if $ENV{PERL_MM_USE_DEFAULT}
&& (called_without_default(y_n) || called_without_default(prompt);
Sure. What I really want though, is for CPAN.pm to be totally
automatable. If you want a good chuckle, check out the attached
hackety-hackety-hack I whipped together one afternoon to do an autobuild;
the scary thing is it actually works. <g>
- Tyler