apt: pkgAcqDiffIndex Class Reference

apt 2.3.15 commandline package manager

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

An item that is responsible for fetching an index file of {{{ package list diffs and starting the package list's download. More...

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

Inheritance diagram for pkgAcqDiffIndex:

## Public Member Functions
virtual void | Failed (std::string const &Message, pkgAcquire::MethodConfig const *const Cnf) APT_OVERRIDE
virtual bool | VerifyDone (std::string const &Message, pkgAcquire::MethodConfig const *const Cnf) APT_OVERRIDE
virtual void | Done (std::string const &Message, HashStringList const &Hashes, pkgAcquire::MethodConfig const *const Cnf) APT_OVERRIDE
virtual std::string | DescURI () const APT_OVERRIDE
virtual std::string | GetMetaKey () const APT_OVERRIDE
bool | ParseDiffIndex (std::string const &IndexDiffFile)
| Parse the Index file for a set of Packages diffs. More...
| pkgAcqDiffIndex (pkgAcquire *const Owner, pkgAcqMetaClearSig *const TransactionManager, IndexTarget const &Target) APT_NONNULL(2
| Create a new pkgAcqDiffIndex. More...
Public Member Functions inherited from pkgAcqIndex
virtual void | Failed (std::string const &Message, pkgAcquire::MethodConfig const *const Cnf) APT_OVERRIDE
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 std::string | GetMetaKey () const APT_OVERRIDE
| pkgAcqIndex (pkgAcquire *const Owner, pkgAcqMetaClearSig *const TransactionManager, IndexTarget const &Target, bool const Derived=false) APT_NONNULL(2
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. More...
virtual void | Failed (std::string const &Message, pkgAcquire::MethodConfig const *const Cnf) APT_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)
virtual std::string | DescURI () const APT_OVERRIDE
virtual HashStringList | GetExpectedHashes () const APT_OVERRIDE
virtual std::string | GetMetaKey () const
virtual bool | HashesRequired () const APT_OVERRIDE
virtual bool | AcquireByHash () const
| pkgAcqTransactionItem (pkgAcquire *const Owner, pkgAcqMetaClearSig *const TransactionManager, IndexTarget const &Target) APT_NONNULL(2

## Protected Member Functions
virtual std::string | GetFinalFilename () const APT_OVERRIDE
| Get the full pathname of the final file for the current URI. More...
virtual bool | QueueURI (pkgAcquire::ItemDesc &Item) APT_OVERRIDE
virtual bool | TransactionState (TransactionStates const state) APT_OVERRIDE
Protected Member Functions inherited from pkgAcqIndex
void | StageDownloadDone (std::string const &Message)
| Handle what needs to be done when the download is done.
void | StageDecompressDone ()
| Handle what needs to be done when the decompression/copy is done.
void | InitByHashIfNeeded ()
| Do the changes needed to fetch via AptByHash (if needed)
virtual std::string | GetFinalFilename () const APT_OVERRIDE
| Get the full pathname of the final file for the current URI. More...
virtual bool | TransactionState (TransactionStates const state) APT_OVERRIDE
APT_HIDDEN void | Init (std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc)
APT_HIDDEN bool | CommonFailed (std::string const &TargetURI, std::string const &Message, pkgAcquire::MethodConfig const *const Cnf)
Protected Member Functions inherited from pkgAcqTransactionItem
HashStringList | GetExpectedHashesFor (std::string const &MetaKey) const
bool | QueueURI (pkgAcquire::ItemDesc &Item) APT_OVERRIDE

## Protected Attributes
bool | Debug
| If true, debugging information will be written to std::clog.
Protected Attributes inherited from pkgAcqIndex
AllStages | Stage
std::string | EraseFileName
| If set, this partially downloaded file will be removed when the download completes.
std::string | CompressionExtensions
| The compression-related file extensions that are being added to the downloaded file one by one if first fails (e.g., "gz bz2").
std::string | CurrentCompressionExtension
| The actual compression extension currently used.

## 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 Types inherited from pkgAcqIndex
enum | AllStages { STAGE_DOWNLOAD , STAGE_DECOMPRESS_AND_VERIFY }
| The stages the method goes through. More...

## Detailed Description

An item that is responsible for fetching an index file of {{{ package list diffs and starting the package list's download.

This item downloads the Index file and parses it, then enqueues additional downloads of either the individual patches (using pkgAcqIndexDiffs) or the entire Packages file (using pkgAcqIndex).

See also
  pkgAcqIndexDiffs, pkgAcqIndex

## Constructor & Destructor Documentation

## ◆ pkgAcqDiffIndex()

pkgAcqDiffIndex | ( | pkgAcquire *const | Owner,
|  | pkgAcqMetaClearSig *const | TransactionManager,
|  | IndexTarget const & | Target
| ) |  |

Create a new pkgAcqDiffIndex.

Parameters

  Owner | The Acquire object that owns this item.
  URI | The URI of the list file to download.
  URIDesc | A long description of the list file to download.
  ShortDesc | A short description of the list file to download.

Todo:
  Magic number as an upper bound on pdiffs we will reasonably acquire

References pkgAcqIndex::CompressionExtensions, Debug, IndexTarget::Description, and IndexTarget::ShortDesc.

## Member Function Documentation

## ◆ DescURI()

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

Reimplemented from pkgAcqIndex.

## ◆ Done()

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

Reimplemented from pkgAcqIndex.

## ◆ Failed()

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

Reimplemented from pkgAcqIndex.

## ◆ GetFinalFilename()

std::string GetFinalFilename | ( |  | ) | const
| protectedvirtual

Get the full pathname of the final file for the current URI.

Reimplemented from pkgAcqIndex.

References pkgAcqIndex::CurrentCompressionExtension.

## ◆ GetMetaKey()

std::string GetMetaKey | ( |  | ) | const
| virtual

Reimplemented from pkgAcqIndex.

## ◆ ParseDiffIndex()

bool ParseDiffIndex | ( | std::string const & | IndexDiffFile | ) |

Parse the Index file for a set of Packages diffs.

Parses the Index file and creates additional download items as necessary.

Parameters

  IndexDiffFile | The name of the Index file.

Returns
  true if the Index file was successfully parsed, false otherwise.

Todo:
  all of pdiff supports only .gz compressed patches

References Debug, DiffInfo::file, HashStringList::FileSize(), HashStringList::find(), IndexTarget::MetaKey, pkgAcqTransactionItem::PartialFile, HashStringList::push_back(), DiffInfo::result_hashes, pkgAcqTransactionItem::TransactionManager, IndexTarget::URI, and HashStringList::usable().

## ◆ TransactionState()

bool TransactionState | ( | TransactionStates const | state | ) |
| protectedvirtual

Reimplemented from pkgAcqIndex.

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

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