# Why are the mirrors for ports so far away?



## Dillweed (Sep 5, 2009)

It's me again. I just have a quick question or observation about mirrors that are found within the makefile's of various ports. To me it seems that a lot of the Makefiles have mirror lists that really don't contain many mirrors. I have tried setting MASTER_SORT_REGEX? but it doesn't really help with the Makefile only has a two mirrors for the file that needs to be compiled and those mirrors are not accounted for in my MASTER_SORT_REGEX? list. 

I know this is all relative, because the maintainer is going to use something close to home. However, it seems to me that there should be more options when it comes to mirrors and ports. 

I guess I could be missing something, because I usually am, but then again I'm still learning so be gentle.


----------



## dennylin93 (Sep 5, 2009)

Dillweed said:
			
		

> I know this is all relative, because the maintainer is going to use something close to home. However, it seems to me that there should be more options when it comes to mirrors and ports.



I believe that the maintainer usually sets the "master site" (the official site of the port) as the first one.

You can use mirrors close to home. Just put this in /etc/make.conf (remember to change the country code):

```
MASTER_SITE_BACKUP?= \
ftp://ftp.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp2.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp4.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
ftp://ftp4.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/ \
${MASTER_SITES:S/%SUBDIR%/${MASTER_SITE_SUBDIR}/}

MASTER_SITE_OVERRIDE?= ${MASTER_SITE_BACKUP}
```


----------



## aragon (Sep 5, 2009)

Each port's source is hosted differently so it's pretty hard for the FreeBSD project and port maintainers to account for mirrors in every part of the world.

For popular source distribution sites it is possible to customise ports to use local mirrors.  In my case I run my own list of master sites for South Africans, but even those don't allow for all my ports sources to get locally downloaded.  If some guy writes a piece of software that is only served from his own machine, there's no way ports can fetch it from somewhere else...


----------

