libzypp  15.28.6
zypp::Repository Class Reference

#include <Repository.h>

Inheritance diagram for zypp::Repository:

Classes

struct  EraseFromPool
 Functor removing Repository from it's Pool. More...
 
class  ProductInfoIterator
 Query class for Repository related products. More...
 

Public Types

typedef filter_iterator
< detail::ByRepository,
sat::detail::SolvableIterator
SolvableIterator
 
typedef sat::detail::size_type size_type
 
typedef sat::detail::RepoIdType IdType
 
typedef sat::ArrayAttr
< std::string, std::string > 
Keywords
 
typedef std::string ContentRevision
 
typedef std::string ContentIdentifier
 

Public Member Functions

 Repository ()
 Default ctor creates noRepository. More...
 
 Repository (IdType id_r)
 PoolImpl ctor. More...
 
 operator bool () const
 Evaluate Repository in a boolean context (!= noRepository). More...
 
bool isSystemRepo () const
 Return whether this is the system repository. More...
 
std::string alias () const
 Short unique string to identify a repo. More...
 
std::string name () const
 Label to display for this repo. More...
 
std::string label () const
 Alias or name, according to ZConfig::repoLabelIsAlias. More...
 
std::string asUserString () const
 User string: label (alias or name) More...
 
ContentRevision contentRevision () const
 Timestamp or arbitrary user supplied string. More...
 
ContentIdentifier contentIdentifier () const
 Unique string identifying a repositories content. More...
 
bool hasContentIdentifier (const ContentIdentifier &id_r) const
 Whether id_r matches this repos content identifier. More...
 
Date generatedTimestamp () const
 Timestamp when this repository was generated. More...
 
Date suggestedExpirationTimestamp () const
 Suggested expiration timestamp. More...
 
Keywords keywords () const
 repository keywords (tags) More...
 
bool hasKeyword (const std::string &val_r) const
 Whether val_r is present in keywords. More...
 
bool maybeOutdated () const
 The suggested expiration date of this repository already passed. More...
 
bool isUpdateRepo () const
 Hint whether the Repo may provide updates for a product. More...
 
bool providesUpdatesFor (const CpeId &cpeid_r) const
 Hint whether the Repo may provide updates for a product identified by it's CpeId. More...
 
bool solvablesEmpty () const
 Whether Repository contains solvables. More...
 
size_type solvablesSize () const
 Number of solvables in Repository. More...
 
SolvableIterator solvablesBegin () const
 Iterator to the first Solvable. More...
 
SolvableIterator solvablesEnd () const
 Iterator behind the last Solvable. More...
 
Iterable< SolvableIteratorsolvables () const
 Iterate the repositories Solvables. More...
 
ProductInfoIterator compatibleWithProductBegin () const
 Get an iterator to the beginning of the repository compatible distros. More...
 
ProductInfoIterator compatibleWithProductEnd () const
 Get an iterator to the end of the repository compatible distros. More...
 
Iterable< ProductInfoIteratorcompatibleWithProduct () const
 Iterate the repository compatible distros. More...
 
ProductInfoIterator updatesProductBegin () const
 Get an iterator to the beginning of distos the repository provides upadates for. More...
 
ProductInfoIterator updatesProductEnd () const
 Get an iterator to the end of distos the repository provides upadates for. More...
 
Iterable< ProductInfoIteratorupdatesProduct () const
 Iterate distos the repository provides upadates for. More...
 
RepoInfo info () const
 Return any associated RepoInfo. More...
 
void setInfo (const RepoInfo &info_r)
 Set RepoInfo for this repository. More...
 
void clearInfo ()
 Remove any RepoInfo set for this repository. More...
 
void eraseFromPool ()
 Remove this Repository from it's Pool. More...
 
Repository nextInPool () const
 Return next Repository in Pool (or noRepository). More...
 
sat::detail::CRepoget () const
 Expert backdoor. More...
 
IdType id () const
 Expert backdoor. More...
 
Repository content manipulating methods.
Todo:
maybe a separate Repository/Solvable content manip interface provided by the pool.
void addSolv (const Pathname &file_r)
 Load Solvables from a solv-file. More...
 
void addHelix (const Pathname &file_r)
 Load Solvables from a helix-file. More...
 
sat::Solvable::IdType addSolvables (unsigned count_r)
 Add count_r new empty Solvable to this Repository. More...
 
sat::Solvable::IdType addSolvable ()
 
int satInternalPriority () const
 libsolv internal priorities. More...
 
int satInternalSubPriority () const
 

Static Public Member Functions

static const std::string & systemRepoAlias ()
 Reserved system repository alias . More...
 

Static Public Attributes

static const Repository noRepository
 Represents no Repository. More...
 

Private Attributes

IdType _id
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const Repository &obj)
 
std::ostream & dumpAsXmlOn (std::ostream &str, const Repository &obj)
 
bool operator== (const Repository &lhs, const Repository &rhs)
 
bool operator!= (const Repository &lhs, const Repository &rhs)
 
bool operator< (const Repository &lhs, const Repository &rhs)
 

Additional Inherited Members

- Static Protected Member Functions inherited from zypp::sat::detail::PoolMember
static PoolImplmyPool ()
 

Detailed Description

Definition at line 39 of file Repository.h.

Member Typedef Documentation

Definition at line 44 of file Repository.h.

typedef sat::ArrayAttr<std::string,std::string> zypp::Repository::Keywords

Definition at line 46 of file Repository.h.

typedef std::string zypp::Repository::ContentRevision

Definition at line 48 of file Repository.h.

Definition at line 49 of file Repository.h.

Constructor & Destructor Documentation

zypp::Repository::Repository ( )
inline

Default ctor creates noRepository.

Definition at line 53 of file Repository.h.

zypp::Repository::Repository ( IdType  id_r)
inlineexplicit

PoolImpl ctor.

Definition at line 57 of file Repository.h.

Member Function Documentation

zypp::Repository::operator bool ( ) const
inlineexplicit

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

Definition at line 65 of file Repository.h.

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

Reserved system repository alias .

Definition at line 37 of file Repository.cc.

bool zypp::Repository::isSystemRepo ( ) const

Return whether this is the system repository.

Definition at line 53 of file Repository.cc.

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

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

Label to display for this repo.

Definition at line 67 of file Repository.cc.

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

Alias or name, according to ZConfig::repoLabelIsAlias.

Definition at line 70 of file Repository.cc.

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

User string: label (alias or name)

Definition at line 93 of file Repository.h.

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

Timestamp or arbitrary user supplied string.

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

Definition at line 85 of file Repository.cc.

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>

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

Definition at line 92 of file Repository.cc.

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

Whether id_r matches this repos content identifier.

Definition at line 99 of file Repository.cc.

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

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

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

repository keywords (tags)

Definition at line 130 of file Repository.cc.

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

Whether val_r is present in keywords.

Definition at line 136 of file Repository.cc.

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

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 it's metadata or a known product lists the repositories ContentIdentifier as required update repo.

Definition at line 194 of file Repository.cc.

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

Hint whether the Repo may provide updates for a product identified by it's CpeId.

Either the repository claims to update a product via a repository updates tag in it's metadata or a known product lists the repositories ContentIdentifier as required update repo.

Definition at line 160 of file Repository.cc.

bool zypp::Repository::solvablesEmpty ( ) const

Whether Repository contains solvables.

Definition at line 219 of file Repository.cc.

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

Number of solvables in Repository.

Definition at line 225 of file Repository.cc.

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

Iterator to the first Solvable.

Definition at line 231 of file Repository.cc.

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

Iterator behind the last Solvable.

Definition at line 241 of file Repository.cc.

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

Iterate the repositories Solvables.

Definition at line 494 of file Repository.h.

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

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

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

See Also
Repository::ProductInfoIterator

Definition at line 257 of file Repository.cc.

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

Iterate the repository compatible distros.

Definition at line 393 of file Repository.h.

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

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

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

Iterate distos the repository provides upadates for.

Definition at line 397 of file Repository.h.

RepoInfo zypp::Repository::info ( ) const

Return any associated RepoInfo.

Definition at line 273 of file Repository.cc.

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

Set RepoInfo for this repository.

Exceptions
Exceptionif this is noRepository
Exceptionif the RepoInfo::alias does not match the Repository::name.

Definition at line 279 of file Repository.cc.

void zypp::Repository::clearInfo ( )

Remove any RepoInfo set for this repository.

Definition at line 291 of file Repository.cc.

void zypp::Repository::eraseFromPool ( )

Remove this Repository from it's Pool.

Definition at line 297 of file Repository.cc.

Repository zypp::Repository::nextInPool ( ) const

Return next Repository in Pool (or noRepository).

Definition at line 305 of file Repository.cc.

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

Definition at line 320 of file Repository.cc.

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

Definition at line 339 of file Repository.cc.

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

Add count_r new empty Solvable to this Repository.

Definition at line 361 of file Repository.cc.

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

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 299 of file Repository.h.

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

Expert backdoor.

Definition at line 42 of file Repository.cc.

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

Expert backdoor.

Definition at line 307 of file Repository.h.

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 solvers internal priority representation. It is type int and as one might expect it, the higher the value the higher the priority. Subpriority is currently used to express media preferences (

See Also
MediaPriority).

Definition at line 73 of file Repository.cc.

int zypp::Repository::satInternalSubPriority ( ) const

Definition at line 79 of file Repository.cc.

Friends And Related Function Documentation

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

Stream output

Definition at line 372 of file Repository.cc.

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

XML output

Definition at line 384 of file Repository.cc.

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

Definition at line 332 of file Repository.h.

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

Definition at line 336 of file Repository.h.

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

Definition at line 340 of file Repository.h.

Member Data Documentation

const Repository zypp::Repository::noRepository
static

Represents no Repository.

Definition at line 62 of file Repository.h.

IdType zypp::Repository::_id
private

Definition at line 321 of file Repository.h.


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