libzypp 17.38.6
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 = boost::filter_iterator<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
Repositoryoperator= (const Repository &)=default
Repositoryoperator= (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 >
Poolpool ()

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::CRepoget () 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 49 of file repository.h.

Member Typedef Documentation

◆ SolvableIterator

◆ SolvableIterable

◆ size_type

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

Definition at line 54 of file repository.h.

◆ IdType

◆ ContentRevision

Definition at line 59 of file repository.h.

◆ ContentIdentifier

Definition at line 60 of file repository.h.

Constructor & Destructor Documentation

◆ Repository() [1/4]

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

Default ctor creates noRepository.

Definition at line 64 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 73 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 81 of file repository.h.

◆ systemRepoAlias()

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

Reserved system repository alias @System .

Definition at line 52 of file repository.cc.

◆ isSystemRepo()

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

Return whether this is the system repository.

Definition at line 68 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 74 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 94 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>

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

Definition at line 101 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 108 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 120 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 128 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 143 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 159 of file repository.cc.

◆ solvablesSize()

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

Number of solvables in Repository.

Definition at line 165 of file repository.cc.

◆ solvables()

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

Iterate the repositories Solvables.

Definition at line 524 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
Exceptionif this is noRepository
Exceptionif 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 191 of file repository.cc.

◆ nextInPool()

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

Return next Repository in Pool (or noRepository).

Definition at line 199 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
Exceptionif this is noRepository
Exceptionif loading the solv-file fails.
See also
Pool::addRepoSolv and Repository::EraseFromPool

Definition at line 215 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
Exceptionif this is noRepository
Exceptionif loading the helix-file fails.
See also
Pool::addRepoHelix and Repository::EraseFromPool

Definition at line 234 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
Exceptionif this is noRepository
Exceptionif loading the helix-file fails.
See also
Pool::addRepoTesttags and Repository::EraseFromPool

Definition at line 258 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 282 of file repository.cc.

◆ addSolvable()

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

Definition at line 318 of file repository.h.

◆ get()

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

Expert backdoor.

Definition at line 57 of file repository.cc.

◆ id()

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

Expert backdoor.

Definition at line 326 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 82 of file repository.cc.

◆ satInternalSubPriority()

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

Definition at line 88 of file repository.cc.

◆ solvablesBegin()

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

Iterator to the first Solvable.

Definition at line 171 of file repository.cc.

◆ solvablesEnd()

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

Iterator behind the last Solvable.

Definition at line 181 of file repository.cc.

Member Data Documentation

◆ noRepository

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

Represents no Repository.

Definition at line 78 of file repository.h.

◆ _id

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

Definition at line 347 of file repository.h.


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