- use FailReason in pkgAcquire::Item::Failed when available
* methods/mirror.cc:
- move some debug output into if(Debug)
}
// report mirror failure back to LP if we actually use a mirror
}
// report mirror failure back to LP if we actually use a mirror
- ReportMirrorFailure(ErrorText);
+ string FailReason = LookupTag(Message, "FailReason");
+ if(FailReason.size() != 0)
+ ReportMirrorFailure(FailReason);
+ else
+ ReportMirrorFailure(ErrorText);
}
/*}}}*/
// Acquire::Item::Start - Item has begun to download /*{{{*/
}
/*}}}*/
// Acquire::Item::Start - Item has begun to download /*{{{*/
return;
Args[i++] = report.c_str();
Args[i++] = UsedMirror.c_str();
return;
Args[i++] = report.c_str();
Args[i++] = UsedMirror.c_str();
+ Args[i++] = DescURI().c_str();
Args[i++] = FailCode.c_str();
Args[i++] = NULL;
pid_t pid = ExecFork();
Args[i++] = FailCode.c_str();
Args[i++] = NULL;
pid_t pid = ExecFork();
print "Reporting mirror failure to '%s'" % url
data = {}
print "Reporting mirror failure to '%s'" % url
data = {}
-data['url'] = sys.argv[1]
-data['error'] = sys.argv[2]
+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()
f = urllib.urlopen(url, urllib.urlencode(data))
f.read()
f.close()
in both cases! So we need to apply some domain knowledge here :( and
check for /dists/ or /Release.gpg as suffixes
*/
in both cases! So we need to apply some domain knowledge here :( and
check for /dists/ or /Release.gpg as suffixes
*/
- std::cerr << "GetMirrorFile: " << mirror_uri_str << std::endl;
+ if(Debug)
+ std::cerr << "GetMirrorFile: " << mirror_uri_str << std::endl;
// read sources.list and find match
vector<metaIndex *>::const_iterator I;
// read sources.list and find match
vector<metaIndex *>::const_iterator I;
for(I=list.begin(); I != list.end(); I++)
{
string uristr = (*I)->GetURI();
for(I=list.begin(); I != list.end(); I++)
{
string uristr = (*I)->GetURI();
- std::cerr << "Checking: " << uristr << std::endl;
+ if(Debug)
+ std::cerr << "Checking: " << uristr << std::endl;
if(uristr.substr(0,strlen("mirror://")) != string("mirror://"))
continue;
// find matching uri in sources.list
if(mirror_uri_str.substr(0,uristr.size()) == uristr)
{
if(uristr.substr(0,strlen("mirror://")) != string("mirror://"))
continue;
// find matching uri in sources.list
if(mirror_uri_str.substr(0,uristr.size()) == uristr)
{
- std::cerr << "found BaseURI: " << uristr << std::endl;
+ if(Debug)
+ std::cerr << "found BaseURI: " << uristr << std::endl;
BaseUri = uristr.substr(0,uristr.size()-1);
}
}
BaseUri = uristr.substr(0,uristr.size()-1);
}
}
#: apt-inst/extract.cc:467 apt-pkg/contrib/configuration.cc:750
#: apt-pkg/contrib/cdromutl.cc:153 apt-pkg/sourcelist.cc:324
#: apt-inst/extract.cc:467 apt-pkg/contrib/configuration.cc:750
#: apt-pkg/contrib/cdromutl.cc:153 apt-pkg/sourcelist.cc:324
-#: apt-pkg/acquire.cc:421 apt-pkg/clean.cc:38 methods/mirror.cc:90
+#: apt-pkg/acquire.cc:421 apt-pkg/clean.cc:38 methods/mirror.cc:81
#, c-format
msgid "Unable to read %s"
msgstr ""
#, c-format
msgid "Unable to read %s"
msgstr ""
msgstr ""
#: apt-pkg/contrib/cdromutl.cc:149 apt-pkg/acquire.cc:427 apt-pkg/clean.cc:44
msgstr ""
#: apt-pkg/contrib/cdromutl.cc:149 apt-pkg/acquire.cc:427 apt-pkg/clean.cc:44
#, c-format
msgid "Unable to change to %s"
msgstr ""
#, c-format
msgid "Unable to change to %s"
msgstr ""
msgid "IO Error saving source cache"
msgstr ""
msgid "IO Error saving source cache"
msgstr ""
-#: apt-pkg/acquire-item.cc:130
+#: apt-pkg/acquire-item.cc:134
#, c-format
msgid "rename failed, %s (%s -> %s)."
msgstr ""
#, c-format
msgid "rename failed, %s (%s -> %s)."
msgstr ""
-#: apt-pkg/acquire-item.cc:281 apt-pkg/acquire-item.cc:992
+#: apt-pkg/acquire-item.cc:286 apt-pkg/acquire-item.cc:997
msgid "MD5Sum mismatch"
msgstr ""
msgid "MD5Sum mismatch"
msgstr ""
-#: apt-pkg/acquire-item.cc:686
+#: apt-pkg/acquire-item.cc:691
msgid "There is no public key available for the following key IDs:\n"
msgstr ""
msgid "There is no public key available for the following key IDs:\n"
msgstr ""
-#: apt-pkg/acquire-item.cc:800
+#: apt-pkg/acquire-item.cc:805
#, c-format
msgid ""
"I wasn't able to locate a file for the %s package. This might mean you need "
"to manually fix this package. (due to missing arch)"
msgstr ""
#, c-format
msgid ""
"I wasn't able to locate a file for the %s package. This might mean you need "
"to manually fix this package. (due to missing arch)"
msgstr ""
-#: apt-pkg/acquire-item.cc:859
+#: apt-pkg/acquire-item.cc:864
#, c-format
msgid ""
"I wasn't able to locate file for the %s package. This might mean you need to "
"manually fix this package."
msgstr ""
#, c-format
msgid ""
"I wasn't able to locate file for the %s package. This might mean you need to "
"manually fix this package."
msgstr ""
-#: apt-pkg/acquire-item.cc:895
+#: apt-pkg/acquire-item.cc:900
#, c-format
msgid ""
"The package index files are corrupted. No Filename: field for package %s."
msgstr ""
#, c-format
msgid ""
"The package index files are corrupted. No Filename: field for package %s."
msgstr ""
-#: apt-pkg/acquire-item.cc:982
+#: apt-pkg/acquire-item.cc:987
msgid "Size mismatch"
msgstr ""
msgid "Size mismatch"
msgstr ""