apt: pkgAcqIndexDiffs Class Reference

apt 2.7.5 commandline package manager

Public Member Functions | Protected Types | Protected Attributes | List of all members
pkgAcqIndexDiffs Class Reference
Acquire system {{{

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:

## Public Member Functions
virtual void | Failed (std::string const &Message, pkgAcquire::MethodConfig const *const Cnf) APT_OVERRIDE
| Called when the patch file failed to be downloaded.
virtual void | Done (std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const *const Cnf) APT_OVERRIDE
virtual std::string | Custom600Headers () const APT_OVERRIDE
virtual std::string | DescURI () const APT_OVERRIDE
virtual HashStringList | GetExpectedHashes () const APT_OVERRIDE
virtual bool | HashesRequired () const APT_OVERRIDE
virtual bool | AcquireByHash () const APT_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
virtual std::string | GetFinalFilename () const APT_OVERRIDE
| Get the full pathname of the final file for the current URI.
| 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)
virtual std::string | GetMetaKey () const
| 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< DiffInfo > | available_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) APT_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

  Owner | The pkgAcquire object that owns this item.
  TransactionManager | responsible for this item
  Target | we want to built via pdiff patching
  baseURI | is the URI used for the Index, but stripped down to Target
  diffs | The 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
| virtual

Reimplemented from pkgAcqTransactionItem.

## ◆ DescURI()

virtual std::string DescURI | ( |  | ) | const
| inlinevirtual

Reimplemented from pkgAcqTransactionItem.

## ◆ Failed()

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

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.

Reimplemented from pkgAcqBaseIndex.

References Debug, pkgAcqTransactionItem::TransactionManager, and IndexTarget::URI.

## ◆ GetExpectedHashes()

HashStringList GetExpectedHashes | ( |  | ) | const
| virtual

Reimplemented from pkgAcqTransactionItem.

## ◆ HashesRequired()

APT_PURE bool HashesRequired | ( |  | ) | const
| virtual

Reimplemented from pkgAcqTransactionItem.

## 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:

- apt-pkg/acquire-item.h
- apt-pkg/acquire-item.cc