Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Mar 1997 13:16:00 +0000
From:      Gareth McCaughan <gjm11@dpmms.cam.ac.uk>
To:        freebsd-hackers@freebsd.org
Subject:   Making port downloading nicer
Message-ID:  <E0w4RPN-0001Ol-00@g.pet.cam.ac.uk>

next in thread | raw e-mail | index | archive | help
I'm not entirely sure whether this belongs in freebsd-ports
or freebsd-hackers. Since I read -hackers and not -ports,
that's where I'm sending it. Flame me if appropriate.

When you do "make install" on a port whose tarball you don't
already have, the ports makefile very kindly downloads the
port from one of the entries in its MASTER_SITES list. This
is fine, but of course these entries are never in the order
you want them to be in. At least, if they're in the order
*you* want them to be in, they're probably not in the order
*I* want to be in (since I'm in the UK).

To deal with this problem and make downloading ports less
painful, I have hacked up a simple-minded Perl script that
does the following.

  You give it a list of ftp URLs.

  It reads two configuration files.

    The first one contains entries that say "This lump
    of this FTP site is the same as that lump of that
    FTP site", and entries that say "This FTP site is
    actually just another name for that FTP site".

    The second one contains entries that say "I like
    FTP sites in this DNS domain better than FTP sites
    in that DNS domain".

  It replaces each URL with all the equivalent URLs it
  knows about (using the entries from the first file),
  canonicalising (using the second kind of entries from
  the first file) and removing duplicates.

  It sorts them into order of preference, using the entries
  from the second file.

  It spits out the resulting list of URLs.

Making bsd.port.mk use this program is, of course, a one-line
change.

As yet it is not thoroughly tested; but I use it on my machine,
and it appears to work well. Is there general interest in this?
If so, should I post the program and some sample config files
here, or what? (The program is about 150 lines long, many of
them comments.)

-- 
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?E0w4RPN-0001Ol-00>