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

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

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

Inheritance diagram for pkgAcqIndexDiffs:
[legend]
Collaboration diagram for pkgAcqIndexDiffs:
[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
 
 pkgAcqIndexDiffs (pkgAcquire *const Owner, pkgAcqMetaClearSig *const TransactionManager, IndexTarget const &Target, std::vector< DiffInfo > const &diffs=std::vector< DiffInfo >()) APT_NONNULL(2
 Create an index 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 }
 

Protected Attributes

bool Debug
 If true, debugging output will be written to std::clog.
 
std::vector< DiffInfoavailable_patches
 
enum pkgAcqIndexDiffs::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 server-merge patches {{{ that need to be applied to a given package index file.

After downloading and applying a single patch, this item will enqueue a new pkgAcqIndexDiffs to download and apply the remaining patches. If no patch can be found that applies to an intermediate file or if one of the patches cannot be downloaded, falls back to downloading the entire package index file using pkgAcqIndex.

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.

Constructor & Destructor Documentation

◆ pkgAcqIndexDiffs()

pkgAcqIndexDiffs ( pkgAcquire *const  Owner,
pkgAcqMetaClearSig *const  TransactionManager,
IndexTarget const &  Target,
std::vector< DiffInfo > const &  diffs = std::vector<DiffInfo>() 
)

Create an index diff item.

After filling in its basic fields, this invokes Finish(true) if diffs is empty, or QueueNextDiff() otherwise.

Parameters
OwnerThe pkgAcquire object that owns this item.
TransactionManagerresponsible for this item
Targetwe want to built via pdiff patching
baseURIis the URI used for the Index, but stripped down to Target
diffsThe remaining diffs from the index of diffs. They should be ordered so that each diff appears before any diff that depends on it.

References available_patches, Debug, IndexTarget::ShortDesc, StateFetchDiff, 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 Debug, pkgAcqTransactionItem::TransactionManager, and IndexTarget::URI.

Member Data Documentation

◆ available_patches

std::vector<DiffInfo> available_patches
protected

The patches that remain to be downloaded, including the patch being downloaded right now. This list should be ordered so that each diff appears before any diff that depends on it.

Todo:
These are indexed by sha1sum; why not use some sort of dictionary instead of relying on ordering and stripping them off the front?

Referenced by pkgAcqIndexDiffs().


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