apt  0.9.15
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  protected:
446 
450  bool Debug;
451 
456 
460  std::string RealURI;
461 
466 
468  std::string Description;
469 
471  struct DiffInfo const patch;
472 
474  std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches;
475 
478  {
481 
484 
487 
490  } State;
491 
492  public:
498  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
499 
500  virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
502  virtual std::string DescURI() {return RealURI + "Index";};
503 
525  pkgAcqIndexMergeDiffs(pkgAcquire *Owner,std::string const &URI,std::string const &URIDesc,
526  std::string const &ShortDesc, HashString const &ExpectedHash,
527  DiffInfo const &patch, std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches);
528 };
529  /*}}}*/
542 {
543  private:
544 
554  bool QueueNextDiff();
555 
567  void Finish(bool allDone=false);
568 
569  protected:
570 
574  bool Debug;
575 
580 
584  std::string RealURI;
585 
590 
592  std::string Description;
593 
602  std::vector<DiffInfo> available_patches;
603 
605  std::string ServerSha1;
606 
609  {
612 
615 
617  StateUnzipDiff, // FIXME: No longer used
618 
621  } State;
622 
623  public:
624 
630  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
631 
632  virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
634  virtual std::string DescURI() {return RealURI + "Index";};
635 
658  pkgAcqIndexDiffs(pkgAcquire *Owner,std::string URI,std::string URIDesc,
659  std::string ShortDesc, HashString ExpectedHash,
660  std::string ServerSha1,
661  std::vector<DiffInfo> diffs=std::vector<DiffInfo>());
662 };
663  /*}}}*/
672 {
673  protected:
674 
677 
681  bool Erase;
682 
688  // FIXME: instead of a bool it should use a verify string that will
689  // then be used in the pkgAcqIndex::Done method to ensure that
690  // the downloaded file contains the expected tag
691  bool Verify;
692 
697 
701  std::string RealURI;
702 
705 
709  std::string CompressionExtension;
710 
711  public:
712 
713  // Specialized action members
714  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
715  virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
717  virtual std::string Custom600Headers();
718  virtual std::string DescURI() {return Desc.URI;};
719  virtual std::string HashSum() {return ExpectedHash.toStr(); };
720 
740  pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
741  std::string ShortDesc, HashString ExpectedHash,
742  std::string compressExt="");
743  pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target,
744  HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
745  void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc);
746 };
747  /*}}}*/
756 {
757  public:
758 
759  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
760  virtual std::string Custom600Headers();
761 
773  pkgAcqIndexTrans(pkgAcquire *Owner,std::string URI,std::string URIDesc,
774  std::string ShortDesc);
775  pkgAcqIndexTrans(pkgAcquire *Owner, struct IndexTarget const * const Target,
776  HashString const &ExpectedHash, indexRecords const *MetaIndexParser);
777 };
778  /*}}}*/ /*{{{*/
781 {
782  public:
784  std::string URI;
785 
787  std::string Description;
788 
790  std::string ShortDesc;
791 
795  std::string MetaKey;
796 
797  virtual bool IsOptional() const {
798  return false;
799  }
800  virtual bool IsSubIndex() const {
801  return false;
802  }
803 };
804  /*}}}*/ /*{{{*/
807 {
808  virtual bool IsOptional() const {
809  return true;
810  }
811 };
812  /*}}}*/ /*{{{*/
815 {
816  virtual bool IsSubIndex() const {
817  return true;
818  }
819 };
820  /*}}}*/ /*{{{*/
823 {
824  virtual bool IsSubIndex() const {
825  return true;
826  }
827 };
828  /*}}}*/
829 
839 {
840  protected:
842  std::string LastGoodSig;
843 
846 
851  std::string RealURI;
852 
854  std::string MetaIndexURI;
855 
859  std::string MetaIndexURIDesc;
860 
864  std::string MetaIndexShortDesc;
865 
868 
874  const std::vector<struct IndexTarget*>* IndexTargets;
875 
876  public:
877 
878  // Specialized action members
879  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
880  virtual void Done(std::string Message,unsigned long long Size,std::string Md5Hash,
882  virtual std::string Custom600Headers();
883  virtual std::string DescURI() {return RealURI; };
884 
886  pkgAcqMetaSig(pkgAcquire *Owner,std::string URI,std::string URIDesc, std::string ShortDesc,
887  std::string MetaIndexURI, std::string MetaIndexURIDesc, std::string MetaIndexShortDesc,
888  const std::vector<struct IndexTarget*>* IndexTargets,
890  virtual ~pkgAcqMetaSig();
891 };
892  /*}}}*/
904 {
905  protected:
908 
912  std::string RealURI;
913 
919  std::string SigFile;
920 
922  const std::vector<struct IndexTarget*>* IndexTargets;
923 
926 
929  bool AuthPass;
930  // required to deal gracefully with problems caused by incorrect ims hits
931  bool IMSHit;
932 
938  bool VerifyVendor(std::string Message);
939 
949  void RetrievalDone(std::string Message);
950 
960  void AuthDone(std::string Message);
961 
970  void QueueIndexes(bool verify);
971 
972  public:
973 
974  // Specialized action members
975  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
976  virtual void Done(std::string Message,unsigned long long Size, std::string Hash,
978  virtual std::string Custom600Headers();
979  virtual std::string DescURI() {return RealURI; };
980 
983  std::string URI,std::string URIDesc, std::string ShortDesc,
984  std::string SigFile,
985  const std::vector<struct IndexTarget*>* IndexTargets,
987 };
988  /*}}}*/
991 {
993  std::string MetaIndexURI;
994 
996  std::string MetaIndexURIDesc;
997 
999  std::string MetaIndexShortDesc;
1000 
1002  std::string MetaSigURI;
1003 
1005  std::string MetaSigURIDesc;
1006 
1008  std::string MetaSigShortDesc;
1009 
1010 public:
1011  void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
1012  virtual std::string Custom600Headers();
1013 
1016  std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc,
1017  std::string const &MetaIndexURI, std::string const &MetaIndexURIDesc, std::string const &MetaIndexShortDesc,
1018  std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc,
1019  const std::vector<struct IndexTarget*>* IndexTargets,
1021  virtual ~pkgAcqMetaClearSig();
1022 };
1023  /*}}}*/
1030 {
1031  protected:
1034 
1037 
1042 
1047 
1050 
1054  std::string &StoreFilename;
1055 
1058 
1064  unsigned int Retries;
1065 
1069  bool Trusted;
1070 
1072  bool QueueNext();
1073 
1074  public:
1075 
1076  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
1077  virtual void Done(std::string Message,unsigned long long Size,std::string Hash,
1079  virtual std::string DescURI() {return Desc.URI;};
1080  virtual std::string ShortDesc() {return Desc.ShortDesc;};
1081  virtual void Finished();
1082  virtual std::string HashSum() {return ExpectedHash.toStr(); };
1083  virtual bool IsTrusted();
1084 
1105  std::string &StoreFilename);
1106 };
1107  /*}}}*/
1115 {
1117  pkgAcquire::ItemDesc Desc;
1118 
1120  HashString ExpectedHash;
1121 
1125  unsigned int Retries;
1126 
1128  bool IsIndexFile;
1129 
1130  public:
1131 
1132  // Specialized action members
1133  virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
1134  virtual void Done(std::string Message,unsigned long long Size,std::string CalcHash,
1136  virtual std::string DescURI() {return Desc.URI;};
1137  virtual std::string HashSum() {return ExpectedHash.toStr(); };
1138  virtual std::string Custom600Headers();
1139 
1171  pkgAcqFile(pkgAcquire *Owner, std::string URI, std::string Hash, unsigned long long Size,
1172  std::string Desc, std::string ShortDesc,
1173  const std::string &DestDir="", const std::string &DestFilename="",
1174  bool IsIndexFile=false);
1175 };
1176  /*}}}*/
1179 #endif
virtual std::string DescURI()
A "descriptive" URI-like string.
Definition: acquire-item.h:1079
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:1167
unsigned long ID
A client-supplied unique identifier.
Definition: acquire-item.h:140
virtual std::string DescURI()
A "descriptive" URI-like string.
Definition: acquire-item.h:400
The diff is currently being uncompressed.
Definition: acquire-item.h:617
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:1261
std::string Description
description of the file being downloaded.
Definition: acquire-item.h:468
An item repsonsible for downloading clearsigned metaindexes {{{.
Definition: acquire-item.h:990
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'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:2207
std::string URI
A URI from which the index file can be downloaded.
Definition: acquire-item.h:784
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 "descriptive" URI-like string.
Definition: acquire-item.h:634
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:851
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:725
virtual ~Item()
Remove this item from its owner's queue by invoking pkgAcquire::Remove.
Definition: acquire-item.cc:58
virtual std::string DescURI()
A "descriptive" URI-like string.
Definition: acquire-item.h:718
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:1205
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn't be fetched.
Definition: acquire-item.cc:67
bool Local
If true, the URI of this object is "local".
Definition: acquire-item.h:153
bool Debug
If true, debugging output will be written to std::clog.
Definition: acquire-item.h:450
HashString ExpectedHash
HashSum of the package index file that is being reconstructed.
Definition: acquire-item.h:465
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:854
std::string ShortDesc
A shorter description of the index file.
Definition: acquire-item.h:790
pkgRecords * Recs
A package records object, used to look up the file corresponding to each version of the package...
Definition: acquire-item.h:1046
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:1064
std::string sha1
Definition: acquire-item.h:307
void QueueIndexes(bool verify)
Starts downloading the individual index files.
Definition: acquire-item.cc:1515
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:838
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:1793
ItemState
The current status of this item.
Definition: acquire-item.h:90
Information about an subindex index file.
Definition: acquire-item.h:822
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's queue.
Definition: acquire-item.h:74
virtual std::string DescURI()
A "descriptive" URI-like string.
Definition: acquire-item.h:502
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:901
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn't be fetched.
Definition: acquire-item.cc:2266
pkgAcqArchive(pkgAcquire *Owner, pkgSourceList *Sources, pkgRecords *Recs, pkgCache::VerIterator const &Version, std::string &StoreFilename)
Create a new pkgAcqArchive.
Definition: acquire-item.cc:1836
Information about an index file.
Definition: acquire-item.h:780
virtual std::string DescURI()
A "descriptive" URI-like string.
Definition: acquire-item.h:883
virtual std::string ShortDesc()
Short item description.
Definition: acquire-item.h:238
std::string ServerSha1
Definition: acquire-item.h:605
virtual std::string HashSum()
HashSum.
Definition: acquire-item.h:1082
std::string MetaIndexShortDesc
A brief description of the meta-index file to be fetched after the signature.
Definition: acquire-item.h:864
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:1367
virtual std::string DescURI()=0
A "descriptive" URI-like string.
pkgAcquire::ItemDesc Desc
The fetch command that is currently being processed.
Definition: acquire-item.h:1036
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:912
An acquire item that is responsible for fetching an index {{{ file (e.g., Packages or Sources)...
Definition: acquire-item.h:671
DiffState
Definition: acquire-item.h:608
std::string RealURI
The URI of the package index file that is being reconstructed.
Definition: acquire-item.h:584
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't be fetched.
Definition: acquire-item.cc:1307
std::string RealURI
URI of the package index file that is being reconstructed.
Definition: acquire-item.h:460
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:709
void QueueURI(ItemDesc &Item)
Insert this item into its owner's queue.
Definition: acquire-item.h:70
The diff is currently being fetched.
Definition: acquire-item.h:614
Definition: hashes.h:34
std::string & StoreFilename
A location in which the actual filename of the package should be stored.
Definition: acquire-item.h:1054
const std::vector< struct IndexTarget * > * IndexTargets
The index files to download.
Definition: acquire-item.h:922
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:874
pkgAcquire::ItemDesc Desc
A description of the item that is currently being downloaded.
Definition: acquire-item.h:579
void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn't be fetched.
Definition: acquire-item.cc:1809
void RetrievalDone(std::string Message)
Called when a file is finished being retrieved.
Definition: acquire-item.cc:1437
pkgAcquire::ItemDesc Desc
The fetch command that is currently being processed.
Definition: acquire-item.h:907
The core download scheduler. {{{.
Definition: acquire.h:93
An item that is responsible for fetching server-merge patches {{{ that need to be applied to a given ...
Definition: acquire-item.h:541
pkgCache::VerFileIterator Vf
The next file for this version to try to download.
Definition: acquire-item.h:1057
Definition: sourcelist.h:46
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:787
pkgAcquire::ItemDesc Desc
description of the item that is currently being downloaded.
Definition: acquire-item.h:455
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn't be fetched.
Definition: acquire-item.cc:547
Information about an optional index file.
Definition: acquire-item.h:806
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:903
virtual std::string HashSum()
HashSum.
Definition: acquire-item.h:719
pkgAcqIndexTrans(pkgAcquire *Owner, std::string URI, std::string URIDesc, std::string ShortDesc)
Create a pkgAcqIndexTrans.
Definition: acquire-item.cc:1154
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:1029
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:561
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Called when the patch file failed to be downloaded.
Definition: acquire-item.cc:627
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:1270
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Called when the patch file failed to be downloaded.
Definition: acquire-item.cc:810
pkgCache::VerIterator Version
The package version being fetched.
Definition: acquire-item.h:1033
The diff is currently being fetched.
Definition: acquire-item.h:480
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:2286
std::vector< DiffInfo > available_patches
Definition: acquire-item.h:602
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:596
pkgAcquire::ItemDesc Desc
The download request that is currently being processed.
Definition: acquire-item.h:696
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn't be fetched.
Definition: acquire-item.cc:1692
virtual std::string Custom600Headers()
Custom headers to be sent to the fetch process.
Definition: acquire-item.cc:974
bool Trusted
true if this version file is being downloaded from a trusted source.
Definition: acquire-item.h:1069
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:1344
std::string Description
Definition: acquire-item.h:592
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 "descriptive" URI-like string.
Definition: acquire-item.h:979
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn't be fetched.
Definition: acquire-item.cc:2110
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 "Package" tag is found in the index. This can be set to false...
Definition: acquire-item.h:691
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn't be fetched.
Definition: acquire-item.cc:1181
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:2060
Retrieve an arbitrary file to the current directory. {{{.
Definition: acquire-item.h:1114
virtual std::string ShortDesc()
Short item description.
Definition: acquire-item.h:1080
pkgAcqIndexMergeDiffs(pkgAcquire *Owner, std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc, HashString const &ExpectedHash, DiffInfo const &patch, std::vector< pkgAcqIndexMergeDiffs * > const *const allPatches)
Create an index merge-diff item.
Definition: acquire-item.cc:781
The diff is in an unknown state.
Definition: acquire-item.h:611
pkgAcquire::ItemDesc Desc
The fetch request that is currently being processed.
Definition: acquire-item.h:845
The diff is currently being applied.
Definition: acquire-item.h:620
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:574
virtual std::string HashSum()
HashSum.
Definition: acquire-item.h:248
virtual bool IsTrusted()
Definition: acquire-item.cc:2147
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:1612
something bad happened and fallback was triggered
Definition: acquire-item.h:489
std::string RealURI
The object that is actually being fetched (minus any compression-related extensions).
Definition: acquire-item.h:701
bool Decompression
If true, the index file has been decompressed.
Definition: acquire-item.h:676
An item that is responsible for fetching client-merge patches {{{ that need to be applied to a given ...
Definition: acquire-item.h:443
virtual std::string HashSum()
HashSum.
Definition: acquire-item.h:1137
std::vector< pkgAcqIndexMergeDiffs * > const *const allPatches
list of all download items for the patches
Definition: acquire-item.h:474
virtual void Finished()
Invoked by the worker when the download is completely done.
Definition: acquire-item.cc:2155
std::string LastGoodSig
The last good signature file.
Definition: acquire-item.h:842
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:1020
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:814
indexRecords * MetaIndexParser
A package-system-specific parser for the meta-index file.
Definition: acquire-item.h:867
HashString ExpectedHash
The expected hashsum of the decompressed index file.
Definition: acquire-item.h:704
virtual std::string DescURI()
A "descriptive" 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:1379
virtual std::string DescURI()
A "descriptive" URI-like string.
Definition: acquire-item.h:1136
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:919
DiffState
Definition: acquire-item.h:477
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:1478
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
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:832
pkgSourceList * Sources
The list of sources from which to pick archives to download this package from.
Definition: acquire-item.h:1041
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:681
void ReportMirrorFailure(std::string FailCode)
Report mirror problem.
Definition: acquire-item.cc:174
struct DiffInfo const patch
information about the current patch
Definition: acquire-item.h:471
The diff is currently being applied.
Definition: acquire-item.h:483
Definition: cacheiterators.h:385
the work with this diff is done
Definition: acquire-item.h:486
virtual void Failed(std::string Message, pkgAcquire::MethodConfig *Cnf)
Invoked by the acquire worker when the object couldn't be fetched.
Definition: acquire-item.cc:993
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:1922
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:1757
std::string MetaKey
The key by which this index file should be looked up within the meta signature file.
Definition: acquire-item.h:795
HashString ExpectedHash
The HashSum of the package index file that is being reconstructed.
Definition: acquire-item.h:589
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:755
bool AuthPass
If true, the index's signature is currently being verified.
Definition: acquire-item.h:929
HashString ExpectedHash
The hashsum of this package.
Definition: acquire-item.h:1049
std::string MetaIndexURIDesc
A "URI-style" description of the meta-index file to be fetched after the signature.
Definition: acquire-item.h:859
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:2166
indexRecords * MetaIndexParser
The parser for the meta-index file.
Definition: acquire-item.h:925
std::string ShortDesc
Definition: acquire.h:380
The item has been successfully downloaded.
Definition: acquire-item.h:99