summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2006-01-05 22:12:13 +0000
committerMichael Vogt <mvo@debian.org>2006-01-05 22:12:13 +0000
commitd4ef73fbc21241252917c551f60f686dcd5c2e1f (patch)
treedd3fbe4a693d77ab43dbb082337bf15346586551 /apt-pkg/acquire-item.cc
parent9329c2ae3c404ba25bf73133287abf01592f409b (diff)
parentf381d68d3c1de8e96dfb2a2ebe36c8577729ec44 (diff)
* merged with apt--mvo--0
Patches applied: * bubulle@debian.org--2005/apt--main--0--patch-133 Merge with Michael AND update PO files * bubulle@debian.org--2005/apt--main--0--patch-134 Updated Basque translation * bubulle@debian.org--2005/apt--main--0--patch-135 Completed Basque translation * bubulle@debian.org--2005/apt--main--0--patch-136 French manpage of sources.list updated * bubulle@debian.org--2005/apt--main--0--patch-137 Disable Hebrew translation on trnaslator's request * bubulle@debian.org--2005/apt--main--0--patch-138 Swedish translation update * bubulle@debian.org--2005/apt--main--0--patch-139 Tagalog translation update * bubulle@debian.org--2005/apt--main--0--patch-140 Fix a translation glitch in German * bubulle@debian.org--2005/apt--main--0--patch-141 Revert the German fix * bubulle@debian.org--2005/apt--main--0--patch-142 Updated Vietnamese translation * bubulle@debian.org--2005/apt--main--0--patch-143 Really add the Vietnamese translation * bubulle@debian.org--2005/apt--main--0--patch-144 Greek translation update * bubulle@debian.org--2005/apt--main--0--patch-145 Simplified Chinese completed * bubulle@debian.org--2005/apt--main--0--patch-146 Czech translation update * bubulle@debian.org--2005/apt--main--0--patch-147 British translation of apt * bubulle@debian.org--2005/apt--main--0--patch-148 Italian translation update * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-107 * merged with bubulle * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-108 * added "gl" to po/LINGUAS * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-109 * add " " in update-po * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-110 * make apt-get source smarter about not downloading the same sources twice * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-111 * merged with bubulle * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-112 * 2006 ftp-archive signing key added * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-113 * be more clever about I-M-S hits for the Release file and gpg-failures with it, requeue it without i-m-s then * philippe.batailler@free.fr--2005/apt--main--0--patch-4 Update of sources.list
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc29
1 files changed, 26 insertions, 3 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 88c25de43..b9fc74456 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -430,7 +430,7 @@ pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire *Owner,
const vector<struct IndexTarget*>* IndexTargets,
indexRecords* MetaIndexParser) :
Item(Owner), RealURI(URI), SigFile(SigFile), AuthPass(false),
- MetaIndexParser(MetaIndexParser), IndexTargets(IndexTargets)
+ MetaIndexParser(MetaIndexParser), IndexTargets(IndexTargets), IMSHit(false)
{
DestFile = _config->FindDir("Dir::State::lists") + "partial/";
DestFile += URItoFileName(URI);
@@ -523,6 +523,9 @@ void pkgAcqMetaIndex::RetrievalDone(string Message)
return;
}
+ // see if the download was a IMSHit
+ IMSHit = StringToBool(LookupTag(Message,"IMS-Hit"),false);
+
Complete = true;
string FinalFile = _config->FindDir("Dir::State::lists");
@@ -688,10 +691,30 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
{
if (AuthPass == true)
{
- // gpgv method failed
+ // if we fail the authentication but got the file via a IMS-Hit
+ // this means that the file wasn't downloaded and that it might be
+ // just stale (server problem, proxy etc). we delete what we have
+ // queue it again without i-m-s
+ // alternatively we could just unlink the file and let the user try again
+ if (IMSHit)
+ {
+ Complete = false;
+ Local = false;
+ AuthPass = false;
+ unlink(DestFile.c_str());
+
+ DestFile = _config->FindDir("Dir::State::lists") + "partial/";
+ DestFile += URItoFileName(RealURI);
+ Desc.URI = RealURI;
+ QueueURI(Desc);
+ return;
+ }
+
+ // gpgv method failed
_error->Warning("GPG error: %s: %s",
Desc.Description.c_str(),
LookupTag(Message,"Message").c_str());
+
}
// No Release file was present, or verification failed, so fall
@@ -1037,7 +1060,7 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI,string MD5,
else
PartialSize = Buf.st_size;
}
-
+
QueueURI(Desc);
}
/*}}}*/