# Setting MASTER_SITE_* automatically in make,conf



## SIFE (Apr 9, 2011)

As the title said, I can see a bunch of them in /usr/ports/MK/bsd.site.mk, and want to set them in /etc/make.conf. so later I chose the nearest mirrors to me, is there any port do that?


----------



## DutchDaemon (Apr 10, 2011)

ports-mgmt/fastest_sites

http://www.semicomplete.com/blog/geekery/freebsd-ports-master-sites-sorting.html

Put in crontab like this:

```
0 6 * * *       /usr/local/bin/fastest_sites > /usr/local/etc/ports_sites.conf
```

Call in /etc/make.conf like this:

```
.include "/usr/local/etc/ports_sites.conf"
```


----------



## Galactic_Dominator (Apr 10, 2011)

doesn't work here

```
<snip>
 => Checking servers for MASTER_SITE_EXIM (44 servers)
Traceback (most recent call last):
  File "/usr/local/bin/fastest_sites", line 164, in <module>
    latency_list = FindFastest(varname, sitelist)
  File "/usr/local/bin/fastest_sites", line 110, in FindFastest
    AsyncConnect(url, callback)
  File "/usr/local/bin/fastest_sites", line 53, in __init__
    self.ParseURL()
  File "/usr/local/bin/fastest_sites", line 67, in ParseURL
    self._port = AsyncConnect.schemes[scheme]
KeyError: 'Ftp'
```

Maybe I'll dig into it later.


----------



## jgh@ (Apr 10, 2011)

Galactic_Dominator said:
			
		

> doesn't work here
> 
> ```
> <snip>
> ...



Update your portstree. This was addressed in revision 1.534 commit of Mk/bsd.sites.mk
http://www.freebsd.org/cgi/cvsweb.cgi/ports/Mk/bsd.sites.mk.diff?r1=1.533;r2=1.534;sortby=date


----------

