~ubuntu-branches/ubuntu/oneiric/apt/oneiric

« back to all changes in this revision

Viewing changes to apt-pkg/acquire-item.cc

  • Committer: Package Import Robot
  • Author(s): Michael Vogt, Michael Vogt, David Kalnischkies
  • Date: 2011-09-16 09:50:16 UTC
  • Revision ID: package-import@ubuntu.com-20110916095016-dhnppkj8h3fi7akb
Tags: 0.8.16~exp5ubuntu9
[ Michael Vogt ]
* apt-pkg/acquire-item.h, apt-pkg/deb/debmetaindex.cc:
  - fix fetching translated package descriptions (including the newly
    stripped out english ones) by adding OptionalSubIndexTarget

[ David Kalnischkies ]
* apt-pkg/acquire-item.cc:
  - if no Release.gpg file is found try to verify with hashes,
    but do not fail if a hash can't be found
* apt-pkg/indexrecords.cc:
  - fix Acquire::Max-ValidTime option by interpreting it really
    as seconds as specified in the manpage and not as days
  - add an Acquire::Min-ValidTime option (Closes: #640122)
* doc/apt.conf.5.xml:
  - reword Acquire::Max-ValidTime documentation to make clear
    that it doesn't provide the new Min-ValidTime functionality

Show diffs side-by-side

added added

removed removed

Lines of Context:
1258
1258
      if (SigFile == "")
1259
1259
      {
1260
1260
         // There was no signature file, so we are finished.  Download
1261
 
         // the indexes and do only hashsum verification
 
1261
         // the indexes and do only hashsum verification if possible
1262
1262
         MetaIndexParser->Load(DestFile);
1263
 
         QueueIndexes(true);
 
1263
         QueueIndexes(false);
1264
1264
      }
1265
1265
      else
1266
1266
      {
1378
1378
        ++Target)
1379
1379
   {
1380
1380
      HashString ExpectedIndexHash;
1381
 
      if (verify)
1382
 
      {
1383
 
         const indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey);
1384
 
         if (Record == NULL)
1385
 
         {
1386
 
            if ((*Target)->IsOptional() == false)
1387
 
            {
1388
 
               Status = StatAuthError;
1389
 
               strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str());
1390
 
               return;
1391
 
            }
1392
 
         }
1393
 
         else
1394
 
         {
1395
 
            ExpectedIndexHash = Record->Hash;
1396
 
            if (_config->FindB("Debug::pkgAcquire::Auth", false))
1397
 
            {
1398
 
               std::cerr << "Queueing: " << (*Target)->URI << std::endl;
1399
 
               std::cerr << "Expected Hash: " << ExpectedIndexHash.toStr() << std::endl;
1400
 
               std::cerr << "For: " << Record->MetaKeyFilename << std::endl;
1401
 
            }
1402
 
            if (ExpectedIndexHash.empty() == true && (*Target)->IsOptional() == false)
1403
 
            {
1404
 
               Status = StatAuthError;
1405
 
               strprintf(ErrorText, _("Unable to find hash sum for '%s' in Release file"), (*Target)->MetaKey.c_str());
1406
 
               return;
1407
 
            }
 
1381
      const indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey);
 
1382
      if (Record == NULL)
 
1383
      {
 
1384
         if (verify == true && (*Target)->IsOptional() == false)
 
1385
         {
 
1386
            Status = StatAuthError;
 
1387
            strprintf(ErrorText, _("Unable to find expected entry '%s' in Release file (Wrong sources.list entry or malformed file)"), (*Target)->MetaKey.c_str());
 
1388
            return;
 
1389
         }
 
1390
      }
 
1391
      else
 
1392
      {
 
1393
         ExpectedIndexHash = Record->Hash;
 
1394
         if (_config->FindB("Debug::pkgAcquire::Auth", false))
 
1395
         {
 
1396
            std::cerr << "Queueing: " << (*Target)->URI << std::endl;
 
1397
            std::cerr << "Expected Hash: " << ExpectedIndexHash.toStr() << std::endl;
 
1398
            std::cerr << "For: " << Record->MetaKeyFilename << std::endl;
 
1399
         }
 
1400
         if (verify == true && ExpectedIndexHash.empty() == true && (*Target)->IsOptional() == false)
 
1401
         {
 
1402
            Status = StatAuthError;
 
1403
            strprintf(ErrorText, _("Unable to find hash sum for '%s' in Release file"), (*Target)->MetaKey.c_str());
 
1404
            return;
1408
1405
         }
1409
1406
      }
1410
1407