libzypp 17.37.10

zypp::Repository Class Reference

`#include <zypp/Repository.h>`

Inheritance diagram for zypp::Repository:

## Classes
struct | EraseFromPool
| Functor removing Repository from its Pool. More...
class | ProductInfoIterator
| Query class for Repository related products. More...

## Public Types
using | SolvableIterator = filter_iterator<detail::ByRepository, sat::detail::SolvableIterator>
using | size_type = sat::detail::size_type
using | IdType = sat::detail::RepoIdType
using | Keywords = sat::ArrayAttr<std::string, std::string>
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)
| PoolImpl 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.
std::string | name () const
| Label to display for this repo.
std::string | label () const
| Alias or name, according to ZConfig::repoLabelIsAlias.
std::string | asUserString () const
| User string: label (alias or name)
ContentRevision | contentRevision () const
| Timestamp or arbitrary user supplied string.
ContentIdentifier | contentIdentifier () const
| Unique string identifying a repositories content.
bool | hasContentIdentifier (const ContentIdentifier &id_r) const
| Whether id_r matches this repos content identifier.
Date | generatedTimestamp () const
| Timestamp when this repository was generated.
Date | suggestedExpirationTimestamp () const
| Suggested expiration timestamp.
Keywords | keywords () const
| repository keywords (tags)
bool | hasKeyword (const std::string &val_r) const
| Whether val_r is present in keywords.
bool | maybeOutdated () const
| The suggested expiration date of this repository already passed.
bool | isUpdateRepo () const
| Hint whether the Repo may provide updates for a product.
bool | providesUpdatesFor (const CpeId &cpeid_r) const
| Hint whether the Repo may provide updates for a product identified by its CpeId.
bool | solvablesEmpty () const
| Whether Repository contains solvables.
size_type | solvablesSize () const
| Number of solvables in Repository.
SolvableIterator | solvablesBegin () const
| Iterator to the first Solvable.
SolvableIterator | solvablesEnd () const
| Iterator behind the last Solvable.
Iterable< SolvableIterator > | solvables () const
| Iterate the repositories Solvables.
ProductInfoIterator | compatibleWithProductBegin () const
| Get an iterator to the beginning of the repository compatible distros.
ProductInfoIterator | compatibleWithProductEnd () const
| Get an iterator to the end of the repository compatible distros.
Iterable< ProductInfoIterator > | compatibleWithProduct () const
| Iterate the repository compatible distros.
ProductInfoIterator | updatesProductBegin () const
| Get an iterator to the beginning of distos the repository provides upadates for.
ProductInfoIterator | updatesProductEnd () const
| Get an iterator to the end of distos the repository provides upadates for.
Iterable< ProductInfoIterator > | updatesProduct () const
| Iterate distos the repository provides upadates for.
RepoInfo | info () const
| Return any associated RepoInfo.
void | setInfo (const RepoInfo &info_r)
| Set RepoInfo for this repository.
void | clearInfo ()
| Remove any RepoInfo set for this repository.
void | eraseFromPool ()
| Remove this Repository from its Pool.
Repository | nextInPool () const
| Return next Repository in Pool (or noRepository).

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

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

## Related Symbols
(Note that these are not member symbols.)
std::ostream & | operator<< (std::ostream &str, const Repository &obj) ZYPP_API
| Stream output.
std::ostream & | dumpAsXmlOn (std::ostream &str, const Repository &obj) ZYPP_API
| XML output.
bool | operator== (const Repository &lhs, const Repository &rhs)
bool | operator!= (const Repository &lhs, const Repository &rhs)
bool | operator< (const Repository &lhs, const Repository &rhs)

## Repository content manipulating methods.
Todo maybe a separate Repository/Solvable content manip interface provided by the pool.
IdType | _id
void | addSolv (const Pathname &file_r)
| Load Solvables from a solv-file.
void | addHelix (const Pathname &file_r)
| Load Solvables from a helix-file.
void | addTesttags (const 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 ()
sat::detail::CRepo * | get () const
| Expert backdoor.
IdType | id () const
| Expert backdoor.
int | satInternalPriority () const
| libsolv internal priorities.
int | satInternalSubPriority () const

## Additional Inherited Members
Static Protected Member Functions inherited from zypp::sat::detail::PoolMember
static PoolImpl & | myPool ()

## Detailed Description

Definition at line 39 of file Repository.h.

## Member Typedef Documentation

## ◆ SolvableIterator

using zypp::Repository::SolvableIterator = filter_iterator<detail::ByRepository, sat::detail::SolvableIterator>

Definition at line 42 of file Repository.h.

## ◆ size_type

using zypp::Repository::size_type = sat::detail::size_type

Definition at line 43 of file Repository.h.

## ◆ IdType

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

Definition at line 44 of file Repository.h.

## ◆ Keywords

using zypp::Repository::Keywords = sat::ArrayAttr<std::string, std::string>

Definition at line 46 of file Repository.h.

## ◆ ContentRevision

using zypp::Repository::ContentRevision = std::string

Definition at line 48 of file Repository.h.

## ◆ ContentIdentifier

using zypp::Repository::ContentIdentifier = std::string

Definition at line 49 of file Repository.h.

## Constructor & Destructor Documentation

## ◆ Repository() [1/4]

zypp::Repository::Repository | ( |  | ) |
| inline

Default ctor creates noRepository.

Definition at line 53 of file Repository.h.

## ◆ Repository() [2/4]

zypp::Repository::Repository | ( | const Repository & |  | ) |
| default

## ◆ Repository() [3/4]

zypp::Repository::Repository | ( | Repository && |  | ) |
| default noexcept

## ◆ Repository() [4/4]

zypp::Repository::Repository | ( | IdType | id_r | ) |
| inline explicit

PoolImpl ctor.

Definition at line 62 of file Repository.h.

## Member Function Documentation

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

Repository & zypp::Repository::operator= | ( | const Repository & |  | ) |
| default

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

Repository & zypp::Repository::operator= | ( | Repository && |  | ) |
| default noexcept

## ◆ operator bool()

zypp::Repository::operator bool | ( |  | ) | const
| inline explicit

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

Definition at line 70 of file Repository.h.

## ◆ systemRepoAlias()

const std::string & zypp::Repository::systemRepoAlias | ( |  | ) |
| static

Reserved system repository alias `@System` .

Definition at line 38 of file Repository.cc.

## ◆ isSystemRepo()

bool zypp::Repository::isSystemRepo | ( |  | ) | const

Return whether this is the system repository.

Definition at line 54 of file Repository.cc.

## ◆ alias()

std::string zypp::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 60 of file Repository.cc.

## ◆ name()

std::string zypp::Repository::name | ( |  | ) | const

Label to display for this repo.

Definition at line 68 of file Repository.cc.

## ◆ label()

std::string zypp::Repository::label | ( |  | ) | const

Alias or name, according to ZConfig::repoLabelIsAlias.

Definition at line 71 of file Repository.cc.

## ◆ asUserString()

std::string zypp::Repository::asUserString | ( |  | ) | const
| inline

User string: label (alias or name)

Definition at line 98 of file Repository.h.

## ◆ contentRevision()

Repository::ContentRevision zypp::Repository::contentRevision | ( |  | ) | const

Timestamp or arbitrary user supplied string.

`/repomd/revision/text`() in `repomd.xml`.

Definition at line 86 of file Repository.cc.

## ◆ contentIdentifier()

Repository::ContentIdentifier zypp::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>
zypp::repo
Definition DeltaCandidates.cc:30

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

Definition at line 93 of file Repository.cc.

## ◆ hasContentIdentifier()

bool zypp::Repository::hasContentIdentifier | ( | const ContentIdentifier & | id_r | ) | const

Whether id_r matches this repos content identifier.

Definition at line 100 of file Repository.cc.

## ◆ generatedTimestamp()

zypp::Date zypp::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 110 of file Repository.cc.

## ◆ suggestedExpirationTimestamp()

zypp::Date zypp::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 117 of file Repository.cc.

## ◆ keywords()

Repository::Keywords zypp::Repository::keywords | ( |  | ) | const

repository keywords (tags)

Definition at line 131 of file Repository.cc.

## ◆ hasKeyword()

bool zypp::Repository::hasKeyword | ( | const std::string & | val_r | ) | const

Whether val_r is present in keywords.

Definition at line 137 of file Repository.cc.

## ◆ maybeOutdated()

bool zypp::Repository::maybeOutdated | ( |  | ) | const

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 145 of file Repository.cc.

## ◆ isUpdateRepo()

bool zypp::Repository::isUpdateRepo | ( |  | ) | 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.

Definition at line 195 of file Repository.cc.

## ◆ providesUpdatesFor()

bool zypp::Repository::providesUpdatesFor | ( | const CpeId & | cpeid_r | ) | const

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.

Definition at line 161 of file Repository.cc.

## ◆ solvablesEmpty()

bool zypp::Repository::solvablesEmpty | ( |  | ) | const

Whether Repository contains solvables.

Definition at line 220 of file Repository.cc.

## ◆ solvablesSize()

Repository::size_type zypp::Repository::solvablesSize | ( |  | ) | const

Number of solvables in Repository.

Definition at line 226 of file Repository.cc.

## ◆ solvablesBegin()

Repository::SolvableIterator zypp::Repository::solvablesBegin | ( |  | ) | const

Iterator to the first Solvable.

Definition at line 232 of file Repository.cc.

## ◆ solvablesEnd()

Repository::SolvableIterator zypp::Repository::solvablesEnd | ( |  | ) | const

Iterator behind the last Solvable.

Definition at line 242 of file Repository.cc.

## ◆ solvables()

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

Iterate the repositories Solvables.

Definition at line 507 of file Repository.h.

## ◆ compatibleWithProductBegin()

Repository::ProductInfoIterator zypp::Repository::compatibleWithProductBegin | ( |  | ) | const

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

Definition at line 252 of file Repository.cc.

## ◆ compatibleWithProductEnd()

Repository::ProductInfoIterator zypp::Repository::compatibleWithProductEnd | ( |  | ) | const

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

See also
  Repository::ProductInfoIterator

Definition at line 258 of file Repository.cc.

## ◆ compatibleWithProduct()

Iterable< Repository::ProductInfoIterator > zypp::Repository::compatibleWithProduct | ( |  | ) | const
| inline

Iterate the repository compatible distros.

Definition at line 406 of file Repository.h.

## ◆ updatesProductBegin()

Repository::ProductInfoIterator zypp::Repository::updatesProductBegin | ( |  | ) | const

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

Definition at line 263 of file Repository.cc.

## ◆ updatesProductEnd()

Repository::ProductInfoIterator zypp::Repository::updatesProductEnd | ( |  | ) | const

Get an iterator to the end of distos the repository provides upadates for.

See also
  Repository::ProductInfoIterator

Definition at line 269 of file Repository.cc.

## ◆ updatesProduct()

Iterable< Repository::ProductInfoIterator > zypp::Repository::updatesProduct | ( |  | ) | const
| inline

Iterate distos the repository provides upadates for.

Definition at line 410 of file Repository.h.

## ◆ info()

RepoInfo zypp::Repository::info | ( |  | ) | const

Return any associated RepoInfo.

Definition at line 274 of file Repository.cc.

## ◆ setInfo()

void zypp::Repository::setInfo | ( | const RepoInfo & | info_r | ) |

Set RepoInfo for this repository.

Exceptions

  Exception | if this is noRepository
  Exception | if the RepoInfo::alias does not match the Repository::name.

Definition at line 280 of file Repository.cc.

## ◆ clearInfo()

void zypp::Repository::clearInfo | ( |  | ) |

Remove any RepoInfo set for this repository.

Definition at line 292 of file Repository.cc.

## ◆ eraseFromPool()

void zypp::Repository::eraseFromPool | ( |  | ) |

Remove this Repository from its Pool.

Definition at line 298 of file Repository.cc.

## ◆ nextInPool()

Repository zypp::Repository::nextInPool | ( |  | ) | const

Return next Repository in Pool (or noRepository).

Definition at line 306 of file Repository.cc.

## ◆ addSolv()

void zypp::Repository::addSolv | ( | const 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 321 of file Repository.cc.

## ◆ addHelix()

void zypp::Repository::addHelix | ( | const 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 340 of file Repository.cc.

## ◆ addTesttags()

void zypp::Repository::addTesttags | ( | const 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 362 of file Repository.cc.

## ◆ addSolvables()

sat::detail::SolvableIdType zypp::Repository::addSolvables | ( | unsigned | count_r | ) |

Add `count_r` new empty Solvable to this Repository.

Definition at line 384 of file Repository.cc.

## ◆ addSolvable()

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

Definition at line 313 of file Repository.h.

## ◆ get()

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

Expert backdoor.

Definition at line 43 of file Repository.cc.

## ◆ id()

IdType zypp::Repository::id | ( |  | ) | const
| inline

Expert backdoor.

Definition at line 321 of file Repository.h.

## ◆ satInternalPriority()

int zypp::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 74 of file Repository.cc.

## ◆ satInternalSubPriority()

int zypp::Repository::satInternalSubPriority | ( |  | ) | const

Definition at line 80 of file Repository.cc.

## Friends And Related Symbol Documentation

## ◆ operator<<()

std::ostream & operator<< | ( | std::ostream & | str,
|  | const Repository & | obj )
| related

Stream output.

Definition at line 395 of file Repository.cc.

## ◆ dumpAsXmlOn()

std::ostream & dumpAsXmlOn | ( | std::ostream & | str,
|  | const Repository & | obj )
| related

XML output.

Definition at line 407 of file Repository.cc.

## ◆ operator==()

bool operator== | ( | const Repository & | lhs,
|  | const Repository & | rhs )
| related

Definition at line 345 of file Repository.h.

## ◆ operator!=()

bool operator!= | ( | const Repository & | lhs,
|  | const Repository & | rhs )
| related

Definition at line 349 of file Repository.h.

## ◆ operator<()

bool operator< | ( | const Repository & | lhs,
|  | const Repository & | rhs )
| related

Definition at line 353 of file Repository.h.

## Member Data Documentation

## ◆ noRepository

const Repository zypp::Repository::noRepository
| static

Represents no Repository.

Definition at line 67 of file Repository.h.

## ◆ _id

IdType zypp::Repository::_id
| private

Definition at line 334 of file Repository.h.

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

- zypp/Repository.h
- zypp/Repository.cc