~racb/ubuntu/quantal/apt/by_hash

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Steve Langasek, Michael Vogt, Steve Langasek
  • Date: 2012-06-11 22:36:16 UTC
  • mfrom: (1.4.47 sid)
  • Revision ID: package-import@ubuntu.com-20120611223616-1cctfc7qrxrx4vcu
Tags: 0.9.6ubuntu1
[ Michael Vogt ]
* merged from Debian, remaining changes:
  - use ubuntu keyring and ubuntu archive keyring in apt-key
  - run update-apt-xapian-index in apt.cron
  - support apt-key net-update and verify keys against master-keyring
  - run apt-key net-update in cron.daily
  - different example sources.list
  - APT::pkgPackageManager::MaxLoopCount set to 5000
  - apport pkgfailure handling
  - ubuntu changelog download handling
  - patch for apt cross-building, see http://bugs.debian.org/666772

[ Steve Langasek ]
* Drop upgrade handling for obsolete conffile /etc/apt/apt.conf.d/01ubuntu,
  removed in previous LTS.
* prepare-release: declare the packages needed as source build deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
   {
96
96
      std::cout << "400 URI Failure\nURI: " << Queue->Uri << "\n"
97
97
                << "Message: " << Err << " " << IP << "\n";
98
 
      // Dequeue
99
 
      FetchItem *Tmp = Queue;
100
 
      Queue = Queue->Next;
101
 
      delete Tmp;
102
 
      if (Tmp == QueueBack)
103
 
         QueueBack = Queue;
 
98
      Dequeue();
104
99
   }
105
100
   else
106
101
      std::cout << "400 URI Failure\nURI: <UNKNOWN>\nMessage: " << Err << "\n";
211
206
   }
212
207
 
213
208
   std::cout << "\n" << std::flush;
214
 
 
215
 
   // Dequeue
216
 
   FetchItem *Tmp = Queue;
217
 
   Queue = Queue->Next;
218
 
   delete Tmp;
219
 
   if (Tmp == QueueBack)
220
 
      QueueBack = Queue;
 
209
   Dequeue();
221
210
}
222
211
                                                                        /*}}}*/
223
212
// AcqMethod::MediaFail - Syncronous request for new media              /*{{{*/
423
412
                                                                        /*}}}*/
424
413
// AcqMethod::Redirect - Send a redirect message                       /*{{{*/
425
414
// ---------------------------------------------------------------------
426
 
/* This method sends the redirect message and also manipulates the queue
427
 
   to keep the pipeline synchronized. */
 
415
/* This method sends the redirect message and dequeues the item as
 
416
 * the worker will enqueue again later on to the right queue */
428
417
void pkgAcqMethod::Redirect(const string &NewURI)
429
418
{
430
419
   std::cout << "103 Redirect\nURI: " << Queue->Uri << "\n"
431
420
             << "New-URI: " << NewURI << "\n"
432
421
             << "\n" << std::flush;
433
 
 
434
 
   // Change the URI for the request.
435
 
   Queue->Uri = NewURI;
436
 
 
437
 
   /* To keep the pipeline synchronized, move the current request to
438
 
      the end of the queue, past the end of the current pipeline. */
439
 
   FetchItem *I;
440
 
   for (I = Queue; I->Next != 0; I = I->Next) ;
441
 
   I->Next = Queue;
442
 
   Queue = Queue->Next;
443
 
   I->Next->Next = 0;
444
 
   if (QueueBack == 0)
445
 
      QueueBack = I->Next;
 
422
   Dequeue();
446
423
}
447
424
                                                                        /*}}}*/
448
425
// AcqMethod::FetchResult::FetchResult - Constructor                    /*{{{*/
465
442
   SHA512Sum = Hash.SHA512.Result();
466
443
}
467
444
                                                                        /*}}}*/
 
445
void pkgAcqMethod::Dequeue() {                                          /*{{{*/
 
446
   FetchItem const * const Tmp = Queue;
 
447
   Queue = Queue->Next;
 
448
   if (Tmp == QueueBack)
 
449
      QueueBack = Queue;
 
450
   delete Tmp;
 
451
}
 
452
                                                                        /*}}}*/