~mvo/apt/dep8

« back to all changes in this revision

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

  • Committer: Arch Librarian
  • Date: 2004-09-20 16:56:32 UTC
  • Revision ID: Arch-1:apt@arch.ubuntu.com%apt--MAIN--0--patch-614
Join with aliencode
Author: jgg
Date: 2001-02-20 07:03:16 GMT
Join with aliencode

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// -*- mode: cpp; mode: fold -*-
2
2
// Description                                                          /*{{{*/
3
 
// $Id: acquire-worker.cc,v 1.31 2000/05/10 05:56:46 jgg Exp $
 
3
// $Id: acquire-worker.cc,v 1.32 2001/02/20 07:03:17 jgg Exp $
4
4
/* ######################################################################
5
5
 
6
6
   Acquire Worker 
22
22
#include <apt-pkg/fileutl.h>
23
23
#include <apt-pkg/strutl.h>
24
24
 
 
25
#include <apti18n.h>
 
26
    
25
27
#include <sys/stat.h>
26
28
#include <unistd.h>
27
29
#include <fcntl.h>
102
104
   // Get the method path
103
105
   string Method = _config->FindDir("Dir::Bin::Methods") + Access;
104
106
   if (FileExists(Method) == false)
105
 
      return _error->Error("The method driver %s could not be found.",Method.c_str());
 
107
      return _error->Error(_("The method driver %s could not be found."),Method.c_str());
106
108
 
107
109
   if (Debug == true)
108
110
      clog << "Starting method '" << Method << '\'' << endl;
154
156
   // Read the configuration data
155
157
   if (WaitFd(InFd) == false ||
156
158
       ReadMessages() == false)
157
 
      return _error->Error("Method %s did not start correctly",Method.c_str());
 
159
      return _error->Error(_("Method %s did not start correctly"),Method.c_str());
158
160
 
159
161
   RunMessages();
160
162
   if (OwnerQ != 0)
260
262
               Log->Pulse(Owner->GetOwner());
261
263
            
262
264
            OwnerQ->ItemDone(Itm);
263
 
            if (TotalSize != 0 && 
 
265
            if (TotalSize != 0 &&
264
266
                (unsigned)atoi(LookupTag(Message,"Size","0").c_str()) != TotalSize)
265
 
               _error->Warning("Bizzar Error - File size is not what the server reported %s %u",
 
267
               _error->Warning("Bizarre Error - File size is not what the server reported %s %lu",
266
268
                               LookupTag(Message,"Size","0").c_str(),TotalSize);
267
269
 
268
270
            Owner->Done(Message,atoi(LookupTag(Message,"Size","0").c_str()),
313
315
         
314
316
         // 401 General Failure
315
317
         case 401:
316
 
         _error->Error("Method %s General failure: %s",LookupTag(Message,"Message").c_str());
 
318
         _error->Error("Method %s General failure: %s",Access.c_str(),LookupTag(Message,"Message").c_str());
317
319
         break;
318
320
         
319
321
         // 403 Media Change
405
407
   {
406
408
      if (Top->Value.empty() == false)
407
409
      {
408
 
         string Line = "Config-Item: " + Top->FullTag() + "=";
 
410
         string Line = "Config-Item: " + QuoteString(Top->FullTag(),"=\"\n") + "=";
409
411
         Line += QuoteString(Top->Value,"\n") + '\n';
410
412
         Message += Line;
411
413
      }