summaryrefslogtreecommitdiffstats
path: root/cmdline/apt-report-mirror-failure
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:59:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 09:59:37 +0000
commit76e2632459410dec81337edb6a9fee33c9a660f3 (patch)
treea73345df208eede4a4daad340515c9328f34625c /cmdline/apt-report-mirror-failure
parentInitial commit. (diff)
downloadapt-76e2632459410dec81337edb6a9fee33c9a660f3.tar.xz
apt-76e2632459410dec81337edb6a9fee33c9a660f3.zip
Adding upstream version 2.7.12.upstream/2.7.12
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmdline/apt-report-mirror-failure')
-rwxr-xr-xcmdline/apt-report-mirror-failure29
1 files changed, 29 insertions, 0 deletions
diff --git a/cmdline/apt-report-mirror-failure b/cmdline/apt-report-mirror-failure
new file mode 100755
index 0000000..7c39064
--- /dev/null
+++ b/cmdline/apt-report-mirror-failure
@@ -0,0 +1,29 @@
+#!/usr/bin/python
+#
+# This is a stub that is meant to support failure reporting of
+# mirrors to a central database
+#
+# its currently not used
+
+import sys
+import urllib
+import apt_pkg
+
+apt_pkg.init()
+url = apt_pkg.Config.find("Acquire::Mirror::ReportFailures", "")
+ #"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()
+
+