From 30097eb0ca355c6c1b2fe8308badeb68097c4aff Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Sun, 7 Jun 2009 22:38:25 -0300 Subject: utils/get_debian_mirrors.py: updated to support current mirror page. --- utils/get_debian_mirrors.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'utils') diff --git a/utils/get_debian_mirrors.py b/utils/get_debian_mirrors.py index 2e3c7296..9fb783bd 100755 --- a/utils/get_debian_mirrors.py +++ b/utils/get_debian_mirrors.py @@ -5,7 +5,7 @@ # Download the latest list with available mirrors from the Debian # website and extract the hosts from the raw page # -# Copyright (c) 2006 Free Software Foundation Europe +# Copyright (c) 2006, 2009 Free Software Foundation Europe # # Author: Sebastian Heinlein # @@ -37,7 +37,8 @@ list_path = "../data/templates/Debian.mirrors" req = urllib2.Request("http://www.debian.org/mirror/mirrors_full") match = re.compile("^.*>([A-Za-z0-9-.\/_]+)<\/a>.*\n$") -match_location = re.compile('^.*') +match_location = re.compile('^

.*') +match_sites = re.compile('^Site: ([A-Za-z0-9-.\ \/_,]+)<\/tt>.*\n$') def add_sites(line, proto, sites, mirror_type): @@ -50,15 +51,15 @@ try: print "Downloading mirrors list from the Debian website..." uri=urllib2.urlopen(req) for line in uri.readlines(): - if line.startswith('Packages over HTTP'): add_sites(line, "http", sites, mirrors) - elif line.startswith('Packages over FTP'): + elif line.startswith('
Packages over FTP'): add_sites(line, "ftp", sites, mirrors) uri.close() except: -- cgit v1.2.3