diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2011-09-13 18:00:22 +0200 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2011-09-13 18:00:22 +0200 |
commit | afd7b358f94efddb83a2911ec1a21e7280074b1e (patch) | |
tree | faa658f29d7dff42c6ed475037dd462384eab46e /apt-pkg/acquire-item.cc | |
parent | 74b220028595342028e3309002e4ec359af328f9 (diff) | |
parent | 4e9108b8238438f1c390cb9ea9de598de1b7d7cb (diff) |
merge with debian/sid
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r-- | apt-pkg/acquire-item.cc | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 9433e5c4a..b46489f87 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1268,9 +1268,9 @@ void pkgAcqMetaIndex::Done(string Message,unsigned long long Size,string Hash, / if (SigFile == "") { // There was no signature file, so we are finished. Download - // the indexes and do only hashsum verification + // the indexes and do only hashsum verification if possible MetaIndexParser->Load(DestFile); - QueueIndexes(true); + QueueIndexes(false); } else { @@ -1388,33 +1388,30 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify) /*{{{*/ ++Target) { HashString ExpectedIndexHash; - if (verify) + const indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey); + if (Record == NULL) { - const indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey); - if (Record == NULL) + if (verify == true && (*Target)->IsOptional() == false) { - if ((*Target)->IsOptional() == false) - { - Status = StatAuthError; - strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str()); - return; - } + Status = StatAuthError; + strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str()); + return; } - else + } + else + { + ExpectedIndexHash = Record->Hash; + if (_config->FindB("Debug::pkgAcquire::Auth", false)) { - ExpectedIndexHash = Record->Hash; - if (_config->FindB("Debug::pkgAcquire::Auth", false)) - { - std::cerr << "Queueing: " << (*Target)->URI << std::endl; - std::cerr << "Expected Hash: " << ExpectedIndexHash.toStr() << std::endl; - std::cerr << "For: " << Record->MetaKeyFilename << std::endl; - } - if (ExpectedIndexHash.empty() == true && (*Target)->IsOptional() == false) - { - Status = StatAuthError; - strprintf(ErrorText, _("Unable to find hash sum for '%s' in Release file"), (*Target)->MetaKey.c_str()); - return; - } + std::cerr << "Queueing: " << (*Target)->URI << std::endl; + std::cerr << "Expected Hash: " << ExpectedIndexHash.toStr() << std::endl; + std::cerr << "For: " << Record->MetaKeyFilename << std::endl; + } + if (verify == true && ExpectedIndexHash.empty() == true && (*Target)->IsOptional() == false) + { + Status = StatAuthError; + strprintf(ErrorText, _("Unable to find hash sum for '%s' in Release file"), (*Target)->MetaKey.c_str()); + return; } } |