apt: apt-pkg/acquire-item.h Source File

apt 2.7.6 commandline package manager

acquire-item.h
Go to the documentation of this file.
1// -*- mode: cpp; mode: fold -*-
2// Description /*{{{*/
3/* ######################################################################
4
5 Acquire Item - Item to acquire
6
7 When an item is instantiated it will add it self to the local list in
8 the Owner Acquire class. Derived classes will then call QueueURI to
9 register all the URI's they wish to fetch at the initial moment.
10
11 Three item classes are provided to provide functionality for
12 downloading of Index, Translation and Packages files.
13
14 A Archive class is provided for downloading .deb files. It does Hash
15 checking and source location as well as a retry algorithm.
16
17 ##################################################################### */
18 /*}}}*/
19#ifndef PKGLIB_ACQUIRE_ITEM_H
20#define PKGLIB_ACQUIRE_ITEM_H
21
22#include <apt-pkg/acquire.h>
23#include <apt-pkg/hashes.h>
24#include <apt-pkg/indexfile.h>
25#include <apt-pkg/pkgcache.h>
26#include <apt-pkg/weakptr.h>
27
28#include <map>
29#include <string>
30#include <unordered_map>
31#include <vector>
32
33
40class pkgRecords;
41class pkgSourceList;
42class pkgAcqMetaClearSig;
43class pkgAcqIndexMergeDiffs;
44class metaIndex;
45
46 class APT_PUBLIC pkgAcquire::Item : public WeakPointable /*{{{*/
59{
60 public:
61
63 enum ItemState
64 {
66 StatIdle,
67
69 StatFetching,
70
72 StatDone,
73
77 StatError,
78
82 StatAuthError,
83
87 StatTransientNetworkError,
88 } Status;
89
93 std::string ErrorText;
94
96 unsigned long long FileSize;
97
99 unsigned long long PartialSize;
100
104 std::string ActiveSubprocess;
105
113 unsigned long ID;
114
119 bool Complete;
120
126 bool Local;
127
128 std::string UsedMirror;
129
138 unsigned int QueueCounter;
139
148 unsigned int ExpectedAdditionalItems;
149
153 std::string DestFile;
154
156 unsigned int Retries;
157
171 virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf);
172 APT_HIDDEN void FailMessage(std::string const &Message);
173
193 virtual bool VerifyDone(std::string const &Message,
194 pkgAcquire::MethodConfig const * const Cnf);
195
214 virtual void Done(std::string const &Message, HashStringList const &Hashes,
215 pkgAcquire::MethodConfig const * const Cnf);
216
226 virtual void Start(std::string const &Message, unsigned long long const Size);
227
236 virtual std::string Custom600Headers() const;
237 // this is more a hack than a proper external interface, hence hidden
238 APT_HIDDEN std::unordered_map<std::string, std::string> &ModifyCustomFields();
239 // this isn't the super nicest interface either…
240 APT_HIDDEN bool PopAlternativeURI(std::string &NewURI);
241 APT_HIDDEN bool IsGoodAlternativeURI(std::string const &AltUri) const;
242 APT_HIDDEN void PushAlternativeURI(std::string &&NewURI, std::unordered_map<std::string, std::string> &&fields, bool const at_the_back);
243 APT_HIDDEN void RemoveAlternativeSite(std::string &&OldSite);
244
249 virtual std::string DescURI() const = 0;
254 virtual std::string ShortDesc() const;
255
257 virtual void Finished();
258
260 virtual HashStringList GetExpectedHashes() const = 0;
262 std::string HashSum() const;
263
270 virtual bool HashesRequired() const { return true; }
271
273 pkgAcquire *GetOwner() const;
274 pkgAcquire::ItemDesc &GetItemDesc();
275
277 virtual bool IsTrusted() const;
278
283 void SetActiveSubprocess(std::string const &subprocess);
284
293 explicit Item(pkgAcquire * const Owner);
294
298 virtual ~Item();
299
300 bool APT_HIDDEN IsRedirectionLoop(std::string const &NewURI);
302 int APT_HIDDEN Priority();
303
305 void APT_HIDDEN FetchAfter(time_point FetchAfter);
306 time_point APT_HIDDEN FetchAfter();
307
308 protected:
310 pkgAcquire * const Owner;
311
313 pkgAcquire::ItemDesc Desc;
314
315 enum RenameOnErrorState {
316 HashSumMismatch,
317 SizeMismatch,
318 InvalidFormat,
319 SignatureError,
320 NotClearsigned,
321 MaximumSizeExceeded,
322 PDiffError,
323 };
324
329 bool RenameOnError(RenameOnErrorState const state);
330
341 virtual bool QueueURI(ItemDesc &Item);
342
344 void Dequeue();
345
355 bool Rename(std::string const &From, std::string const &To);
356
358 virtual std::string GetFinalFilename() const;
359
360 private:
361 class Private;
362 Private * const d;
363
364 friend class pkgAcqMetaBase;
365 friend class pkgAcqMetaClearSig;
366};
367 /*}}}*/
368 class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/
370{
371 void * const d;
372 protected:
373 HashStringList GetExpectedHashesFor(std::string const &MetaKey) const;
374
375 bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE;
376
377 public:
378 IndexTarget const Target;
379
381 std::string PartialFile;
382
384 pkgAcqMetaClearSig * const TransactionManager;
385
386 enum TransactionStates {
387 TransactionStarted,
388 TransactionCommit,
389 TransactionAbort,
390 };
391 virtual bool TransactionState(TransactionStates const state);
392
393 virtual std::string DescURI() const APT_OVERRIDE { return Target.URI; }
394 virtual HashStringList GetExpectedHashes() const APT_OVERRIDE;
395 virtual std::string GetMetaKey() const;
396 virtual bool HashesRequired() const APT_OVERRIDE;
397 virtual bool AcquireByHash() const;
398
399 pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target) APT_NONNULL(2, 3);
400 virtual ~pkgAcqTransactionItem();
401
402 friend class pkgAcqMetaBase;
403 friend class pkgAcqMetaClearSig;
404};
405 /*}}}*/
406class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/
408{
409 void * const d;
410 protected:
411 std::vector<pkgAcqTransactionItem*> Transaction;
412
415 bool AuthPass;
416
426 bool CheckDownloadDone(pkgAcqTransactionItem * const I, const std::string &Message, HashStringList const &Hashes) const;
427
429 void QueueForSignatureVerify(pkgAcqTransactionItem * const I, std::string const &File, std::string const &Signature);
430
431 virtual std::string Custom600Headers() const APT_OVERRIDE;
432
443 bool CheckAuthDone(std::string const &Message, pkgAcquire::MethodConfig const *const Cnf);
444
446 bool CheckStopAuthentication(pkgAcquire::Item * const I, const std::string &Message);
447
453 bool VerifyVendor(std::string const &Message);
454
455 virtual bool TransactionState(TransactionStates const state) APT_OVERRIDE;
456
457 public:
458 // This refers more to the Transaction-Manager than the actual file
459 bool IMSHit;
460 TransactionStates State;
461 std::string BaseURI;
462
463 virtual bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE;
464 virtual HashStringList GetExpectedHashes() const APT_OVERRIDE;
465 virtual bool HashesRequired() const APT_OVERRIDE;
466
467 // transaction code
468 void Add(pkgAcqTransactionItem * const I);
469 void AbortTransaction();
470 bool TransactionHasError() const;
471 void CommitTransaction();
472
475 void TransactionStageCopy(pkgAcqTransactionItem * const I,
476 const std::string &From,
477 const std::string &To);
480 void TransactionStageRemoval(pkgAcqTransactionItem * const I, const std::string &FinalFile);
481
483 virtual std::string GetFinalFilename() const APT_OVERRIDE;
484
485 pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
486 IndexTarget const &DataTarget) APT_NONNULL(2, 3);
487 virtual ~pkgAcqMetaBase();
488};
489 /*}}}*/
500class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase
501{
502 void * const d;
503 protected:
504 IndexTarget const DetachedSigTarget;
505
507 void Init(std::string const &URIDesc, std::string const &ShortDesc);
508
509 public:
510 virtual std::string DescURI() const APT_OVERRIDE;
511
512 // Specialized action members
513 virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
514 virtual void Done(std::string const &Message, HashStringList const &Hashes,
515 pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
516
518 pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
519 IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget) APT_NONNULL(2, 3);
520 virtual ~pkgAcqMetaIndex();
521
522 friend class pkgAcqMetaSig;
523};
524 /*}}}*/
533class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem
534{
535 void * const d;
536
537 pkgAcqMetaIndex * const MetaIndex;
538
540 std::string MetaIndexFileSignature;
541
542 protected:
543
545 virtual std::string GetFinalFilename() const APT_OVERRIDE;
546
547 public:
548 virtual bool HashesRequired() const APT_OVERRIDE { return false; }
549
550 // Specialized action members
551 virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
552 virtual void Done(std::string const &Message, HashStringList const &Hashes,
553 pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
554 virtual std::string Custom600Headers() const APT_OVERRIDE;
555
557 pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
558 IndexTarget const &Target, pkgAcqMetaIndex * const MetaIndex) APT_NONNULL(2, 3, 5);
559 virtual ~pkgAcqMetaSig();
560};
561 /*}}}*/
563 class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex
564{
565 void * const d;
566 IndexTarget const DetachedDataTarget;
567
568 public:
570 metaIndex *MetaIndexParser;
571 metaIndex *LastMetaIndexParser;
572
573 virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
574 virtual std::string Custom600Headers() const APT_OVERRIDE;
575 virtual bool VerifyDone(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
576 virtual void Done(std::string const &Message, HashStringList const &Hashes,
577 pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
578 virtual void Finished() APT_OVERRIDE;
579
588 void QueueIndexes(bool const verify);
589
591 pkgAcqMetaClearSig(pkgAcquire * const Owner,
592 IndexTarget const &ClearsignedTarget,
593 IndexTarget const &DetachedDataTarget,
594 IndexTarget const &DetachedSigTarget,
595 metaIndex * const MetaIndexParser);
596 virtual ~pkgAcqMetaClearSig();
597};
598 /*}}}*/
600class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem
601{
602 void * const d;
603
604 public:
606 virtual std::string GetFinalFilename() const APT_OVERRIDE;
607 virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
608
609 pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
610 IndexTarget const &Target) APT_NONNULL(2, 3);
611 virtual ~pkgAcqBaseIndex();
612};
613 /*}}}*/
621 class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex
622{
623 void * const d;
624
625 protected:
626
632 enum AllStages {
633 STAGE_DOWNLOAD,
634 STAGE_DECOMPRESS_AND_VERIFY,
635 };
636 AllStages Stage;
637
639 void StageDownloadDone(std::string const &Message);
640
644 void StageDecompressDone();
645
649 std::string EraseFileName;
650
654 std::string CompressionExtensions;
655
657 std::string CurrentCompressionExtension;
658
660 void InitByHashIfNeeded();
661
663 virtual std::string GetFinalFilename() const APT_OVERRIDE;
664
665 virtual bool TransactionState(TransactionStates const state) APT_OVERRIDE;
666
667 public:
668 // Specialized action members
669 virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
670 virtual void Done(std::string const &Message, HashStringList const &Hashes,
671 pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
672 virtual std::string Custom600Headers() const APT_OVERRIDE;
673 virtual std::string DescURI() const APT_OVERRIDE {return Desc.URI;};
674 virtual std::string GetMetaKey() const APT_OVERRIDE;
675
676 pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
677 IndexTarget const &Target, bool const Derived = false) APT_NONNULL(2, 3);
678 virtual ~pkgAcqIndex();
679
680 protected:
681 APT_HIDDEN void Init(std::string const &URI, std::string const &URIDesc,
682 std::string const &ShortDesc);
683 APT_HIDDEN bool CommonFailed(std::string const &TargetURI,
684 std::string const &Message, pkgAcquire::MethodConfig const *const Cnf);
685};
686 /*}}}*/
687struct APT_HIDDEN DiffInfo { /*{{{*/
689 std::string file;
690
692 HashStringList result_hashes;
693
695 HashStringList patch_hashes;
696
698 HashStringList download_hashes;
699};
700 /*}}}*/
710 class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqIndex
711{
712 void * const d;
713 std::vector<pkgAcqIndexMergeDiffs*> * diffs;
714 std::vector<DiffInfo> available_patches;
715 bool pdiff_merge;
716
717 protected:
719 bool Debug;
720
722 virtual std::string GetFinalFilename() const APT_OVERRIDE;
723
724 virtual bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE;
725
726 virtual bool TransactionState(TransactionStates const state) APT_OVERRIDE;
727 public:
728 // Specialized action members
729 virtual void Failed(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
730 virtual bool VerifyDone(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
731 virtual void Done(std::string const &Message, HashStringList const &Hashes,
732 pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
733 virtual std::string DescURI() const APT_OVERRIDE {return Target.URI + "Index";};
734 virtual std::string GetMetaKey() const APT_OVERRIDE;
735
746 bool ParseDiffIndex(std::string const &IndexDiffFile);
747
758 pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
759 IndexTarget const &Target) APT_NONNULL(2, 3);
760 virtual ~pkgAcqDiffIndex();
761 private:
762 APT_HIDDEN void QueueOnIMSHit() const;
763};
764 /*}}}*/
776class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex
777{
778 protected:
779
783 bool Debug;
784
786 struct DiffInfo const patch;
787
789 std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches;
790
792 enum DiffState
793 {
795 StateFetchDiff,
796
798 StateApplyDiff,
799
801 StateDoneDiff,
802
804 StateErrorDiff
805 } State;
806
807 public:
813 virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
814 virtual void Done(std::string const &Message, HashStringList const &Hashes,
815 pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
816 virtual std::string Custom600Headers() const APT_OVERRIDE;
817 virtual std::string DescURI() const APT_OVERRIDE {return Target.URI + "Index";};
818 virtual HashStringList GetExpectedHashes() const APT_OVERRIDE;
819 virtual bool HashesRequired() const APT_OVERRIDE;
820 virtual bool AcquireByHash() const APT_OVERRIDE;
821
834 pkgAcqIndexMergeDiffs(pkgAcquire *const Owner, pkgAcqMetaClearSig *const TransactionManager,
835 IndexTarget const &Target, DiffInfo const &patch,
836 std::vector<pkgAcqIndexMergeDiffs *> const *const allPatches) APT_NONNULL(2, 3, 6);
837 virtual ~pkgAcqIndexMergeDiffs();
838};
839 /*}}}*/
851class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex
852{
853 private:
854
864 APT_HIDDEN bool QueueNextDiff();
865
877 APT_HIDDEN void Finish(bool const allDone=false);
878
879 protected:
880
884 bool Debug;
885
894 std::vector<DiffInfo> available_patches;
895
897 enum DiffState
898 {
900 StateFetchDiff,
901
903 StateApplyDiff
904 } State;
905
906 public:
907
913 virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
914
915 virtual void Done(std::string const &Message, HashStringList const &Hashes,
916 pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
917 virtual std::string Custom600Headers() const APT_OVERRIDE;
918 virtual std::string DescURI() const APT_OVERRIDE {return Target.URI + "IndexDiffs";};
919 virtual HashStringList GetExpectedHashes() const APT_OVERRIDE;
920 virtual bool HashesRequired() const APT_OVERRIDE;
921 virtual bool AcquireByHash() const APT_OVERRIDE;
922
936 pkgAcqIndexDiffs(pkgAcquire *const Owner, pkgAcqMetaClearSig *const TransactionManager,
937 IndexTarget const &Target,
938 std::vector<DiffInfo> const &diffs = std::vector<DiffInfo>()) APT_NONNULL(2, 3);
939 virtual ~pkgAcqIndexDiffs();
940};
941 /*}}}*/
947class APT_PUBLIC pkgAcqArchive : public pkgAcquire::Item
948{
949 void * const d;
950
951 bool LocalSource;
952 HashStringList ExpectedHashes;
953
954 protected:
956 pkgCache::VerIterator Version;
957
961 pkgSourceList *Sources;
962
966 pkgRecords *Recs;
967
971 std::string &StoreFilename;
972
976 bool Trusted;
977
979 bool QueueNext();
980
982 virtual std::string GetFinalFilename() const APT_OVERRIDE;
983
984 public:
985
986 virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
987 virtual void Done(std::string const &Message, HashStringList const &Hashes,
988 pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
989 virtual std::string DescURI() const APT_OVERRIDE;
990 virtual std::string ShortDesc() const APT_OVERRIDE;
991 virtual void Finished() APT_OVERRIDE;
992 virtual bool IsTrusted() const APT_OVERRIDE;
993 virtual HashStringList GetExpectedHashes() const APT_OVERRIDE;
994 virtual bool HashesRequired() const APT_OVERRIDE;
995
1014 pkgAcqArchive(pkgAcquire * const Owner,pkgSourceList * const Sources,
1015 pkgRecords * const Recs,pkgCache::VerIterator const &Version,
1016 std::string &StoreFilename);
1017 virtual ~pkgAcqArchive();
1018};
1019 /*}}}*/
1025class APT_PUBLIC pkgAcqChangelog : public pkgAcquire::Item
1026{
1027 class Private;
1028 Private * const d;
1029 std::string TemporaryDirectory;
1030 std::string const SrcName;
1031 std::string const SrcVersion;
1032
1033 public:
1034 // we will never have hashes for changelogs.
1035 // If you need verified ones, download the deb and extract the changelog.
1036 virtual HashStringList GetExpectedHashes() const APT_OVERRIDE { return HashStringList(); }
1037 virtual bool HashesRequired() const APT_OVERRIDE { return false; }
1038
1039 // Specialized action members
1040 virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
1041 virtual void Done(std::string const &Message, HashStringList const &CalcHashes,
1042 pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
1043 virtual std::string DescURI() const APT_OVERRIDE {return Desc.URI;};
1044
1050 static std::string URI(pkgCache::VerIterator const &Ver);
1051
1060 static std::string URI(pkgCache::RlsFileIterator const &Rls,
1061 char const * const Component, char const * const SrcName,
1062 char const * const SrcVersion);
1063
1072 static std::string URI(std::string const &Template,
1073 char const * const Component, char const * const SrcName,
1074 char const * const SrcVersion);
1075
1081 static std::string URITemplate(pkgCache::RlsFileIterator const &Rls);
1082
1093 pkgAcqChangelog(pkgAcquire * const Owner, pkgCache::VerIterator const &Ver,
1094 std::string const &DestDir="", std::string const &DestFilename="");
1095
1109 pkgAcqChangelog(pkgAcquire * const Owner, pkgCache::RlsFileIterator const &Rls,
1110 char const * const Component, char const * const SrcName, char const * const SrcVersion,
1111 std::string const &DestDir="", std::string const &DestFilename="");
1112
1125 pkgAcqChangelog(pkgAcquire * const Owner, std::string const &URI,
1126 char const * const SrcName, char const * const SrcVersion,
1127 std::string const &DestDir="", std::string const &DestFilename="");
1128
1129 virtual ~pkgAcqChangelog();
1130
1131private:
1132 APT_HIDDEN void Init(std::string const &DestDir, std::string const &DestFilename);
1133};
1134 /*}}}*/
1141 class APT_PUBLIC pkgAcqFile : public pkgAcquire::Item
1142{
1143 void * const d;
1144
1146 bool IsIndexFile;
1147
1148 HashStringList const ExpectedHashes;
1149 public:
1150 virtual HashStringList GetExpectedHashes() const APT_OVERRIDE;
1151 virtual bool HashesRequired() const APT_OVERRIDE;
1152
1153 // Specialized action members
1154 virtual void Done(std::string const &Message, HashStringList const &CalcHashes,
1155 pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
1156 virtual std::string DescURI() const APT_OVERRIDE {return Desc.URI;};
1157 virtual std::string Custom600Headers() const APT_OVERRIDE;
1158
1190 pkgAcqFile(pkgAcquire * const Owner, std::string const &URI, HashStringList const &Hashes, unsigned long long const Size,
1191 std::string const &Desc, std::string const &ShortDesc,
1192 std::string const &DestDir="", std::string const &DestFilename="",
1193 bool const IsIndexFile=false);
1194 virtual ~pkgAcqFile();
1195};
1196 /*}}}*/
1197 class APT_HIDDEN pkgAcqAuxFile : public pkgAcqFile /*{{{*/
1198{
1199 pkgAcquire::Item *const Owner;
1200 pkgAcquire::Worker *const Worker;
1201 unsigned long long MaximumSize;
1202
1203 public:
1204 virtual void Failed(std::string const &Message, pkgAcquire::MethodConfig const *const Cnf) APT_OVERRIDE;
1205 virtual void Done(std::string const &Message, HashStringList const &CalcHashes,
1206 pkgAcquire::MethodConfig const *const Cnf) APT_OVERRIDE;
1207 virtual std::string Custom600Headers() const APT_OVERRIDE;
1208 virtual void Finished() APT_OVERRIDE;
1209
1210 pkgAcqAuxFile(pkgAcquire::Item *const Owner, pkgAcquire::Worker *const Worker,
1211 std::string const &ShortDesc, std::string const &Desc, std::string const &URI,
1212 HashStringList const &Hashes, unsigned long long const MaximumSize);
1213 virtual ~pkgAcqAuxFile();
1214};
1215 /*}}}*/
1218#endif
acquire.h
HashStringList
Definition hashes.h:79
Hashes
Definition hashes.h:184
IndexTarget
Information about an index file.
Definition indexfile.h:39
IndexTarget::URI
std::string URI
A URI from which the index file can be downloaded.
Definition indexfile.h:42
URI
Definition strutl.h:212
WeakPointable
Definition weakptr.h:34
metaIndex
Definition metaindex.h:21
pkgAcqArchive
An item that is responsible for fetching a package file. {{{.
Definition acquire-item.h:948
pkgAcqArchive::Recs
pkgRecords * Recs
A package records object, used to look up the file corresponding to each version of the package.
Definition acquire-item.h:966
pkgAcqArchive::Version
pkgCache::VerIterator Version
The package version being fetched.
Definition acquire-item.h:956
pkgAcqArchive::Trusted
bool Trusted
true if this version file is being downloaded from a trusted source.
Definition acquire-item.h:976
pkgAcqArchive::StoreFilename
std::string & StoreFilename
A location in which the actual filename of the package should be stored.
Definition acquire-item.h:971
pkgAcqArchive::Sources
pkgSourceList * Sources
The list of sources from which to pick archives to download this package from.
Definition acquire-item.h:961
pkgAcqAuxFile
Definition acquire-item.h:1198
pkgAcqBaseIndex
Common base class for all classes that deal with fetching indexes {{{.
Definition acquire-item.h:601
pkgAcqChangelog::Private
Definition acquire-item.cc:3604
pkgAcqChangelog
Retrieve the changelog for the given version {{{.
Definition acquire-item.h:1026
pkgAcqDiffIndex
An item that is responsible for fetching an index file of {{{ package list diffs and starting the pac...
Definition acquire-item.h:711
pkgAcqDiffIndex::Debug
bool Debug
If true, debugging information will be written to std::clog.
Definition acquire-item.h:719
pkgAcqFile
Retrieve an arbitrary file to the current directory. {{{.
Definition acquire-item.h:1142
pkgAcqIndexDiffs
An item that is responsible for fetching server-merge patches {{{ that need to be applied to a given ...
Definition acquire-item.h:852
pkgAcqIndexDiffs::available_patches
std::vector< DiffInfo > available_patches
Definition acquire-item.h:894
pkgAcqIndexDiffs::DiffState
DiffState
Definition acquire-item.h:898
pkgAcqIndexDiffs::StateFetchDiff
@ StateFetchDiff
The diff is currently being fetched.
Definition acquire-item.h:900
pkgAcqIndexDiffs::Debug
bool Debug
If true, debugging output will be written to std::clog.
Definition acquire-item.h:884
pkgAcqIndexMergeDiffs
An item that is responsible for fetching client-merge patches {{{ that need to be applied to a given ...
Definition acquire-item.h:777
pkgAcqIndexMergeDiffs::allPatches
std::vector< pkgAcqIndexMergeDiffs * > const *const allPatches
list of all download items for the patches
Definition acquire-item.h:789
pkgAcqIndexMergeDiffs::DiffState
DiffState
Definition acquire-item.h:793
pkgAcqIndexMergeDiffs::StateApplyDiff
@ StateApplyDiff
The diff is currently being applied.
Definition acquire-item.h:798
pkgAcqIndexMergeDiffs::StateFetchDiff
@ StateFetchDiff
The diff is currently being fetched.
Definition acquire-item.h:795
pkgAcqIndexMergeDiffs::StateDoneDiff
@ StateDoneDiff
the work with this diff is done
Definition acquire-item.h:801
pkgAcqIndexMergeDiffs::Debug
bool Debug
If true, debugging output will be written to std::clog.
Definition acquire-item.h:783
pkgAcqIndex
An acquire item that is responsible for fetching an index {{{ file (e.g., Packages or Sources).
Definition acquire-item.h:622
pkgAcqIndex::CompressionExtensions
std::string CompressionExtensions
The compression-related file extensions that are being added to the downloaded file one by one if fir...
Definition acquire-item.h:654
pkgAcqIndex::InitByHashIfNeeded
void InitByHashIfNeeded()
Do the changes needed to fetch via AptByHash (if needed)
pkgAcqIndex::CurrentCompressionExtension
std::string CurrentCompressionExtension
The actual compression extension currently used.
Definition acquire-item.h:657
pkgAcqIndex::AllStages
AllStages
The stages the method goes through.
Definition acquire-item.h:632
pkgAcqIndex::EraseFileName
std::string EraseFileName
If set, this partially downloaded file will be removed when the download completes.
Definition acquire-item.h:649
pkgAcqMetaBase
the manager of a transaction
Definition acquire-item.h:408
pkgAcqMetaBase::AuthPass
bool AuthPass
If true, the index's signature is currently being verified.
Definition acquire-item.h:415
pkgAcqMetaClearSig
An item responsible for downloading clearsigned metaindexes {{{.
Definition acquire-item.h:564
pkgAcqMetaClearSig::MetaIndexParser
metaIndex * MetaIndexParser
A package-system-specific parser for the meta-index file.
Definition acquire-item.h:570
pkgAcqMetaIndex
An item that is responsible for downloading the meta-index {{{ file (i.e., Release) itself and verify...
Definition acquire-item.h:501
pkgAcqMetaIndex::Init
void Init(std::string const &URIDesc, std::string const &ShortDesc)
delayed constructor
pkgAcqMetaSig
An acquire item that downloads the detached signature {{{ of a meta-index (Release) file,...
Definition acquire-item.h:534
pkgAcqTransactionItem
baseclass for the indexes files to manage them all together
Definition acquire-item.h:370
pkgAcqTransactionItem::TransactionManager
pkgAcqMetaClearSig *const TransactionManager
TransactionManager.
Definition acquire-item.h:384
pkgAcqTransactionItem::PartialFile
std::string PartialFile
storge name until a transaction is finished
Definition acquire-item.h:381
pkgAcquire
Represents the process by which a pkgAcquire object should retrieve a file or a collection of files.
Definition acquire-item.h:59
pkgAcquire::HashesRequired
virtual bool HashesRequired() const
Definition acquire-item.h:270
pkgAcquire::RenameOnError
bool RenameOnError(RenameOnErrorState const state)
Rename failed file and set error.
pkgAcquire::Priority
int APT_HIDDEN Priority()
The priority of the item, used for queuing.
pkgAcquire::VerifyDone
virtual bool VerifyDone(std::string const &Message, pkgAcquire::MethodConfig const *const Cnf)
Invoked by the acquire worker to check if the successfully fetched object is also the objected we wan...
pkgAcquire::Done
virtual void Done(std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const *const Cnf)
Invoked by the acquire worker when the object was fetched successfully.
pkgAcquire::QueueCounter
unsigned int QueueCounter
The number of fetch queues into which this item has been inserted.
Definition acquire-item.h:138
pkgAcquire::HashSum
std::string HashSum() const
pkgAcquire::Finished
virtual void Finished()
Invoked by the worker when the download is completely done.
pkgAcquire::PartialSize
unsigned long long PartialSize
How much of the object was already fetched.
Definition acquire-item.h:99
pkgAcquire::Retries
unsigned int Retries
Number of retries.
Definition acquire-item.h:156
pkgAcquire::QueueURI
virtual bool QueueURI(ItemDesc &Item)
Insert this item into its owner's queue.
pkgAcquire::Start
virtual void Start(std::string const &Message, unsigned long long const Size)
Invoked when the worker starts to fetch this object.
pkgAcquire::ExpectedAdditionalItems
unsigned int ExpectedAdditionalItems
The number of additional fetch items that are expected once this item is done.
Definition acquire-item.h:148
pkgAcquire::ActiveSubprocess
std::string ActiveSubprocess
contains the name of the subprocess that is operating on this object (for instance,...
Definition acquire-item.h:104
pkgAcquire::Desc
pkgAcquire::ItemDesc Desc
The item that is currently being downloaded.
Definition acquire-item.h:313
pkgAcquire::Custom600Headers
virtual std::string Custom600Headers() const
Custom headers to be sent to the fetch process.
pkgAcquire::Dequeue
void Dequeue()
Remove this item from its owner's queue.
pkgAcquire::~Item
virtual ~Item()
Remove this item from its owner's queue by invoking pkgAcquire::Remove.
pkgAcquire::Rename
bool Rename(std::string const &From, std::string const &To)
Rename a file without modifying its timestamp.
pkgAcquire::ID
unsigned long ID
A client-supplied unique identifier.
Definition acquire-item.h:113
pkgAcquire::FetchAfter
void APT_HIDDEN FetchAfter(time_point FetchAfter)
internal clock definitions to avoid typing all that all over the place
pkgAcquire::Failed
virtual void Failed(std::string const &Message, pkgAcquire::MethodConfig const *const Cnf)
Invoked by the acquire worker when the object couldn't be fetched.
pkgAcquire::FileSize
unsigned long long FileSize
The size of the object to fetch.
Definition acquire-item.h:96
pkgAcquire::Complete
bool Complete
If true, the entire object has been successfully fetched.
Definition acquire-item.h:119
pkgAcquire::ShortDesc
virtual std::string ShortDesc() const
Short item description.
pkgAcquire::GetExpectedHashes
virtual HashStringList GetExpectedHashes() const =0
pkgAcquire::Local
bool Local
If true, the URI of this object is "local".
Definition acquire-item.h:126
pkgAcquire::GetFinalFilename
virtual std::string GetFinalFilename() const
Get the full pathname of the final file for the current URI.
pkgAcquire::Item
Item(pkgAcquire *const Owner)
Initialize an item.
pkgAcquire::ErrorText
std::string ErrorText
Contains a textual description of the error encountered if ItemState is StatError or StatAuthError.
Definition acquire-item.h:93
pkgAcquire::DestFile
std::string DestFile
The name of the file into which the retrieved object will be written.
Definition acquire-item.h:153
pkgAcquire::IsTrusted
virtual bool IsTrusted() const
pkgAcquire::ItemState
ItemState
The current status of this item.
Definition acquire-item.h:64
pkgAcquire::StatAuthError
@ StatAuthError
The item was downloaded but its authenticity could not be verified.
Definition acquire-item.h:82
pkgAcquire::StatFetching
@ StatFetching
The item is currently being downloaded.
Definition acquire-item.h:69
pkgAcquire::StatTransientNetworkError
@ StatTransientNetworkError
The item was could not be downloaded because of a transient network error (e.g. network down)
Definition acquire-item.h:87
pkgAcquire::StatError
@ StatError
An error was encountered while downloading this item.
Definition acquire-item.h:77
pkgAcquire::StatDone
@ StatDone
The item has been successfully downloaded.
Definition acquire-item.h:72
pkgAcquire::StatIdle
@ StatIdle
The item is waiting to be downloaded.
Definition acquire-item.h:66
pkgAcquire::Owner
pkgAcquire *const Owner
The acquire object with which this item is associated.
Definition acquire-item.h:310
pkgAcquire::DescURI
virtual std::string DescURI() const =0
A "descriptive" URI-like string.
pkgAcquire::SetActiveSubprocess
void SetActiveSubprocess(std::string const &subprocess)
Set the name of the current active subprocess.
pkgAcquire::GetOwner
pkgAcquire * GetOwner() const
pkgCache
Definition cacheiterators.h:47
pkgRecords
Definition pkgrecords.h:27
pkgSourceList
Definition sourcelist.h:43
pkgcache.h
pkgCache - Structure definitions for the cache file
DiffInfo
Definition acquire-item.h:687
DiffInfo::patch_hashes
HashStringList patch_hashes
Definition acquire-item.h:695
DiffInfo::result_hashes
HashStringList result_hashes
Definition acquire-item.h:692
DiffInfo::download_hashes
HashStringList download_hashes
Definition acquire-item.h:698
DiffInfo::file
std::string file
Definition acquire-item.h:689