apt 3.0.3
commandline package manager
Public Member Functions | Protected Types | Protected Attributes | List of all members
pkgAcqIndexMergeDiffs Class Referencefinal

An item that is responsible for fetching client-merge patches {{{ that need to be applied to a given package index file. More...

#include <apt-pkg/acquire-item.h>

Inheritance diagram for pkgAcqIndexMergeDiffs:
[legend]
Collaboration diagram for pkgAcqIndexMergeDiffs:
[legend]

Public Member Functions

void Failed (std::string const &Message, pkgAcquire::MethodConfig const *Cnf) override
 Called when the patch file failed to be downloaded.
 
void Done (std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const *Cnf) override
 
std::string Custom600Headers () const override
 
std::string DescURI () const override
 
HashStringList GetExpectedHashes () const override
 
bool HashesRequired () const override
 
bool AcquireByHash () const override
 
 pkgAcqIndexMergeDiffs (pkgAcquire *const Owner, pkgAcqMetaClearSig *const TransactionManager, IndexTarget const &Target, DiffInfo const &patch, std::vector< pkgAcqIndexMergeDiffs * > const *const allPatches) APT_NONNULL(2
 Create an index merge-diff item.
 
- Public Member Functions inherited from pkgAcqBaseIndex
std::string GetFinalFilename () const override
 Get the full pathname of the final file for the current URI.
 
void Failed (std::string const &Message, pkgAcquire::MethodConfig const *Cnf) override
 
 pkgAcqBaseIndex (pkgAcquire *const Owner, pkgAcqMetaClearSig *const TransactionManager, IndexTarget const &Target) APT_NONNULL(2
 
- Public Member Functions inherited from pkgAcqTransactionItem
virtual bool TransactionState (TransactionStates const state)
 
std::string DescURI () const override
 
HashStringList GetExpectedHashes () const override
 
virtual std::string GetMetaKey () const
 
bool HashesRequired () const override
 
 pkgAcqTransactionItem (pkgAcquire *const Owner, pkgAcqMetaClearSig *const TransactionManager, IndexTarget const &Target) APT_NONNULL(2
 

Protected Types

enum  DiffState { StateFetchDiff , StateApplyDiff , StateDoneDiff , StateErrorDiff }
 

Protected Attributes

bool Debug
 If true, debugging output will be written to std::clog.
 
struct DiffInfo const patch
 information about the current patch
 
std::vector< pkgAcqIndexMergeDiffs * > const *const allPatches
 list of all download items for the patches
 
enum pkgAcqIndexMergeDiffs::DiffState State
 

Additional Inherited Members

- Public Types inherited from pkgAcqTransactionItem
enum  TransactionStates { TransactionStarted , TransactionCommit , TransactionAbort }
 
- Public Attributes inherited from pkgAcqTransactionItem
IndexTarget const Target
 
std::string PartialFile
 storge name until a transaction is finished
 
pkgAcqMetaClearSig *const TransactionManager
 TransactionManager.
 
- Protected Member Functions inherited from pkgAcqTransactionItem
HashStringList GetExpectedHashesFor (std::string const &MetaKey) const
 
bool QueueURI (pkgAcquire::ItemDesc &Item) override
 

Detailed Description

An item that is responsible for fetching client-merge patches {{{ that need to be applied to a given package index file.

Instead of downloading and applying each patch one by one like its sister pkgAcqIndexDiffs this class will download all patches at once and call rred with all the patches downloaded once. Rred will then merge and apply them in one go, which should be a lot faster – but is incompatible with server-based merges of patches like reprepro can do.

See also
pkgAcqDiffIndex, pkgAcqIndex

Member Enumeration Documentation

◆ DiffState

enum DiffState
protected

The current status of this patch.

Enumerator
StateFetchDiff 

The diff is currently being fetched.

StateApplyDiff 

The diff is currently being applied.

StateDoneDiff 

the work with this diff is done

StateErrorDiff 

something bad happened and fallback was triggered

Constructor & Destructor Documentation

◆ pkgAcqIndexMergeDiffs()

pkgAcqIndexMergeDiffs ( pkgAcquire *const  Owner,
pkgAcqMetaClearSig *const  TransactionManager,
IndexTarget const &  Target,
DiffInfo const &  patch,
std::vector< pkgAcqIndexMergeDiffs * > const *const  allPatches 
)

Create an index merge-diff item.

Parameters
OwnerThe pkgAcquire object that owns this item.
TransactionManagerresponsible for this item
Targetwe intend to built via pdiff patching
baseURIis the URI used for the Index, but stripped down to Target
DiffInfoof the patch in question
patchcontains infos about the patch this item is supposed to download which were read from the index
allPatchescontains all related items so that each item can check if it was the last one to complete the download step

References Debug, IndexTarget::Description, DiffInfo::file, patch, IndexTarget::ShortDesc, and IndexTarget::URI.

Member Function Documentation

◆ AcquireByHash()

bool AcquireByHash ( ) const
overridevirtual

Reimplemented from pkgAcqTransactionItem.

◆ Failed()

void Failed ( std::string const &  Message,
pkgAcquire::MethodConfig const *  Cnf 
)
override

Called when the patch file failed to be downloaded.

This method will fall back to downloading the whole index file outright; its arguments are ignored.

References allPatches, Debug, StateDoneDiff, StateErrorDiff, pkgAcqTransactionItem::TransactionManager, and IndexTarget::URI.


The documentation for this class was generated from the following files: