From 362d29343e5d25248bcd84300aa1b18effe891e7 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 24 Jan 2007 14:42:17 +0100 Subject: make the mirror failures actually produce a error message --- cmdline/makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmdline/makefile') diff --git a/cmdline/makefile b/cmdline/makefile index 882a0e1b..f07c7da3 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -52,3 +52,9 @@ SOURCE=apt-key TO=$(BIN) TARGET=program include $(COPY_H) + +# The apt-key program +SOURCE=apt-report-mirror-failure +TO=$(LIB) +TARGET=program +include $(COPY_H) -- cgit v1.2.3 From 3f599bb721c4ac58d8ff18991c9704b5f30eaa2b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 6 Feb 2007 10:49:25 +0100 Subject: * apt-pkg/acquire-item.cc: - default to "/usr/lib/apt/apt-report-mirror-failure" * cmdline/apt-report-mirror-failure: - no default comit url for now * debian/rules: - move apt-report-mirror-failure into /usr/lib/apt * doc/examples/configure-index: - more documentation * methods/mirror.cc: - updated TODO --- apt-pkg/acquire-item.cc | 2 +- cmdline/apt-report-mirror-failure | 4 ++-- cmdline/makefile | 2 +- debian/rules | 4 ++++ doc/examples/configure-index | 4 ++++ methods/mirror.cc | 1 + 6 files changed, 13 insertions(+), 4 deletions(-) (limited to 'cmdline/makefile') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 14610d6e..38530152 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -154,7 +154,7 @@ void pkgAcquire::Item::ReportMirrorFailure(string FailCode) const char *Args[40]; unsigned int i = 0; string report = _config->Find("Methods::Mirror::ProblemReporting", - "/usr/bin/apt-report-mirror-failure"); + "/usr/lib/apt/apt-report-mirror-failure"); if(!FileExists(report)) return; Args[i++] = report.c_str(); diff --git a/cmdline/apt-report-mirror-failure b/cmdline/apt-report-mirror-failure index fb43f0e7..1567e78e 100755 --- a/cmdline/apt-report-mirror-failure +++ b/cmdline/apt-report-mirror-failure @@ -5,8 +5,8 @@ import urllib import apt_pkg apt_pkg.init() -url = apt_pkg.Config.Find("Acquire::Mirror::ReportFailures", - "http://people.ubuntu.com:9000/mirror-failure") +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) diff --git a/cmdline/makefile b/cmdline/makefile index f07c7da3..8d284c2f 100644 --- a/cmdline/makefile +++ b/cmdline/makefile @@ -55,6 +55,6 @@ include $(COPY_H) # The apt-key program SOURCE=apt-report-mirror-failure -TO=$(LIB) +TO=$(BIN) TARGET=program include $(COPY_H) diff --git a/debian/rules b/debian/rules index 02ee734b..9e87b172 100755 --- a/debian/rules +++ b/debian/rules @@ -214,6 +214,10 @@ apt: build debian/shlibs.local # head -n 500 ChangeLog > debian/ChangeLog + # move the mirror failure script in place + mv debian/$@/usr/bin/apt-report-mirror-failure \ + debian/$@/usr/lib/apt/apt-report-mirror-failure \ + dh_installexamples -p$@ $(BLD)/docs/examples/* dh_installman -p$@ dh_installcron -p$@ diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 81bb6b3b..81fa4c52 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -166,6 +166,10 @@ Acquire RefreshInterval "360"; // refresh interval in minutes MaxAge "90"; // max age for a mirror file in days before // it gets deleted + // mirror failure reporting script + ProblemReporting "/usr/lib/apt/apt-report-mirror-failure"; + // mirror failure reporting url + ReportFailures "http://example.com/mirror-failure"; }; }; diff --git a/methods/mirror.cc b/methods/mirror.cc index c5c0c746..9a86a10c 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -42,6 +42,7 @@ using namespace std; * - deal with runing as non-root because we can't write to the lists dir then -> use the cached mirror file * - better method to download than having a pkgAcquire interface here + * and better error handling there! * - support more than http * - testing :) */ -- cgit v1.2.3