]> git.saurik.com Git - apt.git/blob - cmdline/apt-report-mirror-failure
277b23e9a146fc4367c0ebe4a10cc396725c72eb
[apt.git] / cmdline / apt-report-mirror-failure
1 #!/usr/bin/python
2
3 import sys
4 import urllib
5 import apt_pkg
6
7 apt_pkg.init()
8 url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures",
9 "http://people.ubuntu.com:9000/mirror-failure")
10 #"http://localhost:9000/mirror-failure")
11 if not url:
12 sys.exit(0)
13
14 print "Reporting mirror failure to '%s'" % url
15
16 data = {}
17 data['url'] = sys.argv[1]
18 data['error'] = sys.argv[2]
19 f = urllib.urlopen(url, urllib.urlencode(data))
20 f.read()
21 f.close()
22
23