summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-02-06 15:04:47 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-02-06 15:04:47 +0100
commita577a938d4b957b5462a830b21d509fa754b33d5 (patch)
treefd3ab848593a0818ae5be30508b6a469557d9a1a /cmdline
parent78a9df8a467d9f240df81c236f233a38f450e60a (diff)
parent39e1be0ff93e3084b7cb98b6a7d0c272a8b296b0 (diff)
* merged the apt--mirror branch
Diffstat (limited to 'cmdline')
-rwxr-xr-xcmdline/apt-report-mirror-failure24
-rw-r--r--cmdline/makefile6
2 files changed, 30 insertions, 0 deletions
diff --git a/cmdline/apt-report-mirror-failure b/cmdline/apt-report-mirror-failure
new file mode 100755
index 000000000..1567e78e3
--- /dev/null
+++ b/cmdline/apt-report-mirror-failure
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+
+import sys
+import urllib
+import apt_pkg
+
+apt_pkg.init()
+url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", None)
+ #"http://people.ubuntu.com:9000/mirror-failure")
+ #"http://localhost:9000/mirror-failure")
+if not url:
+ sys.exit(0)
+
+print "Reporting mirror failure to '%s'" % url
+
+data = {}
+data['mirror'] = sys.argv[1]
+data['failurl'] = sys.argv[2]
+data['error'] = sys.argv[3]
+f = urllib.urlopen(url, urllib.urlencode(data))
+f.read()
+f.close()
+
+
diff --git a/cmdline/makefile b/cmdline/makefile
index 49035be44..2a5bdfbea 100644
--- a/cmdline/makefile
+++ b/cmdline/makefile
@@ -58,3 +58,9 @@ SOURCE=apt-mark
TO=$(BIN)
TARGET=program
include $(COPY_H)
+
+# The apt-key program
+SOURCE=apt-report-mirror-failure
+TO=$(BIN)
+TARGET=program
+include $(COPY_H)