summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2006-01-12 22:44:04 +0000
committerMichael Vogt <mvo@debian.org>2006-01-12 22:44:04 +0000
commit5c4d7f0764f99ebe6e65933b1bc08671dbab98e9 (patch)
treec47346dc62dc38fe9247c8b1249f88ca90c98733 /apt-pkg/acquire-item.cc
parentfacac1c52ebe40656af693502cab66eb4c09ad2f (diff)
parentac2c9fa03c9786da44320d59b3ad66f474c4634a (diff)
* merged with apt--debian-sid--0
Patches applied: * 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 * bubulle@debian.org--2005/apt--main--0--patch-149 Merge with Michael archive (Debian version) * bubulle@debian.org--2005/apt--main--0--patch-150 Fix typo in apt-get.cc and update PO files * bubulle@debian.org--2005/apt--main--0--patch-151 Update French translation (and document the update-po I ran previously) * bubulle@debian.org--2005/apt--main--0--patch-152 Updated Slovak translation * bubulle@debian.org--2005/apt--main--0--patch-153 Close the right bug for Slovak translation * bubulle@debian.org--2005/apt--main--0--patch-154 French manpages translation update * bubulle@debian.org--2005/apt--main--0--patch-155 Swedish translation update * bubulle@debian.org--2005/apt--main--0--patch-156 Better makefile for more up-to-date PO and POT * bubulle@debian.org--2005/apt--main--0--patch-157 Run make uupdate-po * bubulle@debian.org--2005/apt--main--0--patch-158 Fix spaces errors in some translations * bubulle@debian.org--2005/apt--main--0--patch-159 Patch to allow "make apt-all.pot" work in the baz archive * 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 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-114 * merged with mvo * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-115 * string fix * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-116 * changelog updates * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-117 * merged with bubulle * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-118 * merged from bubulle * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-119 * fix http data corruption (#280844) * mvo@debian.org--2005/apt--debian-sid--0--patch-10 * merged with apt--mvo and corrected conflicts in po/ * mvo@debian.org--2005/apt--debian-sid--0--patch-11 * changelog updates * mvo@debian.org--2005/apt--debian-sid--0--patch-12 * apt--mvo merged * mvo@debian.org--2005/apt--debian-sid--0--patch-13 * merged with mvo * mvo@debian.org--2005/apt--debian-sid--0--patch-14 * merged with apt--mvo--0 * mvo@debian.org--2005/apt--debian-sid--0--patch-15 * support multiple signatures * mvo@debian.org--2005/apt--debian-sid--0--patch-16 * merged with main * mvo@debian.org--2005/apt--debian-sid--0--patch-17 * merged with apt--mvo--0 * philippe.batailler@free.fr--2005/apt--main--0--patch-4 Update of sources.list * philippe.batailler@free.fr--2005/apt--main--0--patch-6 Change apt.ent.fr * philippe.batailler@free.fr--2005/apt--main--0--patch-7 Update manpages
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc51
1 files changed, 45 insertions, 6 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 197cbf786..c6a49653b 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -862,7 +862,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);
@@ -955,6 +955,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");
@@ -983,7 +986,7 @@ void pkgAcqMetaIndex::AuthDone(string Message)
return;
}
- if (!VerifyVendor())
+ if (!VerifyVendor(Message))
{
return;
}
@@ -1041,7 +1044,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify)
}
}
-bool pkgAcqMetaIndex::VerifyVendor()
+bool pkgAcqMetaIndex::VerifyVendor(string Message)
{
// // Maybe this should be made available from above so we don't have
// // to read and parse it every time?
@@ -1066,6 +1069,22 @@ bool pkgAcqMetaIndex::VerifyVendor()
// break;
// }
// }
+ string::size_type pos;
+
+ // check for missing sigs (that where not fatal because otherwise we had
+ // bombed earlier)
+ string missingkeys;
+ string msg = _("There are no public key available for the "
+ "following key IDs:\n");
+ pos = Message.find("NO_PUBKEY ");
+ if (pos != std::string::npos)
+ {
+ string::size_type start = pos+strlen("NO_PUBKEY ");
+ string Fingerprint = Message.substr(start, Message.find("\n")-start);
+ missingkeys += (Fingerprint);
+ }
+ if(!missingkeys.empty())
+ _error->Warning("%s", string(msg+missingkeys).c_str());
string Transformed = MetaIndexParser->GetExpectedDist();
@@ -1074,7 +1093,7 @@ bool pkgAcqMetaIndex::VerifyVendor()
Transformed = "experimental";
}
- string::size_type pos = Transformed.rfind('/');
+ pos = Transformed.rfind('/');
if (pos != string::npos)
{
Transformed = Transformed.substr(0, pos);
@@ -1120,10 +1139,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
@@ -1469,7 +1508,7 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI,string MD5,
else
PartialSize = Buf.st_size;
}
-
+
QueueURI(Desc);
}
/*}}}*/