Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Oct 1997 13:23:12 +0100
From:      Gareth McCaughan <gjm11@dpmms.cam.ac.uk>
To:        freebsd-ports@freebsd.org
Subject:   Automating use of FTP mirror sites
Message-ID:  <E0xGkHg-0002sc-00@g.pet.cam.ac.uk>

next in thread | raw e-mail | index | archive | help
When you `make install' a port and don't already have the tarball,
bsd.port.mk tries each of the MASTER_SITES in the order given in
the makefile. The trouble with this is that the order given in the
makefile need not be a good order for the user; for instance, I'm
in the UK and sites on the other side of the Atlantic tend to be,
well, pretty unsatisfactory...

So, I have a little Perl script that takes a list of ftp: URLs,
consults a table of FTP mirroring relationships and another table
of good and bad places to get files from, and spits out a list
of ftp: URLs that (1) contains all the original places, (2) also
contains all known mirror sites for them, and (3) arranges them
in order of preference.

I've hacked my bsd.port.mk so that instead of 
  for site in ${MASTER_SITES}; do
it says
  for site in $$(ftp-equiv ${MASTER_SITES}); do
and likewise for PATCH_SITES.

I think it would be good to have a facility of this sort in FreeBSD
by default, although of course maintaining the list of useful mirrors
and preferred places would probably have to be a matter for the
individual user. If others agree, the FreeBSD project is welcome
to use my script.

Here's what the relevant files look like, which should give some
idea of how the thing works.

--------------------- equivalences file begins ---------------------
# Firstly, aliases.

ftp.uk.freebsd.org  -> sunsite.doc.ic.ac.uk
ftp2.uk.freebsd.org -> unix.hensa.ac.uk
ftp3.uk.freebsd.org -> ftp.demon.co.uk

# FreeBSD.

ftp.freebsd.org /pub/FreeBSD  ftp.uk.freebsd.org  /packages/FreeBSD
ftp.freebsd.org /pub/FreeBSD  ftp2.uk.freebsd.org /mirrors/FreeBSD
ftp.freebsd.org /pub/FreeBSD  ftp3.uk.freebsd.org /pub/mirrors/FreeBSD

# GNU.

prep.ai.mit.edu /pub/gnu  sunsite.doc.ic.ac.uk /gnu
---------------------- equivalences file ends ----------------------

---------------------- preferences file begins ----------------------
# FTP preferences.

.cam.ac.uk
.ac.uk
.co.uk
.uk
OTHERS
.jp
----------------------- preferences file ends -----------------------

(Incidentally, I haven't actually checked whether Japanese sites are
worse than random other sites. The .jp entry is a legacy from when I
was checking that the script did the right thing.)

Comments?

I'm not a subscriber to -ports, so any mail should be sent to me
as well as to the list if you want me to read it.

-- 
Gareth McCaughan       Dept. of Pure Mathematics & Mathematical Statistics,
gjm11@dpmms.cam.ac.uk  Cambridge University, England.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E0xGkHg-0002sc-00>