libzypp: zyppng::sat::Repository Class Reference

libzypp 17.38.13

zyppng::sat::Repository Class Reference

`#include <zypp/ng/sat/repository.h>`

Inheritance diagram for zyppng::sat::Repository:

## Classes
struct | EraseFromPool
| Query class for Repository related products. More...

## Public Types
using | SolvableIterator = zyppng::FilterIterator<detail::ByRepository, sat::detail::SolvableIterator>
using | SolvableIterable = zypp::Iterable<SolvableIterator>
using | size_type = unsigned int
using | IdType = detail::RepoIdType
using | ContentRevision = std::string
using | ContentIdentifier = std::string

## Public Member Functions
| Repository ()
| Default ctor creates noRepository.
| Repository (const Repository &)=default
| Repository (Repository &&) noexcept=default
Repository & | operator= (const Repository &)=default
Repository & | operator= (Repository &&) noexcept=default
| Repository (IdType id_r)
| Pool ctor.
| operator bool () const
| Evaluate Repository in a boolean context (`!=` `noRepository`).
bool | isSystemRepo () const
| Return whether this is the system repository.
std::string | alias () const
| Short unique string to identify a repo.
ContentRevision | contentRevision () const
| Label to display for this repo.
ContentIdentifier | contentIdentifier () const
| Unique string identifying a repositories content.
bool | hasContentIdentifier (const ContentIdentifier &id_r) const
| Whether id_r matches this repos content identifier.
zypp::Date | generatedTimestamp () const
| Timestamp when this repository was generated.
zypp::Date | suggestedExpirationTimestamp () const
| Suggested expiration timestamp.
bool | maybeOutdated () const
| repository keywords (tags)
bool | solvablesEmpty () const
| Hint whether the Repo may provide updates for a product.
size_type | solvablesSize () const
| Number of solvables in Repository.
SolvableIterable | solvables () const
| Iterate the repositories Solvables.
void | eraseFromPool ()
| Query class for Repository related products.
Repository | nextInPool () const
| Return next Repository in Pool (or noRepository).
Public Member Functions inherited from zyppng::sat::PoolMember< Repository >
Pool & | pool ()

## Static Public Member Functions
static const std::string & | systemRepoAlias ()
| Reserved system repository alias `@System` .

## Static Public Attributes
static const Repository | noRepository
| Represents no Repository.

## Repository content manipulating methods.
Todo maybe a separate Repository/Solvable content manip interface provided by the pool.
IdType | _id
void | addSolv (const zypp::Pathname &file_r)
| Load Solvables from a solv-file.
void | addHelix (const zypp::Pathname &file_r)
| Load Solvables from a helix-file.
void | addTesttags (const zypp::Pathname &file_r)
| Load Solvables from a libsolv testtags-file.
sat::Solvable::IdType | addSolvables (unsigned count_r)
| Add `count_r` new empty Solvable to this Repository.
sat::Solvable::IdType | addSolvable ()
detail::CRepo * | get () const
| Expert backdoor.
IdType | id () const
| Expert backdoor.
int | satInternalPriority () const
| libsolv internal priorities.
int | satInternalSubPriority () const
SolvableIterator | solvablesBegin () const
| Iterator to the first Solvable.
SolvableIterator | solvablesEnd () const
| Iterator behind the last Solvable.

## Detailed Description

Definition at line 50 of file repository.h.

## Member Typedef Documentation

## ◆ SolvableIterator

using zyppng::sat::Repository::SolvableIterator = zyppng::FilterIterator<detail::ByRepository, sat::detail::SolvableIterator>

Definition at line 53 of file repository.h.

## ◆ SolvableIterable

using zyppng::sat::Repository::SolvableIterable = zypp::Iterable<SolvableIterator>

Definition at line 54 of file repository.h.

## ◆ size_type

using zyppng::sat::Repository::size_type = unsigned int

Definition at line 55 of file repository.h.

## ◆ IdType

using zyppng::sat::Repository::IdType = detail::RepoIdType

Definition at line 56 of file repository.h.

## ◆ ContentRevision

using zyppng::sat::Repository::ContentRevision = std::string

Definition at line 60 of file repository.h.

## ◆ ContentIdentifier

using zyppng::sat::Repository::ContentIdentifier = std::string

Definition at line 61 of file repository.h.

## Constructor & Destructor Documentation

## ◆ Repository() [1/4]

zyppng::sat::Repository::Repository | ( |  | ) |
| inline

Default ctor creates noRepository.

Definition at line 65 of file repository.h.

## ◆ Repository() [2/4]

zyppng::sat::Repository::Repository | ( | const Repository & |  | ) |
| default

## ◆ Repository() [3/4]

zyppng::sat::Repository::Repository | ( | Repository && |  | ) |
| defaultnoexcept

## ◆ Repository() [4/4]

zyppng::sat::Repository::Repository | ( | IdType | id_r | ) |
| inlineexplicit

Pool ctor.

Definition at line 74 of file repository.h.

## Member Function Documentation

## ◆ operator=() [1/2]

Repository & zyppng::sat::Repository::operator= | ( | const Repository & |  | ) |
| default

## ◆ operator=() [2/2]

Repository & zyppng::sat::Repository::operator= | ( | Repository && |  | ) |
| defaultnoexcept

## ◆ operator bool()

zyppng::sat::Repository::operator bool | ( |  | ) | const
| inlineexplicit

Evaluate Repository in a boolean context (`!=` `noRepository`).

Definition at line 82 of file repository.h.

## ◆ systemRepoAlias()

const std::string & zyppng::sat::Repository::systemRepoAlias | ( |  | ) |
| static

Reserved system repository alias `@System` .

Definition at line 53 of file repository.cc.

## ◆ isSystemRepo()

bool zyppng::sat::Repository::isSystemRepo | ( |  | ) | const

Return whether this is the system repository.

Definition at line 69 of file repository.cc.

## ◆ alias()

std::string zyppng::sat::Repository::alias | ( |  | ) | const

Short unique string to identify a repo.

ie: openSUSE-10.3

If you are looking for a label to display see name(). ie: "openSUSE 10.3 Main repository"

Definition at line 75 of file repository.cc.

## ◆ contentRevision()

Repository::ContentRevision zyppng::sat::Repository::contentRevision | ( |  | ) | const

Label to display for this repo.

Alias or name, according to ZConfig::repoLabelIsAlias User string: label (alias or name) Timestamp or arbitrary user supplied string. `/repomd/revision/text`() in `repomd.xml`.

Definition at line 95 of file repository.cc.

## ◆ contentIdentifier()

Repository::ContentIdentifier zyppng::sat::Repository::contentIdentifier | ( |  | ) | const

Unique string identifying a repositories content.

`/repomd/tags/repo/text`() in `repomd.xml`.

<repomd ....>
<tags>
<repo>obsrepository://build.suse.de/SUSE:Factory:Head:Internal/standard</repo>
zyppng::repo
Definition downloader.cc:22

Semantically the value is just a plain string, even if OBS often uses the location of the project as unique identifier.

Definition at line 102 of file repository.cc.

## ◆ hasContentIdentifier()

bool zyppng::sat::Repository::hasContentIdentifier | ( | const ContentIdentifier & | id_r | ) | const

Whether id_r matches this repos content identifier.

Definition at line 109 of file repository.cc.

## ◆ generatedTimestamp()

zypp::Date zyppng::sat::Repository::generatedTimestamp | ( |  | ) | const

Timestamp when this repository was generated.

Usually this value is calculated as the newer timestamp from the timestamp of all the resources that conform the repository's metadata.

For example in a rpm-md repository, it would be the resource specified in the xml file whith the newest timestamp attribute (which is the timestamp of the file in the server ).

The timestamp is 0 if the repository does not specify when it was generated.

Definition at line 119 of file repository.cc.

## ◆ suggestedExpirationTimestamp()

zypp::Date zyppng::sat::Repository::suggestedExpirationTimestamp | ( |  | ) | const

Suggested expiration timestamp.

Repositories can define an amount of time they expire, with the generated timestamp as the base point of time.

Note that is the responsability of the repository to freshen the generated timestamp to tell the client that the repo is alive and updating the metadata.

The timestamp is 0 if the repository does not specify an expiration date.

Definition at line 127 of file repository.cc.

## ◆ maybeOutdated()

bool zyppng::sat::Repository::maybeOutdated | ( |  | ) | const

repository keywords (tags)

Whether val_r is present in keywords. The suggested expiration date of this repository already passed

rpm-md repositories can provide this tag using the expire extension tag:

See also
  http://en.opensuse.org/Standards/Rpm_Metadata#SUSE_repository_info_.28suseinfo.xml.29.2C_extensions_to_repomd.xml

Definition at line 142 of file repository.cc.

## ◆ solvablesEmpty()

bool zyppng::sat::Repository::solvablesEmpty | ( |  | ) | const

Hint whether the Repo may provide updates for a product.

Either the repository claims to update a product via a repository updates tag in its metadata or a known product lists the repositories ContentIdentifier as a required update repo. Hint whether the Repo may provide updates for a product identified by its CpeId

Either the repository claims to update a product via a repository updates tag in its metadata or a known product lists the repositories ContentIdentifier as required update repo. Whether Repository contains solvables.

Definition at line 158 of file repository.cc.

## ◆ solvablesSize()

Repository::size_type zyppng::sat::Repository::solvablesSize | ( |  | ) | const

Number of solvables in Repository.

Definition at line 164 of file repository.cc.

## ◆ solvables()

zypp::Iterable< Repository::SolvableIterator > zyppng::sat::Repository::solvables | ( |  | ) | const
| inline

Iterate the repositories Solvables.

Definition at line 540 of file repository.h.

## ◆ eraseFromPool()

void zyppng::sat::Repository::eraseFromPool | ( |  | ) |

Query class for Repository related products.

Get an iterator to the beginning of the repository compatible distros.

Note
  This is only a hint. There is no guarantee that the repository is built for that product.

See also
  Repository::ProductInfoIterator Get an iterator to the end of the repository compatible distros.
  Repository::ProductInfoIterator Iterate the repository compatible distros. Get an iterator to the beginning of distos the repository provides upadates for.

Note
  This is only a hint within the repositories metadata. The same realation might be expressed by a product listing this repositories ContentIdentifier as required update repo.

See also
  Repository::ProductInfoIterator Get an iterator to the end of distos the repository provides upadates for.
  Repository::ProductInfoIterator Iterate distos the repository provides upadates for. Return any associated RepoInfo. Set RepoInfo for this repository.

Exceptions

  Exception | if this is noRepository
  Exception | if the RepoInfo::alias does not match the Repository::name. Remove any RepoInfo set for this repository. Remove this Repository from its Pool.

Definition at line 190 of file repository.cc.

## ◆ nextInPool()

Repository zyppng::sat::Repository::nextInPool | ( |  | ) | const

Return next Repository in Pool (or noRepository).

Definition at line 198 of file repository.cc.

## ◆ addSolv()

void zyppng::sat::Repository::addSolv | ( | const zypp::Pathname & | file_r | ) |

Load Solvables from a solv-file.

In case of an exception the repository remains in the Pool.

Exceptions

  Exception | if this is noRepository
  Exception | if loading the solv-file fails.

See also
  Pool::addRepoSolv and Repository::EraseFromPool

Definition at line 214 of file repository.cc.

## ◆ addHelix()

void zyppng::sat::Repository::addHelix | ( | const zypp::Pathname & | file_r | ) |

Load Solvables from a helix-file.

Supports loading of gzip compressed files (.gz). In case of an exception the repository remains in the Pool.

Exceptions

  Exception | if this is noRepository
  Exception | if loading the helix-file fails.

See also
  Pool::addRepoHelix and Repository::EraseFromPool

Definition at line 233 of file repository.cc.

## ◆ addTesttags()

void zyppng::sat::Repository::addTesttags | ( | const zypp::Pathname & | file_r | ) |

Load Solvables from a libsolv testtags-file.

Supports loading of gzip compressed files (.gz). In case of an exception the repository remains in the Pool.

Exceptions

  Exception | if this is noRepository
  Exception | if loading the helix-file fails.

See also
  Pool::addRepoTesttags and Repository::EraseFromPool

Definition at line 257 of file repository.cc.

## ◆ addSolvables()

sat::Solvable::IdType zyppng::sat::Repository::addSolvables | ( | unsigned | count_r | ) |

Add `count_r` new empty Solvable to this Repository.

Definition at line 281 of file repository.cc.

## ◆ addSolvable()

sat::Solvable::IdType zyppng::sat::Repository::addSolvable | ( |  | ) |
| inline

Definition at line 319 of file repository.h.

## ◆ get()

detail::CRepo * zyppng::sat::Repository::get | ( |  | ) | const

Expert backdoor.

Definition at line 58 of file repository.cc.

## ◆ id()

IdType zyppng::sat::Repository::id | ( |  | ) | const
| inline

Expert backdoor.

Definition at line 327 of file repository.h.

## ◆ satInternalPriority()

int zyppng::sat::Repository::satInternalPriority | ( |  | ) | const

libsolv internal priorities.

Unlike the RepoInfo priority which tries to be YUM conform (H[1-99]L), this one is the solver's internal priority representation. It is type `int` and, as one might expect, the higher the value, the higher the priority. Subpriority is currently used to express media preferences (

See also
  MediaPriority).

Definition at line 83 of file repository.cc.

## ◆ satInternalSubPriority()

int zyppng::sat::Repository::satInternalSubPriority | ( |  | ) | const

Definition at line 89 of file repository.cc.

## ◆ solvablesBegin()

Repository::SolvableIterator zyppng::sat::Repository::solvablesBegin | ( |  | ) | const
| private

Iterator to the first Solvable.

Definition at line 170 of file repository.cc.

## ◆ solvablesEnd()

Repository::SolvableIterator zyppng::sat::Repository::solvablesEnd | ( |  | ) | const
| private

Iterator behind the last Solvable.

Definition at line 180 of file repository.cc.

## Member Data Documentation

## ◆ noRepository

const Repository zyppng::sat::Repository::noRepository
| static

Represents no Repository.

Definition at line 79 of file repository.h.

## ◆ _id

IdType zyppng::sat::Repository::_id
| private

Definition at line 348 of file repository.h.

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

- zypp/ng/sat/repository.h
- zypp/ng/sat/repository.cc