[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

adding cdn.debian.net to Mirrors.masterlist



cdn.debian.net seems to work well, but cannot easily be selected in d-i
or seen at http://www.debian.org/mirrors/list because it is not in
Mirrors.masterlist. Below is an entry that I propose adding for it. 

Since some of the mirrors used are Push-Primary, while others are Leaf,
using "Type: GeoIP" seemed the best way to indicate it. The list of
countries comes from https://osdn.debian.or.jp/repos/cdn/trunk/country/
and is useful to only have cdn.debian.net be listed for countries that
it supports.

It won't appear on the web page (or in choose-mirror) without some
additional patching. The attached patch makes GeoIP mirrors be listed
as a mirror for each country they support.

Site: cdn.debian.net
Type: GeoIP
Countries: AU AT BE BG BR CA CH CZ DE DK ES EE FI FR GB GR HR HU IE IS IT JP KR MX NL NZ PL PT RO RU SK SI SE TH TR TW US VE ZA
Archive-architecture: alpha amd64 arm armel hppa hurd-i386 i386 ia64 kfreebsd-i386 kfreebsd-amd64 mips mipsel powerpc s390 sparc
Archive-http: /debian/
Archive-upstream: ftp-master.debian.org
IPv6: no
Comment: Automatically selects geographically close, load balanced mirror
 from a pool of mirrors that are tested frequently to ensure they are
 healthy. Details: http://wiki.debian.org/DebianGeoMirror

-- 
see shy jo
Index: mirror_list.pl
===================================================================
RCS file: /cvs/webwml/webwml/english/mirror/mirror_list.pl,v
retrieving revision 1.140
diff -u -r1.140 mirror_list.pl
--- mirror_list.pl	3 May 2009 21:18:57 -0000	1.140
+++ mirror_list.pl	29 May 2010 23:04:12 -0000
@@ -1698,6 +1698,20 @@
 # but this would be fairly tedious and hardcoded, for no apparent reason
 # because we use this in mirror_sponsors() which doesn't really care
     }
+  } elsif ($mirror[$id]{type} =~/GeoIP/i) {
+    # For GeoIP, explode Countries field so it is listed as a mirror
+    # for each country it supports.
+    foreach my $code_of_country (split(' ', $mirror[$id]{countries})) {
+	my $country;
+	foreach my $key (keys %code_of_country) {
+		if ($code_of_country{$key} eq $code_of_country) {
+			$country=$key;
+		}
+	}
+	if (defined $country) {
+	    	push @{ $countries{ $country } }, $id;
+	}
+    }
   } else {
     warn "found a mirror without a country, wtf? " . $mirror[$id]{site};
   }

Attachment: signature.asc
Description: Digital signature


Reply to: