~ubuntu-branches/debian/experimental/apt/experimental

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2010-02-18 22:07:23 UTC
  • mfrom: (9.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100218220723-zb7zdh6fmsmp30tr
Tags: 0.7.26~exp2
fix crash when LANGUAGE is not set

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
                                                                        /*}}}*/
15
15
// Include Files                                                        /*{{{*/
16
16
#include <apt-pkg/acquire-item.h>
17
 
#include <apt-pkg/contrib/configuration.h>
 
17
#include <apt-pkg/configuration.h>
 
18
#include <apt-pkg/aptconfiguration.h>
18
19
#include <apt-pkg/sourcelist.h>
19
20
#include <apt-pkg/vendorlist.h>
20
 
#include <apt-pkg/contrib/error.h>
21
 
#include <apt-pkg/contrib/strutl.h>
22
 
#include <apt-pkg/contrib/fileutl.h>
23
 
#include <apt-pkg/contrib/md5.h>
24
 
#include <apt-pkg/contrib/sha1.h>
 
21
#include <apt-pkg/error.h>
 
22
#include <apt-pkg/strutl.h>
 
23
#include <apt-pkg/fileutl.h>
 
24
#include <apt-pkg/md5.h>
 
25
#include <apt-pkg/sha1.h>
25
26
#include <apt-pkg/tagfile.h>
26
27
 
27
28
#include <apti18n.h>
32
33
#include <string>
33
34
#include <sstream>
34
35
#include <stdio.h>
35
 
#include <ctime>
36
36
                                                                        /*}}}*/
37
37
 
38
38
using namespace std;
132
132
   }   
133
133
}
134
134
                                                                        /*}}}*/
135
 
 
136
 
 
137
 
// AcqDiffIndex::AcqDiffIndex - Constructor                     
 
135
// AcqDiffIndex::AcqDiffIndex - Constructor                             /*{{{*/
138
136
// ---------------------------------------------------------------------
139
137
/* Get the DiffIndex file first and see if there are patches availabe 
140
138
 * If so, create a pkgAcqIndexDiffs fetcher that will get and apply the
185
183
   QueueURI(Desc);
186
184
 
187
185
}
188
 
 
 
186
                                                                        /*}}}*/
189
187
// AcqIndex::Custom600Headers - Insert custom request headers           /*{{{*/
190
188
// ---------------------------------------------------------------------
191
189
/* The only header we use is the last-modified header. */
203
201
   
204
202
   return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
205
203
}
206
 
 
207
 
 
208
 
bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile)
 
204
                                                                        /*}}}*/
 
205
bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile)              /*{{{*/
209
206
{
210
207
   if(Debug)
211
208
      std::clog << "pkgAcqIndexDiffs::ParseIndexDiff() " << IndexDiffFile 
222
219
 
223
220
   if(TF.Step(Tags) == true)
224
221
   {
225
 
      string local_sha1;
226
222
      bool found = false;
227
223
      DiffInfo d;
228
224
      string size;
229
225
 
230
 
      string tmp = Tags.FindS("SHA1-Current");
 
226
      string const tmp = Tags.FindS("SHA1-Current");
231
227
      std::stringstream ss(tmp);
232
 
      ss >> ServerSha1;
 
228
      ss >> ServerSha1 >> size;
 
229
      unsigned long const ServerSize = atol(size.c_str());
233
230
 
234
231
      FileFd fd(CurrentPackagesFile, FileFd::ReadOnly);
235
232
      SHA1Summation SHA1;
236
233
      SHA1.AddFD(fd.Fd(), fd.Size());
237
 
      local_sha1 = string(SHA1.Result());
 
234
      string const local_sha1 = SHA1.Result();
238
235
 
239
236
      if(local_sha1 == ServerSha1) 
240
237
      {
251
248
            std::clog << "SHA1-Current: " << ServerSha1 << std::endl;
252
249
 
253
250
         // check the historie and see what patches we need
254
 
         string history = Tags.FindS("SHA1-History");     
 
251
         string const history = Tags.FindS("SHA1-History");
255
252
         std::stringstream hist(history);
256
 
         while(hist >> d.sha1 >> size >> d.file) 
 
253
         while(hist >> d.sha1 >> size >> d.file)
257
254
         {
258
 
            d.size = atoi(size.c_str());
259
255
            // read until the first match is found
 
256
            // from that point on, we probably need all diffs
260
257
            if(d.sha1 == local_sha1) 
261
258
               found=true;
262
 
            // from that point on, we probably need all diffs
263
 
            if(found) 
264
 
            {
265
 
               if(Debug)
266
 
                  std::clog << "Need to get diff: " << d.file << std::endl;
267
 
               available_patches.push_back(d);
 
259
            else if (found == false)
 
260
               continue;
 
261
 
 
262
            if(Debug)
 
263
               std::clog << "Need to get diff: " << d.file << std::endl;
 
264
            available_patches.push_back(d);
 
265
         }
 
266
 
 
267
         if (available_patches.empty() == false)
 
268
         {
 
269
            // patching with too many files is rather slow compared to a fast download
 
270
            unsigned long const fileLimit = _config->FindI("Acquire::PDiffs::FileLimit", 0);
 
271
            if (fileLimit != 0 && fileLimit < available_patches.size())
 
272
            {
 
273
               if (Debug)
 
274
                  std::clog << "Need " << available_patches.size() << " diffs (Limit is " << fileLimit
 
275
                        << ") so fallback to complete download" << std::endl;
 
276
               return false;
 
277
            }
 
278
 
 
279
            // see if the patches are too big
 
280
            found = false; // it was true and it will be true again at the end
 
281
            d = *available_patches.begin();
 
282
            string const firstPatch = d.file;
 
283
            unsigned long patchesSize = 0;
 
284
            std::stringstream patches(Tags.FindS("SHA1-Patches"));
 
285
            while(patches >> d.sha1 >> size >> d.file)
 
286
            {
 
287
               if (firstPatch == d.file)
 
288
                  found = true;
 
289
               else if (found == false)
 
290
                  continue;
 
291
 
 
292
               patchesSize += atol(size.c_str());
 
293
            }
 
294
            unsigned long const sizeLimit = ServerSize * _config->FindI("Acquire::PDiffs::SizeLimit", 100);
 
295
            if (sizeLimit > 0 && (sizeLimit/100) < patchesSize)
 
296
            {
 
297
               if (Debug)
 
298
                  std::clog << "Need " << patchesSize << " bytes (Limit is " << sizeLimit/100
 
299
                        << ") so fallback to complete download" << std::endl;
 
300
               return false;
268
301
            }
269
302
         }
270
303
      }
273
306
      if(found) 
274
307
      {
275
308
         // queue the diffs
276
 
         string::size_type last_space = Description.rfind(" ");
 
309
         string::size_type const last_space = Description.rfind(" ");
277
310
         if(last_space != string::npos)
278
311
            Description.erase(last_space, Description.size()-last_space);
279
312
         new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc,
280
 
                              ExpectedHash, available_patches);
 
313
                              ExpectedHash, ServerSha1, available_patches);
281
314
         Complete = false;
282
315
         Status = StatDone;
283
316
         Dequeue();
292
325
      std::clog << "Can't find a patch in the index file" << std::endl;
293
326
   return false;
294
327
}
295
 
 
296
 
void pkgAcqDiffIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 
328
                                                                        /*}}}*/
 
329
void pkgAcqDiffIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)      /*{{{*/
297
330
{
298
331
   if(Debug)
299
332
      std::clog << "pkgAcqDiffIndex failed: " << Desc.URI << std::endl
306
339
   Status = StatDone;
307
340
   Dequeue();
308
341
}
309
 
 
310
 
void pkgAcqDiffIndex::Done(string Message,unsigned long Size,string Md5Hash,
 
342
                                                                        /*}}}*/
 
343
void pkgAcqDiffIndex::Done(string Message,unsigned long Size,string Md5Hash,    /*{{{*/
311
344
                           pkgAcquire::MethodConfig *Cnf)
312
345
{
313
346
   if(Debug)
336
369
   Dequeue();
337
370
   return;
338
371
}
339
 
 
340
 
 
341
 
 
342
 
// AcqIndexDiffs::AcqIndexDiffs - Constructor                   
 
372
                                                                        /*}}}*/
 
373
// AcqIndexDiffs::AcqIndexDiffs - Constructor                           /*{{{*/
343
374
// ---------------------------------------------------------------------
344
375
/* The package diff is added to the queue. one object is constructed
345
376
 * for each diff and the index
347
378
pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner,
348
379
                                   string URI,string URIDesc,string ShortDesc,
349
380
                                   HashString ExpectedHash, 
 
381
                                   string ServerSha1,
350
382
                                   vector<DiffInfo> diffs)
351
383
   : Item(Owner), RealURI(URI), ExpectedHash(ExpectedHash), 
352
 
     available_patches(diffs)
 
384
     available_patches(diffs), ServerSha1(ServerSha1)
353
385
{
354
386
   
355
387
   DestFile = _config->FindDir("Dir::State::lists") + "partial/";
373
405
      QueueNextDiff();
374
406
   }
375
407
}
376
 
 
377
 
 
378
 
void pkgAcqIndexDiffs::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 
408
                                                                        /*}}}*/
 
409
void pkgAcqIndexDiffs::Failed(string Message,pkgAcquire::MethodConfig *Cnf)     /*{{{*/
379
410
{
380
411
   if(Debug)
381
412
      std::clog << "pkgAcqIndexDiffs failed: " << Desc.URI << std::endl
384
415
                   ExpectedHash);
385
416
   Finish();
386
417
}
387
 
 
388
 
 
389
 
// helper that cleans the item out of the fetcher queue
 
418
                                                                        /*}}}*/
 
419
// Finish - helper that cleans the item out of the fetcher queue        /*{{{*/
390
420
void pkgAcqIndexDiffs::Finish(bool allDone)
391
421
{
392
422
   // we restore the original name, this is required, otherwise
421
451
   Dequeue();
422
452
   return;
423
453
}
424
 
 
425
 
 
426
 
 
427
 
bool pkgAcqIndexDiffs::QueueNextDiff()
 
454
                                                                        /*}}}*/
 
455
bool pkgAcqIndexDiffs::QueueNextDiff()                                  /*{{{*/
428
456
{
429
457
 
430
458
   // calc sha1 of the just patched file
439
467
      std::clog << "QueueNextDiff: " 
440
468
                << FinalFile << " (" << local_sha1 << ")"<<std::endl;
441
469
 
 
470
   // final file reached before all patches are applied
 
471
   if(local_sha1 == ServerSha1)
 
472
   {
 
473
      Finish(true);
 
474
      return true;
 
475
   }
 
476
 
442
477
   // remove all patches until the next matching patch is found
443
478
   // this requires the Index file to be ordered
444
479
   for(vector<DiffInfo>::iterator I=available_patches.begin();
470
505
 
471
506
   return true;
472
507
}
473
 
 
474
 
 
475
 
 
476
 
void pkgAcqIndexDiffs::Done(string Message,unsigned long Size,string Md5Hash,
 
508
                                                                        /*}}}*/
 
509
void pkgAcqIndexDiffs::Done(string Message,unsigned long Size,string Md5Hash,   /*{{{*/
477
510
                            pkgAcquire::MethodConfig *Cnf)
478
511
{
479
512
   if(Debug)
538
571
      // see if there is more to download
539
572
      if(available_patches.size() > 0) {
540
573
         new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc,
541
 
                              ExpectedHash, available_patches);
 
574
                              ExpectedHash, ServerSha1, available_patches);
542
575
         return Finish();
543
576
      } else 
544
577
         return Finish(true);
545
578
   }
546
579
}
547
 
 
548
 
 
 
580
                                                                        /*}}}*/
549
581
// AcqIndex::AcqIndex - Constructor                                     /*{{{*/
550
582
// ---------------------------------------------------------------------
551
583
/* The package file is added to the queue and a second class is 
564
596
   if(comprExt.empty()) 
565
597
   {
566
598
      // autoselect the compression method
567
 
      if(FileExists("/bin/bzip2")) 
568
 
         CompressionExtension = ".bz2";
569
 
      else 
570
 
         CompressionExtension = ".gz";
571
 
   } else {
572
 
      CompressionExtension = (comprExt == "plain" ? "" : comprExt);
 
599
      std::vector<std::string> types = APT::Configuration::getCompressionTypes();
 
600
      if (types.empty() == true)
 
601
         comprExt = "plain";
 
602
      else
 
603
         comprExt = "." + types[0];
573
604
   }
 
605
   CompressionExtension = ((comprExt == "plain" || comprExt == ".") ? "" : comprExt);
 
606
 
574
607
   Desc.URI = URI + CompressionExtension;
575
608
 
576
609
   Desc.Description = URIDesc;
595
628
   return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
596
629
}
597
630
                                                                        /*}}}*/
598
 
 
599
 
void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 
631
void pkgAcqIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)  /*{{{*/
600
632
{
601
 
   bool descChanged = false;
602
 
   // no .bz2 found, retry with .gz
603
 
   if(Desc.URI.substr(Desc.URI.size()-3) == "bz2") {
604
 
      Desc.URI = Desc.URI.substr(0,Desc.URI.size()-3) + "gz";
605
 
 
606
 
      new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc,
607
 
                      ExpectedHash, string(".gz"));
608
 
          descChanged = true;
609
 
   }
610
 
   // no .gz found, retry with uncompressed
611
 
   else if(Desc.URI.substr(Desc.URI.size()-2) == "gz") {
612
 
      Desc.URI = Desc.URI.substr(0,Desc.URI.size()-2);
613
 
 
614
 
      new pkgAcqIndex(Owner, RealURI, Desc.Description,Desc.ShortDesc,
615
 
                      ExpectedHash, string("plain"));
616
 
          descChanged = true;
617
 
   }
618
 
   if (descChanged) {
 
633
   std::vector<std::string> types = APT::Configuration::getCompressionTypes();
 
634
 
 
635
   for (std::vector<std::string>::const_iterator t = types.begin();
 
636
        t != types.end(); t++)
 
637
   {
 
638
      // jump over all already tried compression types
 
639
      const unsigned int nameLen = Desc.URI.size() - (*t).size();
 
640
      if(Desc.URI.substr(nameLen) != *t)
 
641
         continue;
 
642
 
 
643
      // we want to try it with the next extension (and make sure to 
 
644
      // not skip over the end)
 
645
      t++;
 
646
      if (t == types.end())
 
647
         break;
 
648
 
 
649
      // queue new download
 
650
      Desc.URI = Desc.URI.substr(0, nameLen) + *t;
 
651
      new pkgAcqIndex(Owner, RealURI, Desc.Description, Desc.ShortDesc,
 
652
      ExpectedHash, string(".").append(*t));
 
653
      
619
654
      Status = StatDone;
620
655
      Complete = false;
621
656
      Dequeue();
631
666
 
632
667
   Item::Failed(Message,Cnf);
633
668
}
634
 
 
635
 
 
 
669
                                                                        /*}}}*/
636
670
// AcqIndex::Done - Finished a fetch                                    /*{{{*/
637
671
// ---------------------------------------------------------------------
638
672
/* This goes through a number of states.. On the initial fetch the
713
747
      Local = true;
714
748
   
715
749
   string compExt = flExtension(flNotDir(URI(Desc.URI).Path));
716
 
   const char *decompProg;
717
 
   if(compExt == "bz2") 
718
 
      decompProg = "bzip2";
719
 
   else if(compExt == "gz") 
720
 
      decompProg = "gzip";
 
750
   string decompProg;
 
751
 
 
752
   // get the binary name for your used compression type
 
753
   decompProg = _config->Find(string("Acquire::CompressionTypes::").append(compExt),"");
 
754
   if(decompProg.empty() == false);
721
755
   // flExtensions returns the full name if no extension is found
722
756
   // this is why we have this complicated compare operation here
723
757
   // FIMXE: add a new flJustExtension() that return "" if no
732
766
 
733
767
   Decompression = true;
734
768
   DestFile += ".decomp";
735
 
   Desc.URI = string(decompProg) + ":" + FileName;
 
769
   Desc.URI = decompProg + ":" + FileName;
736
770
   QueueURI(Desc);
737
 
   Mode = decompProg;
 
771
   Mode = decompProg.c_str();
738
772
}
739
 
 
 
773
                                                                        /*}}}*/
740
774
// AcqIndexTrans::pkgAcqIndexTrans - Constructor                        /*{{{*/
741
775
// ---------------------------------------------------------------------
742
776
/* The Translation file is added to the queue */
745
779
  : pkgAcqIndex(Owner, URI, URIDesc, ShortDesc, HashString(), "")
746
780
{
747
781
}
748
 
 
749
782
                                                                        /*}}}*/
750
783
// AcqIndexTrans::Failed - Silence failure messages for missing files   /*{{{*/
751
784
// ---------------------------------------------------------------------
765
798
   Item::Failed(Message,Cnf);
766
799
}
767
800
                                                                        /*}}}*/
768
 
 
769
 
pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,
 
801
pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,                         /*{{{*/
770
802
                             string URI,string URIDesc,string ShortDesc,
771
803
                             string MetaIndexURI, string MetaIndexURIDesc,
772
804
                             string MetaIndexShortDesc,
855
887
 
856
888
}
857
889
                                                                        /*}}}*/
858
 
void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
 
890
void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
859
891
{
860
892
   string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
861
893
 
891
923
   
892
924
   Item::Failed(Message,Cnf);
893
925
}
894
 
 
895
 
pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire *Owner,
 
926
                                                                        /*}}}*/
 
927
pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire *Owner,                     /*{{{*/
896
928
                                 string URI,string URIDesc,string ShortDesc,
897
929
                                 string SigFile,
898
930
                                 const vector<struct IndexTarget*>* IndexTargets,
911
943
 
912
944
   QueueURI(Desc);
913
945
}
914
 
 
915
946
                                                                        /*}}}*/
916
947
// pkgAcqMetaIndex::Custom600Headers - Insert custom request headers    /*{{{*/
917
948
// ---------------------------------------------------------------------
927
958
   
928
959
   return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
929
960
}
930
 
 
931
 
void pkgAcqMetaIndex::Done(string Message,unsigned long Size,string Hash,
 
961
                                                                        /*}}}*/
 
962
void pkgAcqMetaIndex::Done(string Message,unsigned long Size,string Hash,       /*{{{*/
932
963
                           pkgAcquire::MethodConfig *Cfg)
933
964
{
934
965
   Item::Done(Message,Size,Hash,Cfg);
969
1000
      }
970
1001
   }
971
1002
}
972
 
 
973
 
void pkgAcqMetaIndex::RetrievalDone(string Message)
 
1003
                                                                        /*}}}*/
 
1004
void pkgAcqMetaIndex::RetrievalDone(string Message)                     /*{{{*/
974
1005
{
975
1006
   // We have just finished downloading a Release file (it is not
976
1007
   // verified yet)
1008
1039
   chmod(FinalFile.c_str(),0644);
1009
1040
   DestFile = FinalFile;
1010
1041
}
1011
 
 
1012
 
void pkgAcqMetaIndex::AuthDone(string Message)
 
1042
                                                                        /*}}}*/
 
1043
void pkgAcqMetaIndex::AuthDone(string Message)                          /*{{{*/
1013
1044
{
1014
1045
   // At this point, the gpgv method has succeeded, so there is a
1015
1046
   // valid signature from a key in the trusted keyring.  We
1042
1073
   Rename(SigFile,VerifiedSigFile);
1043
1074
   chmod(VerifiedSigFile.c_str(),0644);
1044
1075
}
1045
 
 
1046
 
void pkgAcqMetaIndex::QueueIndexes(bool verify)
 
1076
                                                                        /*}}}*/
 
1077
void pkgAcqMetaIndex::QueueIndexes(bool verify)                         /*{{{*/
1047
1078
{
1048
1079
   for (vector <struct IndexTarget*>::const_iterator Target = IndexTargets->begin();
1049
1080
        Target != IndexTargets->end();
1085
1116
                            (*Target)->ShortDesc, ExpectedIndexHash);
1086
1117
   }
1087
1118
}
1088
 
 
1089
 
bool pkgAcqMetaIndex::VerifyVendor(string Message)
 
1119
                                                                        /*}}}*/
 
1120
bool pkgAcqMetaIndex::VerifyVendor(string Message)                      /*{{{*/
1090
1121
{
1091
1122
//    // Maybe this should be made available from above so we don't have
1092
1123
//    // to read and parse it every time?
1146
1177
      Transformed = "";
1147
1178
   }
1148
1179
 
1149
 
   if (_config->FindB("Acquire::Check-Valid-Until", true)) {
1150
 
      if (MetaIndexParser->GetValidUntil() > 0 &&
1151
 
          time(NULL) > MetaIndexParser->GetValidUntil()) {
1152
 
         return _error->Error(_("Release file expired, ignoring %s (valid until %s)"),
1153
 
                              RealURI.c_str(), 
1154
 
                              TimeRFC1123(MetaIndexParser->GetValidUntil()).c_str());
1155
 
      }
1156
 
   }
1157
 
 
1158
1180
   if (_config->FindB("Debug::pkgAcquire::Auth", false)) 
1159
1181
   {
1160
1182
      std::cerr << "Got Codename: " << MetaIndexParser->GetDist() << std::endl;
1172
1194
//       return false;
1173
1195
      if (!Transformed.empty())
1174
1196
      {
1175
 
         _error->Warning(_("Conflicting distribution: %s (expected %s but got %s)"),
 
1197
         _error->Warning("Conflicting distribution: %s (expected %s but got %s)",
1176
1198
                         Desc.Description.c_str(),
1177
1199
                         Transformed.c_str(),
1178
1200
                         MetaIndexParser->GetDist().c_str());
1181
1203
 
1182
1204
   return true;
1183
1205
}
1184
 
                                                                /*}}}*/
1185
 
// pkgAcqMetaIndex::Failed - no Release file present or no signature
1186
 
//      file present                                            /*{{{*/
 
1206
                                                                        /*}}}*/
 
1207
// pkgAcqMetaIndex::Failed - no Release file present or no signature file present       /*{{{*/
1187
1208
// ---------------------------------------------------------------------
1188
1209
/* */
1189
1210
void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
1220
1241
   // back to queueing Packages files without verification
1221
1242
   QueueIndexes(false);
1222
1243
}
1223
 
 
1224
1244
                                                                        /*}}}*/
1225
 
 
1226
1245
// AcqArchive::AcqArchive - Constructor                                 /*{{{*/
1227
1246
// ---------------------------------------------------------------------
1228
1247
/* This just sets up the initial fetch environment and queues the first
1505
1524
   }
1506
1525
}
1507
1526
                                                                        /*}}}*/
1508
 
// AcqArchive::IsTrusted - Determine whether this archive comes from a
1509
 
// trusted source                                                       /*{{{*/
 
1527
// AcqArchive::IsTrusted - Determine whether this archive comes from a trusted source /*{{{*/
1510
1528
// ---------------------------------------------------------------------
1511
1529
bool pkgAcqArchive::IsTrusted()
1512
1530
{
1513
1531
   return Trusted;
1514
1532
}
1515
 
 
 
1533
                                                                        /*}}}*/
1516
1534
// AcqArchive::Finished - Fetching has finished, tidy up                /*{{{*/
1517
1535
// ---------------------------------------------------------------------
1518
1536
/* */
1524
1542
   StoreFilename = string();
1525
1543
}
1526
1544
                                                                        /*}}}*/
1527
 
 
1528
1545
// AcqFile::pkgAcqFile - Constructor                                    /*{{{*/
1529
1546
// ---------------------------------------------------------------------
1530
1547
/* The file is added to the queue */