apt  0.9.14.1+nmu1
acquire-item.h
Go to the documentation of this file.
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 // $Id: acquire-item.h,v 1.26.2.3 2004/01/02 18:51:00 mdz Exp $
4 /* ######################################################################
5 
6  Acquire Item - Item to acquire
7 
8  When an item is instantiated it will add it self to the local list in
9  the Owner Acquire class. Derived classes will then call QueueURI to
10  register all the URI's they wish to fetch at the initial moment.
11 
12  Three item classes are provided to provide functionality for
13  downloading of Index, Translation and Packages files.
14 
15  A Archive class is provided for downloading .deb files. It does Hash
16  checking and source location as well as a retry algorithm.
17 
18  ##################################################################### */
19  /*}}}*/
20 #ifndef PKGLIB_ACQUIRE_ITEM_H
21 #define PKGLIB_ACQUIRE_ITEM_H
22 
23 #include <apt-pkg/acquire.h>
24 #include <apt-pkg/hashes.h>
25 #include <apt-pkg/weakptr.h>
26 #include <apt-pkg/pkgcache.h>
27 
28 #ifndef APT_8_CLEANER_HEADERS
29 #include <apt-pkg/indexfile.h>
30 #include <apt-pkg/vendor.h>
31 #include <apt-pkg/sourcelist.h>
32 #include <apt-pkg/pkgrecords.h>
33 #include <apt-pkg/indexrecords.h>
34 #endif
35 
42 class indexRecords;
43 class pkgRecords;
44 class pkgSourceList;
45 
59 {
60  protected:
61 
64 
70  inline void QueueURI(ItemDesc &Item)
71  {Owner->Enqueue(Item);};
72 
74  inline void Dequeue() {Owner->Dequeue(this);};
75 
85  void Rename(std::string From,std::string To);
86 
87  public:
88 
90  enum ItemState
91  {
94 
97 
100 
105 
110 
115  } Status;
116 
120  std::string ErrorText;
121 
123  unsigned long long FileSize;
124 
126  unsigned long long PartialSize;
127 
131  const char *Mode;
132 
140  unsigned long ID;
141 
146  bool Complete;
147 
153  bool Local;
154  std::string UsedMirror;
155 
164  unsigned int QueueCounter;
165 
169  std::string DestFile;
170 
184  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
185 
205  virtual void Done(std::string Message,unsigned long long Size,std::string Hash,
207 
217  virtual void Start(std::string Message,unsigned long long Size);
218 
227  virtual std::string Custom600Headers() {return std::string();};
228 
233  virtual std::string DescURI() = 0;
238  virtual std::string ShortDesc() {return DescURI();}
239 
241  virtual void Finished() {};
242 
248  virtual std::string HashSum() {return std::string();};
249 
251  pkgAcquire *GetOwner() {return Owner;};
252 
254  virtual bool IsTrusted() {return false;};
255 
256  // report mirror problems
264  void ReportMirrorFailure(std::string FailCode);
265 
266 
279 
283  virtual ~Item();
284 
285  protected:
286 
287  enum RenameOnErrorState {
288  HashSumMismatch,
289  SizeMismatch,
290  InvalidFormat
291  };
292 
298  bool RenameOnError(RenameOnErrorState const state);
299 };
300  /*}}}*/ /*{{{*/
302 struct DiffInfo {
304  std::string file;
305 
307  std::string sha1;
308 
310  unsigned long size;
311 };
312  /*}}}*/
320 {
321  protected:
323  bool Debug;
324 
327 
331 
332  public:
333  // Specialized action members
334  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
335  virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
337  virtual std::string DescURI() {return Desc.URI;};
338  virtual std::string Custom600Headers();
339  virtual bool ParseIndex(std::string const &IndexFile);
340 
353  pkgAcqSubIndex(pkgAcquire *Owner, std::string const &URI,std::string const &URIDesc,
354  std::string const &ShortDesc, HashString const &ExpectedHash);
355 };
356  /*}}}*/
367 {
368  protected:
370  bool Debug;
371 
374 
378  std::string RealURI;
379 
384 
388  std::string CurrentPackagesFile;
389 
393  std::string Description;
394 
395  public:
396  // Specialized action members
397  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
398  virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
400  virtual std::string DescURI() {return RealURI + "Index";};
401  virtual std::string Custom600Headers();
402 
413  bool ParseDiffIndex(std::string IndexDiffFile);
414 
415 
428  pkgAcqDiffIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
429  std::string ShortDesc, HashString ExpectedHash);
430 };
431  /*}}}*/
444 {
445  private:
446 
456  bool QueueNextDiff();
457 
469  void Finish(bool allDone=false);
470 
471  protected:
472 
476  bool Debug;
477 
482 
486  std::string RealURI;
487 
492 
494  std::string Description;
495 
504  std::vector<DiffInfo> available_patches;
505 
507  std::string ServerSha1;
508 
511  {
514 
517 
519  StateUnzipDiff, // FIXME: No longer used
520 
523  } State;
524 
525  public:
526 
532  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
533 
534  virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
536  virtual std::string DescURI() {return RealURI + "Index";};
537 
560  pkgAcqIndexDiffs(pkgAcquire *Owner,std::string URI,std::string URIDesc,
561  std::string ShortDesc, HashString ExpectedHash,
562  std::string ServerSha1,
563  std::vector<DiffInfo> diffs=std::vector<DiffInfo>());
564 };
565  /*}}}*/
574 {
575  protected:
576 
579 
583  bool Erase;
584 
590  // FIXME: instead of a bool it should use a verify string that will
591  // then be used in the pkgAcqIndex::Done method to ensure that
592  // the downloaded file contains the expected tag
593  bool Verify;
594 
599 
603  std::string RealURI;
604 
607 
611  std::string CompressionExtension;
612 
613  public:
614 
615  // Specialized action members
616  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
617  virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
619  virtual std::string Custom600Headers();
620  virtual std::string DescURI() {return Desc.URI;};
621  virtual std::string HashSum() {return ExpectedHash.toStr(); };
622 
642  pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
643  std::string ShortDesc, HashString ExpectedHash,
644  std::string compressExt="");
645  pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target,
646  HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
647  void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc);
648 };
649  /*}}}*/
658 {
659  public:
660 
661  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
662  virtual std::string Custom600Headers();
663 
675  pkgAcqIndexTrans(pkgAcquire *Owner,std::string URI,std::string URIDesc,
676  std::string ShortDesc);
677  pkgAcqIndexTrans(pkgAcquire *Owner, struct IndexTarget const * const Target,
678  HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
679 };
680  /*}}}*/ /*{{{*/
683 {
684  public:
686  std::string URI;
687 
689  std::string Description;
690 
692  std::string ShortDesc;
693 
697  std::string MetaKey;
698 
699  virtual bool IsOptional() const {
700  return false;
701  }
702  virtual bool IsSubIndex() const {
703  return false;
704  }
705 };
706  /*}}}*/ /*{{{*/
709 {
710  virtual bool IsOptional() const {
711  return true;
712  }
713 };
714  /*}}}*/ /*{{{*/
717 {
718  virtual bool IsSubIndex() const {
719  return true;
720  }
721 };
722  /*}}}*/ /*{{{*/
725 {
726  virtual bool IsSubIndex() const {
727  return true;
728  }
729 };
730  /*}}}*/
731 
741 {
742  protected:
744  std::string LastGoodSig;
745 
748 
753  std::string RealURI;
754 
756  std::string MetaIndexURI;
757 
761  std::string MetaIndexURIDesc;
762 
766  std::string MetaIndexShortDesc;
767 
770 
776  const std::vector<struct IndexTarget*>* IndexTargets;
777 
778  public:
779 
780  // Specialized action members
781  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
782  virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
784  virtual std::string Custom600Headers();
785  virtual std::string DescURI() {return RealURI; };
786 
788  pkgAcqMetaSig(pkgAcquire *Owner,std::string URI,std::string URIDesc, std::string ShortDesc,
789  std::string MetaIndexURI, std::string MetaIndexURIDesc, std::string MetaIndexShortDesc,
790  const std::vector<struct IndexTarget*>* IndexTargets,
792  virtual ~pkgAcqMetaSig();
793 };
794  /*}}}*/
806 {
807  protected:
810 
814  std::string RealURI;
815 
821  std::string SigFile;
822 
824  const std::vector<struct IndexTarget*>* IndexTargets;
825 
828 
831  bool AuthPass;
832  // required to deal gracefully with problems caused by incorrect ims hits
833  bool IMSHit;
834 
840  bool VerifyVendor(std::string Message);
841 
851  void RetrievalDone(std::string Message);
852 
862  void AuthDone(std::string Message);
863 
872  void QueueIndexes(bool verify);
873 
874  public:
875 
876  // Specialized action members
877  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
878  virtual void Done(std::string Message,unsigned long long Size, std::string Hash,
880  virtual std::string Custom600Headers();
881  virtual std::string DescURI() {return RealURI; };
882 
885  std::string URI,std::string URIDesc, std::string ShortDesc,
886  std::string SigFile,
887  const std::vector<struct IndexTarget*>* IndexTargets,
889 };
890  /*}}}*/
893 {
895  std::string MetaIndexURI;
896 
898  std::string MetaIndexURIDesc;
899 
901  std::string MetaIndexShortDesc;
902 
904  std::string MetaSigURI;
905 
907  std::string MetaSigURIDesc;
908 
910  std::string MetaSigShortDesc;
911 
912 public:
913  void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
914  virtual std::string Custom600Headers();
915 
918  std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc,
919  std::string const &MetaIndexURI, std::string const &MetaIndexURIDesc, std::string const &MetaIndexShortDesc,
920  std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc,
921  const std::vector<struct IndexTarget*>* IndexTargets,
923  virtual ~pkgAcqMetaClearSig();
924 };
925  /*}}}*/
932 {
933  protected:
936 
939 
944 
949 
952 
956  std::string &StoreFilename;
957 
960 
966  unsigned int Retries;
967 
971  bool Trusted;
972 
974  bool QueueNext();
975 
976  public:
977 
978  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
979  virtual void Done(std::string Message,unsigned long long Size,std::string Hash,
981  virtual std::string DescURI() {return Desc.URI;};
982  virtual std::string ShortDesc() {return Desc.ShortDesc;};
983  virtual void Finished();
984  virtual std::string HashSum() {return ExpectedHash.toStr(); };
985  virtual bool IsTrusted();
986 
1007  std::string &StoreFilename);
1008 };
1009  /*}}}*/
1017 {
1019  pkgAcquire::ItemDesc Desc;
1020 
1022  HashString ExpectedHash;
1023 
1027  unsigned int Retries;
1028 
1030  bool IsIndexFile;
1031 
1032  public:
1033 
1034  // Specialized action members
1035  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
1036  virtual void Done(std::string Message,unsigned long long Size,std::string CalcHash,
1038  virtual std::string DescURI() {return Desc.URI;};
1039  virtual std::string HashSum() {return ExpectedHash.toStr(); };
1040  virtual std::string Custom600Headers();
1041 
1073  pkgAcqFile(pkgAcquire *Owner, std::string URI, std::string Hash, unsigned long long Size,
1074  std::string Desc, std::string ShortDesc,
1075  const std::string &DestDir="", const std::string &DestFilename="",
1076  bool IsIndexFile=false);
1077 };
1078  /*}}}*/
1081 #endif
virtual std::string DescURI()
A &quot;descriptive&quot; URI-like string.
Definition: acquire-item.h:981
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:1025
unsigned long ID
A client-supplied unique identifier.
Definition: acquire-item.h:140
virtual std::string DescURI()
A &quot;descriptive&quot; URI-like string.
Definition: acquire-item.h:400
The diff is currently being uncompressed.
Definition: acquire-item.h:519
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:1119
An item repsonsible for downloading clearsigned metaindexes {{{.
Definition: acquire-item.h:892
void Dequeue(Item *Item)
Remove all fetch requests for this item from all queues.
Definition: acquire.cc:243
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn&#39;t be fetched.
Definition: acquire-item.cc:256
virtual void Done(std::string Message, unsigned long long Size, std::string Md5Hash, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object was fetched successfully.
Definition: acquire-item.cc:268
unsigned long long FileSize
The size of the object to fetch.
Definition: acquire-item.h:123
std::string URI
The URI from which to download this item.
Definition: acquire.h:376
virtual void Done(std::string Message, unsigned long long Size, std::string CalcHash, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object was fetched successfully.
Definition: acquire-item.cc:2065
std::string URI
A URI from which the index file can be downloaded.
Definition: acquire-item.h:686
Definition: strutl.h:148
virtual bool IsTrusted()
Definition: acquire-item.h:254
virtual void Start(std::string Message, unsigned long long Size)
Invoked when the worker starts to fetch this object.
Definition: acquire-item.cc:101
virtual std::string DescURI()
A &quot;descriptive&quot; URI-like string.
Definition: acquire-item.h:536
std::string RealURI
The URI of the signature file. Unlike Desc.URI, this is never modified; it is used to determine the f...
Definition: acquire-item.h:753
pkgAcquire::ItemDesc Desc
The item that is currently being downloaded.
Definition: acquire-item.h:326
virtual void Done(std::string Message, unsigned long long Size, std::string Md5Hash, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object was fetched successfully.
Definition: acquire-item.cc:700
virtual ~Item()
Remove this item from its owner&#39;s queue by invoking pkgAcquire::Remove.
Definition: acquire-item.cc:58
virtual std::string DescURI()
A &quot;descriptive&quot; URI-like string.
Definition: acquire-item.h:620
pkgAcqDiffIndex(pkgAcquire *Owner, std::string URI, std::string URIDesc, std::string ShortDesc, HashString ExpectedHash)
Create a new pkgAcqDiffIndex.
Definition: acquire-item.cc:335
pkgAcqMetaSig(pkgAcquire *Owner, std::string URI, std::string URIDesc, std::string ShortDesc, std::string MetaIndexURI, std::string MetaIndexURIDesc, std::string MetaIndexShortDesc, const std::vector< struct IndexTarget * > *IndexTargets, indexRecords *MetaIndexParser)
Create a new pkgAcqMetaSig.
Definition: acquire-item.cc:1063
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn&#39;t be fetched.
Definition: acquire-item.cc:67
bool Local
If true, the URI of this object is &quot;local&quot;.
Definition: acquire-item.h:153
bool Debug
If true, debugging information will be written to std::clog.
Definition: acquire-item.h:323
std::string MetaIndexURI
The URI of the meta-index file to be fetched after the signature.
Definition: acquire-item.h:756
std::string ShortDesc
A shorter description of the index file.
Definition: acquire-item.h:692
pkgRecords * Recs
A package records object, used to look up the file corresponding to each version of the package...
Definition: acquire-item.h:948
unsigned int Retries
How many (more) times to try to find a new source from which to download this package version if it f...
Definition: acquire-item.h:966
std::string sha1
Definition: acquire-item.h:307
void QueueIndexes(bool verify)
Starts downloading the individual index files.
Definition: acquire-item.cc:1373
Represents a single download source from which an item should be downloaded.
Definition: acquire.h:373
An acquire item that downloads the detached signature {{{ of a meta-index (Release) file...
Definition: acquire-item.h:740
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.h:227
std::string file
Definition: acquire-item.h:304
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:1651
ItemState
The current status of this item.
Definition: acquire-item.h:90
Information about an subindex index file.
Definition: acquire-item.h:724
pkgCache - Structure definitions for the cache file
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:245
void Dequeue()
Remove this item from its owner&#39;s queue.
Definition: acquire-item.h:74
Item(pkgAcquire *Owner)
Initialize an item.
Definition: acquire-item.cc:47
pkgAcqIndex(pkgAcquire *Owner, std::string URI, std::string URIDesc, std::string ShortDesc, HashString ExpectedHash, std::string compressExt="")
Create a pkgAcqIndex.
Definition: acquire-item.cc:759
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn&#39;t be fetched.
Definition: acquire-item.cc:2124
pkgAcqArchive(pkgAcquire *Owner, pkgSourceList *Sources, pkgRecords *Recs, pkgCache::VerIterator const &Version, std::string &StoreFilename)
Create a new pkgAcqArchive.
Definition: acquire-item.cc:1694
Information about an index file.
Definition: acquire-item.h:682
virtual std::string DescURI()
A &quot;descriptive&quot; URI-like string.
Definition: acquire-item.h:785
virtual std::string ShortDesc()
Short item description.
Definition: acquire-item.h:238
std::string ServerSha1
Definition: acquire-item.h:507
virtual std::string HashSum()
HashSum.
Definition: acquire-item.h:984
std::string MetaIndexShortDesc
A brief description of the meta-index file to be fetched after the signature.
Definition: acquire-item.h:766
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:1225
virtual std::string DescURI()=0
A &quot;descriptive&quot; URI-like string.
pkgAcquire::ItemDesc Desc
The fetch command that is currently being processed.
Definition: acquire-item.h:938
pkgAcqSubIndex(pkgAcquire *Owner, std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc, HashString const &ExpectedHash)
Create a new pkgAcqSubIndex.
Definition: acquire-item.cc:220
std::string RealURI
The URI that is actually being downloaded; never modified by pkgAcqMetaIndex.
Definition: acquire-item.h:814
An acquire item that is responsible for fetching an index {{{ file (e.g., Packages or Sources)...
Definition: acquire-item.h:573
DiffState
Definition: acquire-item.h:510
std::string RealURI
The URI of the package index file that is being reconstructed.
Definition: acquire-item.h:486
An item that is responsible for fetching an index file of {{{ package list diffs and starting the pac...
Definition: acquire-item.h:366
The item is currently being downloaded.
Definition: acquire-item.h:96
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn&#39;t be fetched.
Definition: acquire-item.cc:1165
HashString ExpectedHash
The Hash that this file should have after download.
Definition: acquire-item.h:330
std::string CompressionExtension
The compression-related file extensions that are being added to the downloaded file one by one if fir...
Definition: acquire-item.h:611
void QueueURI(ItemDesc &Item)
Insert this item into its owner&#39;s queue.
Definition: acquire-item.h:70
The diff is currently being fetched.
Definition: acquire-item.h:516
Definition: hashes.h:34
std::string & StoreFilename
A location in which the actual filename of the package should be stored.
Definition: acquire-item.h:956
const std::vector< struct IndexTarget * > * IndexTargets
The index files to download.
Definition: acquire-item.h:824
const std::vector< struct IndexTarget * > * IndexTargets
The index files which should be looked up in the meta-index and then downloaded.
Definition: acquire-item.h:776
pkgAcquire::ItemDesc Desc
A description of the item that is currently being downloaded.
Definition: acquire-item.h:481
void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn&#39;t be fetched.
Definition: acquire-item.cc:1667
void RetrievalDone(std::string Message)
Called when a file is finished being retrieved.
Definition: acquire-item.cc:1295
pkgAcquire::ItemDesc Desc
The fetch command that is currently being processed.
Definition: acquire-item.h:809
The core download scheduler. {{{.
Definition: acquire.h:93
An item that is responsible for fetching all the patches {{{ that need to be applied to a given packa...
Definition: acquire-item.h:443
pkgCache::VerFileIterator Vf
The next file for this version to try to download.
Definition: acquire-item.h:959
Definition: sourcelist.h:45
virtual void Done(std::string Message, unsigned long long Size, std::string Hash, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object was fetched successfully.
Definition: acquire-item.cc:111
std::string Description
A description of the index file.
Definition: acquire-item.h:689
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn&#39;t be fetched.
Definition: acquire-item.cc:522
Information about an optional index file.
Definition: acquire-item.h:708
An item that is responsible for fetching a SubIndex {{{.
Definition: acquire-item.h:319
An item that is responsible for downloading the meta-index {{{ file (i.e., Release) itself and verify...
Definition: acquire-item.h:805
virtual std::string HashSum()
HashSum.
Definition: acquire-item.h:621
pkgAcqIndexTrans(pkgAcquire *Owner, std::string URI, std::string URIDesc, std::string ShortDesc)
Create a pkgAcqIndexTrans.
Definition: acquire-item.cc:1012
bool Debug
If true, debugging information will be written to std::clog.
Definition: acquire-item.h:370
An item that is responsible for fetching a package file. {{{.
Definition: acquire-item.h:931
std::string RealURI
The URI of the index file to recreate at our end (either by downloading it or by applying partial pat...
Definition: acquire-item.h:378
virtual void Done(std::string Message, unsigned long long Size, std::string Md5Hash, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object was fetched successfully.
Definition: acquire-item.cc:536
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Called when the patch file failed to be downloaded.
Definition: acquire-item.cc:602
virtual void Done(std::string Message, unsigned long long Size, std::string Md5Hash, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object was fetched successfully.
Definition: acquire-item.cc:1128
pkgCache::VerIterator Version
The package version being fetched.
Definition: acquire-item.h:935
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:2144
std::vector< DiffInfo > available_patches
Definition: acquire-item.h:504
unsigned long size
Definition: acquire-item.h:310
pkgAcqIndexDiffs(pkgAcquire *Owner, std::string URI, std::string URIDesc, std::string ShortDesc, HashString ExpectedHash, std::string ServerSha1, std::vector< DiffInfo > diffs=std::vector< DiffInfo >())
Create an index diff item.
Definition: acquire-item.cc:571
pkgAcquire::ItemDesc Desc
The download request that is currently being processed.
Definition: acquire-item.h:598
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn&#39;t be fetched.
Definition: acquire-item.cc:1550
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:832
bool Trusted
true if this version file is being downloaded from a trusted source.
Definition: acquire-item.h:971
Definition: cacheiterators.h:185
bool Complete
If true, the entire object has been successfully fetched.
Definition: acquire-item.h:146
pkgAcqMetaIndex(pkgAcquire *Owner, std::string URI, std::string URIDesc, std::string ShortDesc, std::string SigFile, const std::vector< struct IndexTarget * > *IndexTargets, indexRecords *MetaIndexParser)
Create a new pkgAcqMetaIndex.
Definition: acquire-item.cc:1202
std::string Description
Definition: acquire-item.h:494
std::string DestFile
The name of the file into which the retrieved object will be written.
Definition: acquire-item.h:169
Definition: indexrecords.h:20
pkgAcquire::ItemDesc Desc
The item that is currently being downloaded.
Definition: acquire-item.h:373
pkgAcquire * GetOwner()
Definition: acquire-item.h:251
virtual std::string DescURI()
A &quot;descriptive&quot; URI-like string.
Definition: acquire-item.h:881
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn&#39;t be fetched.
Definition: acquire-item.cc:1968
unsigned long long PartialSize
How much of the object was already fetched.
Definition: acquire-item.h:126
void Rename(std::string From, std::string To)
Rename a file without modifying its timestamp.
Definition: acquire-item.cc:134
bool RenameOnError(RenameOnErrorState const state)
Rename failed file and set error.
Definition: acquire-item.cc:146
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:383
Represents the process by which a pkgAcquire object should {{{ retrieve a file or a collection of fil...
Definition: acquire-item.h:58
The item was could not be downloaded because of a transient network error (e.g. network down) ...
Definition: acquire-item.h:114
bool Verify
Verify for correctness by checking if a &quot;Package&quot; tag is found in the index. This can be set to false...
Definition: acquire-item.h:593
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn&#39;t be fetched.
Definition: acquire-item.cc:1039
virtual void Done(std::string Message, unsigned long long Size, std::string Hash, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object was fetched successfully.
Definition: acquire-item.cc:1918
Retrieve an arbitrary file to the current directory. {{{.
Definition: acquire-item.h:1016
virtual std::string ShortDesc()
Short item description.
Definition: acquire-item.h:982
The diff is in an unknown state.
Definition: acquire-item.h:513
pkgAcquire::ItemDesc Desc
The fetch request that is currently being processed.
Definition: acquire-item.h:747
The diff is currently being applied.
Definition: acquire-item.h:522
std::string ErrorText
Contains a textual description of the error encountered if #Status is StatError or StatAuthError...
Definition: acquire-item.h:120
The item was downloaded but its authenticity could not be verified.
Definition: acquire-item.h:109
bool Debug
If true, debugging output will be written to std::clog.
Definition: acquire-item.h:476
virtual std::string HashSum()
HashSum.
Definition: acquire-item.h:248
virtual bool IsTrusted()
Definition: acquire-item.cc:2005
void Enqueue(ItemDesc &Item)
Insert the given fetch request into the appropriate queue.
Definition: acquire.cc:200
std::string Description
A description of the Packages file (stored in pkgAcquire::ItemDesc::Description). ...
Definition: acquire-item.h:393
unsigned int QueueCounter
The number of fetch queues into which this item has been inserted.
Definition: acquire-item.h:164
bool VerifyVendor(std::string Message)
Check that the release file is a release file for the correct distribution.
Definition: acquire-item.cc:1470
std::string RealURI
The object that is actually being fetched (minus any compression-related extensions).
Definition: acquire-item.h:603
bool Decompression
If true, the index file has been decompressed.
Definition: acquire-item.h:578
virtual std::string HashSum()
HashSum.
Definition: acquire-item.h:1039
virtual void Finished()
Invoked by the worker when the download is completely done.
Definition: acquire-item.cc:2013
std::string LastGoodSig
The last good signature file.
Definition: acquire-item.h:744
virtual void Done(std::string Message, unsigned long long Size, std::string Md5Hash, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object was fetched successfully.
Definition: acquire-item.cc:878
virtual void Finished()
Invoked by the worker when the download is completely done.
Definition: acquire-item.h:241
Information about an subindex index file.
Definition: acquire-item.h:716
indexRecords * MetaIndexParser
A package-system-specific parser for the meta-index file.
Definition: acquire-item.h:769
HashString ExpectedHash
The expected hashsum of the decompressed index file.
Definition: acquire-item.h:606
virtual std::string DescURI()
A &quot;descriptive&quot; URI-like string.
Definition: acquire-item.h:337
virtual void Done(std::string Message, unsigned long long Size, std::string Hash, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object was fetched successfully.
Definition: acquire-item.cc:1237
virtual std::string DescURI()
A &quot;descriptive&quot; URI-like string.
Definition: acquire-item.h:1038
HashString ExpectedHash
The Hash that the real index file should have after all patches have been applied.
Definition: acquire-item.h:383
std::string SigFile
The file in which the signature for this index was stored.
Definition: acquire-item.h:821
Definition: pkgrecords.h:24
An error was encountered while downloading this item.
Definition: acquire-item.h:104
std::string CurrentPackagesFile
The index file which will be patched to generate the new file.
Definition: acquire-item.h:388
void AuthDone(std::string Message)
Called when authentication succeeded.
Definition: acquire-item.cc:1336
The item is waiting to be downloaded.
Definition: acquire-item.h:93
Information about the properties of a single acquire method. {{{.
Definition: acquire.h:595
pkgSourceList * Sources
The list of sources from which to pick archives to download this package from.
Definition: acquire-item.h:943
pkgAcquire * Owner
The acquire object with which this item is associated.
Definition: acquire-item.h:63
bool Erase
If true, the partially downloaded file will be removed when the download completes.
Definition: acquire-item.h:583
void ReportMirrorFailure(std::string FailCode)
Report mirror problem.
Definition: acquire-item.cc:174
Definition: cacheiterators.h:385
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn&#39;t be fetched.
Definition: acquire-item.cc:851
const char * Mode
If not NULL, contains the name of a subprocess that is operating on this object (for instance...
Definition: acquire-item.h:131
bool QueueNext()
Queue up the next available file for this version.
Definition: acquire-item.cc:1780
Definition: weakptr.h:34
pkgAcqMetaClearSig(pkgAcquire *Owner, std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc, std::string const &MetaIndexURI, std::string const &MetaIndexURIDesc, std::string const &MetaIndexShortDesc, std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc, const std::vector< struct IndexTarget * > *IndexTargets, indexRecords *MetaIndexParser)
Create a new pkgAcqMetaClearSig.
Definition: acquire-item.cc:1615
std::string MetaKey
The key by which this index file should be looked up within the meta signature file.
Definition: acquire-item.h:697
HashString ExpectedHash
The HashSum of the package index file that is being reconstructed.
Definition: acquire-item.h:491
bool ParseDiffIndex(std::string IndexDiffFile)
Parse the Index file for a set of Packages diffs.
Definition: acquire-item.cc:398
An acquire item that is responsible for fetching a {{{ translated index file.
Definition: acquire-item.h:657
bool AuthPass
If true, the index&#39;s signature is currently being verified.
Definition: acquire-item.h:831
HashString ExpectedHash
The hashsum of this package.
Definition: acquire-item.h:951
std::string MetaIndexURIDesc
A &quot;URI-style&quot; description of the meta-index file to be fetched after the signature.
Definition: acquire-item.h:761
Information about an index patch (aka diff).
Definition: acquire-item.h:302
pkgAcqFile(pkgAcquire *Owner, std::string URI, std::string Hash, unsigned long long Size, std::string Desc, std::string ShortDesc, const std::string &DestDir="", const std::string &DestFilename="", bool IsIndexFile=false)
Create a new pkgAcqFile object.
Definition: acquire-item.cc:2024
indexRecords * MetaIndexParser
The parser for the meta-index file.
Definition: acquire-item.h:827
std::string ShortDesc
Definition: acquire.h:380
The item has been successfully downloaded.
Definition: acquire-item.h:99