Subject: Re: CVS commit: pkgsrc
To: SUNAGAWA Keiki <kei_sun@ba2.so-net.ne.jp>
From: Frederick Bruckman <fredb@immanent.net>
List: pkgsrc-changes
Date: 06/23/2002 11:47:19
On Mon, 24 Jun 2002, SUNAGAWA Keiki wrote:

> fredb@immanent.net (Frederick Bruckman) wrote:
>
> Thomas> Why is this necessaty?
>
> >> Possibly to make the MASTER_SITES of mozilla
> >> customizable?
>
> Frederick> There's a more natural way to do this. The
> Frederick> japanese mirror isn't even one of MASTER_SITES of
> Frederick> mozilla by default, so the casual user won't even
> Frederick> know the capability is there.
>
> A lot of numbers of site mirrers mozilla.  I don't want to
> adding more ~70 lines to Makefile, do you? ...

> Second, I'm afraid that adding .jp sites to MASTER_SITES of
> default mk file makes some more traffic in other countries.

Only a little. The sites won't be hit unless all sites earlier in the
list fail, and... it's a public mirror, isn't it? 70 is too much,
though -- be judicious. When I go hunting for mirrors, I try to pick
sites that that have principle national suffixes in the host name (for
MASTER_SORT), some http://, some ftp://, sites that can be connected
to easily, and preferring sites that are listed first on the package's
web site.

> >> How about that all MASTER_SITES can be overrided by
> >> MASTER_SITES.whatever?
>
> Frederick> Not necessary. See the descriptions for
> Frederick> MASTER_SORT and MASTER_SORT_REGEX in
> Frederick> "bsd.pkg.defaults.mk". Moreover, I can't imagine
> Frederick> anybody wanting to set a URI for every single
> Frederick> package.  Can you? If it comes to that, the user
> Frederick> can download into "distfiles" by
> Frederick> hand. MASTER_SORT is way better, because it
> Frederick> applies generally to all packages.
>
> Does MASTER_SORT work even if the directory hierarchy are
> different in between each mirror sites?

Yes. It simply re-orders the MASTER_SITES, based on user preferences.

> MASTER_SORT*
> changes global behavior of the pkgsrc system as you said.  I
> don't want that change, so decided to hack the Makefile of
> mozilla package.  In this case, my point is the size of the
> distribution.

But you also made a global change, (apparently) for the benefit of a
single package. That's the only issue.

> Frederick> What you really want, I think, is accomplished by
> Frederick> setting `MASTER_SORT=.jp' and adding the ".jp"
> Frederick> mirrors to ${MASTER_SITES}. I don't see any
> Frederick> reason why all known (working) mirrors shouldn't
> Frederick> be added to MASTER_SITES, as the mirrors at the
> Frederick> bottom of the list would rarely get hit unless
> Frederick> the user sets MASTER_SORT or MASTER_SORT_REGEX
> Frederick> anyway.
>
> Simply adding mirror sites to Makefile or anywhere doesn't
> provide flexibility to user.  Per-package based
> customisability is not so bad thing to have, I guess.

Actually, it does add flexibility to the user. It allows MASTER_SORT
and MASTER_SORT_REGEX to work correctly. At the single package level,
there's no more flexible way than to download the distfile into
${_DISTDIR} yourself. What MASTER_SORT does, is provide that
flexibility *without* *continued* *supervision*.

> Frederick> So, if japanese mirror is added to mozilla's
> Frederick> MASTER_SITES, then MASTER_SITE_MOZILLA becomes
> Frederick> unnecessary.
>
> Well, I won't insist on my change if my question is solved.

I think you were not aware of MASTER_SORT and MASTER_SORT_REGEX. I
suggest you play with it a little, and see if it does what you need,
then rethink how to handle mozilla's mirrors.

Frederick