To: None <>
From: Andrew Brown <>
List: tech-pkg
Date: 03/15/2002 13:44:39
i wanted to reclaim some disk space on my laptop, so i moved *all* my
distfiles over to another machine that has more space, but is less
portable.  then i started reinstalling all my pkgs.  setting
MASTER_SITE_OVERRIDE makes this easier, since i can get the "still
current" tar balls from somewhere local instead of wasting time
downloading them all again.

but i don't want to try to get them from my home machine if i'm not at
home.  in fact, in some places, there are other "local repositories"
of tarballs that i can snarf from.  i came up with a solution and i
thought i'd share it, in case any of you can win from this.  in my
/etc/mk.conf file, in the BSD_PKG_MK section, i put this:

	__GATEWAY!=route -ns get default
	.if   (${__GATEWAY} == "")
	MASTER_SITE_OVERRIDE=   ftp://duke/distfiles/
	.elif (${__GATEWAY} == "")
	.elif (${__GATEWAY} == "")

yes, i number things strangely.  that's not the point.  caveat: the
the -s option to route has only been in -current since last october.
for releases and for -current for before that.  for those people

	__GATEWAY!=route -n get default | awk '$1=="gateway:"{print$2}'

ought to work fine.

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."