diff options
author | James A. Treacy <treacy> | 2001-04-25 03:03:40 +0000 |
---|---|---|
committer | James A. Treacy <treacy> | 2001-04-25 03:03:40 +0000 |
commit | d5f8166eaf82ade6df2b5d6543327d2570e3ea07 (patch) | |
tree | 8c485ec1d0786c0a8f9d01e8a2a9b1decb68c773 /english/mirror/timestamps | |
parent | c3b1fd78de004f84b9ec9548fd588e69dfa68a78 (diff) |
updates to handle more broken sites
CVS version numbers
english/mirror/timestamps/archive_mirror_check.py: 1.3 -> 1.4
Diffstat (limited to 'english/mirror/timestamps')
-rwxr-xr-x | english/mirror/timestamps/archive_mirror_check.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/english/mirror/timestamps/archive_mirror_check.py b/english/mirror/timestamps/archive_mirror_check.py index 64a89959184..7ea4d88ca79 100755 --- a/english/mirror/timestamps/archive_mirror_check.py +++ b/english/mirror/timestamps/archive_mirror_check.py @@ -29,6 +29,7 @@ def process_line(line): def check_site(url, uplink): #mirror = 'http://' + site + '/mirror/timestamps/' print mirror + sys.stdout.flush() try: parts = urlparse.urlparse(mirror) h = httplib.HTTP(parts[1]) @@ -52,8 +53,11 @@ def check_site(url, uplink): links = parse.anchorlist # typical list is # ['?N=D', '?M=A', '?S=A', '?D=A', '/mirror/', 'klecker.debian.org'] - while links[0] != uplink: + while links and links[0] != uplink: links.pop(0) + if not links: + print ' Problem with page' + return links.pop(0) urls = {} for url in parse.anchorlist: @@ -82,6 +86,7 @@ def check_site(url, uplink): tmp.sort() for times in tmp: print urls[times] + sys.stdout.flush() site = {} sitenotempty = 0 @@ -92,7 +97,8 @@ while 1: if (newline == '\n' or newline == '') and sitenotempty: process_line(line) # print " site = " + site + " and archhttp = " + archhttp - if site.has_key('site') and site.has_key('archive-http') and official.search(site['site']): + if site.has_key('site') and site.has_key('archive-http'): + # and official.search(site['site']): mirror = 'http://' + site['site'] + site['archive-http'] + 'project/trace/' check_site(mirror, site['archive-http'] + 'project/') if site.has_key('maintainer'): |