~racb/ubuntu/quantal/apt/by_hash

« back to all changes in this revision

Viewing changes to apt-pkg/acquire-worker.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:
244
244
 
245
245
            string NewURI = LookupTag(Message,"New-URI",URI.c_str());
246
246
            Itm->URI = NewURI;
 
247
 
 
248
            ItemDone();
 
249
 
 
250
            pkgAcquire::Item *Owner = Itm->Owner;
 
251
            pkgAcquire::ItemDesc Desc = *Itm;
 
252
 
 
253
            // Change the status so that it can be dequeued
 
254
            Owner->Status = pkgAcquire::Item::StatIdle;
 
255
            // Mark the item as done (taking care of all queues)
 
256
            // and then put it in the main queue again
 
257
            OwnerQ->ItemDone(Itm);
 
258
            OwnerQ->Owner->Enqueue(Desc);
 
259
 
 
260
            if (Log != 0)
 
261
               Log->Done(Desc);
247
262
            break;
248
263
         }
249
264
   
431
446
             << Drive  << ":"     // drive
432
447
             << msg.str()         // l10n message
433
448
             << endl;
434
 
      write(status_fd, status.str().c_str(), status.str().size());
 
449
 
 
450
      std::string const dlstatus = status.str();
 
451
      FileFd::Write(status_fd, dlstatus.c_str(), dlstatus.size());
435
452
   }
436
453
 
437
454
   if (Log == 0 || Log->MediaChange(LookupTag(Message,"Media"),
465
482
 
466
483
   if (OutFd == -1)
467
484
      return false;
468
 
   
469
 
   string Message = "601 Configuration\n";
470
 
   Message.reserve(2000);
471
485
 
472
 
   /* Write out all of the configuration directives by walking the 
 
486
   /* Write out all of the configuration directives by walking the
473
487
      configuration tree */
474
 
   const Configuration::Item *Top = _config->Tree(0);
475
 
   for (; Top != 0;)
476
 
   {
477
 
      if (Top->Value.empty() == false)
478
 
      {
479
 
         string Line = "Config-Item: " + QuoteString(Top->FullTag(),"=\"\n") + "=";
480
 
         Line += QuoteString(Top->Value,"\n") + '\n';
481
 
         Message += Line;
482
 
      }
483
 
      
484
 
      if (Top->Child != 0)
485
 
      {
486
 
         Top = Top->Child;
487
 
         continue;
488
 
      }
489
 
      
490
 
      while (Top != 0 && Top->Next == 0)
491
 
         Top = Top->Parent;
492
 
      if (Top != 0)
493
 
         Top = Top->Next;
494
 
   }   
495
 
   Message += '\n';
 
488
   std::ostringstream Message;
 
489
   Message << "601 Configuration\n";
 
490
   _config->Dump(Message, NULL, "Config-Item: %F=%V\n", false);
 
491
   Message << '\n';
496
492
 
497
493
   if (Debug == true)
498
 
      clog << " -> " << Access << ':' << QuoteString(Message,"\n") << endl;
499
 
   OutQueue += Message;
500
 
   OutReady = true; 
501
 
   
 
494
      clog << " -> " << Access << ':' << QuoteString(Message.str(),"\n") << endl;
 
495
   OutQueue += Message.str();
 
496
   OutReady = true;
 
497
 
502
498
   return true;
503
499
}
504
500
                                                                        /*}}}*/
536
532
      Res = write(OutFd,OutQueue.c_str(),OutQueue.length());
537
533
   }
538
534
   while (Res < 0 && errno == EINTR);
539
 
   
 
535
 
540
536
   if (Res <= 0)
541
537
      return MethodFailure();
542
 
   
 
538
 
543
539
   OutQueue.erase(0,Res);
544
540
   if (OutQueue.empty() == true)
545
541
      OutReady = false;