libzypp  15.21.4
zypp::RepoInfo Class Reference

What is known about a repository. More...

#include <RepoInfo.h>

Inheritance diagram for zypp::RepoInfo:

Classes

struct  Impl
 RepoInfo implementation. More...
 

Public Types

typedef std::list< Urlurl_set
 
typedef url_set::size_type urls_size_type
 
typedef transform_iterator
< repo::RepoVariablesUrlReplacer,
url_set::const_iterator > 
urls_const_iterator
 

Public Member Functions

 RepoInfo ()
 
virtual ~RepoInfo ()
 
unsigned priority () const
 Repository priority for solver. More...
 
void setPriority (unsigned newval_r)
 Set repository priority for solver. More...
 
bool baseUrlsEmpty () const
 whether repository urls are available More...
 
bool baseUrlSet () const
 Whether there are manualy configured repository urls. More...
 
urls_size_type baseUrlsSize () const
 number of repository urls More...
 
urls_const_iterator baseUrlsBegin () const
 iterator that points at begin of repository urls More...
 
urls_const_iterator baseUrlsEnd () const
 iterator that points at end of repository urls More...
 
Url url () const
 Pars pro toto: The first repository url. More...
 
Url rawUrl () const
 Pars pro toto: The first repository raw url (no variables replaced) More...
 
url_set baseUrls () const
 The complete set of repository urls. More...
 
url_set rawBaseUrls () const
 The complete set of raw repository urls (no variables replaced) More...
 
void addBaseUrl (const Url &url)
 Add a base url. More...
 
void setBaseUrl (const Url &url)
 Clears current base URL list and adds url. More...
 
Pathname path () const
 Repository path. More...
 
void setPath (const Pathname &path)
 set the product path. More...
 
Url mirrorListUrl () const
 Url of a file which contains a list of repository urls. More...
 
Url rawMirrorListUrl () const
 The raw mirrorListUrl (no variables replaced). More...
 
void setMirrorListUrl (const Url &url)
 Set mirror list url. More...
 
void setMetalinkUrl (const Url &url)
 Like setMirrorListUrl but expect metalink format. More...
 
repo::RepoType type () const
 Type of repository,. More...
 
void setProbedType (const repo::RepoType &t) const
 This allows to adjust the RepoType lazy, from NONE to some probed value, even for const objects. More...
 
void setType (const repo::RepoType &t)
 set the repository type More...
 
Pathname metadataPath () const
 Path where this repo metadata was read from. More...
 
void setMetadataPath (const Pathname &path)
 set the path where the local metadata is stored More...
 
Pathname packagesPath () const
 Path where this repo packages are cached. More...
 
void setPackagesPath (const Pathname &path)
 set the path where the local packages are stored More...
 
bool gpgCheck () const
 Whether default signature checking should be performed for this repo. More...
 
void setGpgCheck (TriBool value_r)
 Set the value for gpgCheck (or indeterminate to use the default). More...
 
void setGpgCheck (bool value_r)
 
bool repoGpgCheck () const
 Whether the signature of repo metadata should be checked for this repo. More...
 
void setRepoGpgCheck (TriBool value_r)
 Set the value for repoGpgCheck (or indeterminate to use the default). More...
 
bool pkgGpgCheck () const
 Whether the signature of rpm packages should be checked for this repo. More...
 
void setPkgGpgCheck (TriBool value_r)
 Set the value for pkgGpgCheck (or indeterminate to use the default). More...
 
TriBool validRepoSignature () const
 Whether the repo metadata are signed and successfully validated or indeterminate if unsigned. More...
 
void setValidRepoSignature (TriBool value_r)
 Set the value for validRepoSignature (or indeterminate if unsigned). More...
 
Url gpgKeyUrl () const
 Key to use for gpg checking of this repository. More...
 
Url rawGpgKeyUrl () const
 The raw gpgKeyUrl (no variables replaced). More...
 
void setGpgKeyUrl (const Url &gpgkey)
 Key to use for gpg checking of this repository. More...
 
bool keepPackages () const
 Whether packages downloaded from this repository will be kept in local cache. More...
 
void setKeepPackages (bool keep)
 Set if packaqes downloaded from this repository will be kept in local cache. More...
 
std::string service () const
 Gets name of the service to which this repository belongs or empty string if it has been added manually. More...
 
void setService (const std::string &name)
 sets service which added this repository More...
 
std::string targetDistribution () const
 Distribution for which is this repository meant. More...
 
void setTargetDistribution (const std::string &targetDistribution)
 Sets the distribution for which is this repository meant. More...
 
const std::set< std::string > & contentKeywords () const
 Content keywords defined. More...
 
void addContent (const std::string &keyword_r)
 Add content keywords. More...
 
template<class TIterator >
void addContentFrom (TIterator begin_r, TIterator end_r)
 
template<class TContainer >
void addContentFrom (const TContainer &container_r)
 
bool hasContent () const
 Check for content keywords. More...
 
bool hasContent (const std::string &keyword_r) const
 
template<class TIterator >
bool hasContentAll (TIterator begin_r, TIterator end_r) const
 
template<class TContainer >
bool hasContentAll (const TContainer &container_r) const
 
template<class TIterator >
bool hasContentAny (TIterator begin_r, TIterator end_r) const
 
template<class TContainer >
bool hasContentAny (const TContainer &container_r) const
 
virtual std::ostream & dumpOn (std::ostream &str) const
 Write a human-readable representation of this RepoInfo object into the str stream. More...
 
virtual std::ostream & dumpAsIniOn (std::ostream &str) const
 Write this RepoInfo object into str in a .repo file format. More...
 
virtual std::ostream & dumpAsXmlOn (std::ostream &str, const std::string &content="") const
 Write an XML representation of this RepoInfo object. More...
 
Repository license
bool hasLicense () const
 Whether there is a license associated with the repo. More...
 
bool needToAcceptLicense () const
 Whether the repo license has to be accepted, e.g. More...
 
std::string getLicense (const Locale &lang_r=Locale()) const
 Return the best license for the current (or a specified) locale. More...
 
std::string getLicense (const Locale &lang_r=Locale())
 
LocaleSet getLicenseLocales () const
 Return the locales the license is available for. More...
 
- Public Member Functions inherited from zypp::repo::RepoInfoBase
 RepoInfoBase ()
 
 RepoInfoBase (const std::string &alias)
 
virtual ~RepoInfoBase ()
 
std::string alias () const
 unique identifier for this source. More...
 
std::string escaped_alias () const
 Same as alias(), just escaped in a way to be a valid file name. More...
 
std::string name () const
 Repository name. More...
 
std::string rawName () const
 The raw metadata name (no default, no variables replaced). More...
 
std::string label () const
 Label for use in messages for the user interface. More...
 
std::string asUserString () const
 User string: label (alias or name) More...
 
bool enabled () const
 If enabled is false, then this repository must be ignored as if does not exists, except when checking for duplicate alias. More...
 
bool autorefresh () const
 If true, the repostory must be refreshed before creating resolvables from it. More...
 
Pathname filepath () const
 File where this repo was read from. More...
 
void setAlias (const std::string &alias)
 set the repository alias More...
 
void setName (const std::string &name)
 set the repository name More...
 
void setEnabled (bool enabled)
 enable or disable the repository More...
 
void setAutorefresh (bool autorefresh)
 enable or disable autorefresh More...
 
void setFilepath (const Pathname &filename)
 set the path to the .repo file More...
 

Static Public Member Functions

static unsigned defaultPriority ()
 The default priority (99). More...
 
static unsigned noPriority ()
 The least priority (unsigned(-1)). More...
 

Static Public Attributes

static const RepoInfo noRepo
 Represents no Repository (one with an empty alias). More...
 

Private Member Functions

void getRawGpgChecks (TriBool &g_r, TriBool &r_r, TriBool &p_r) const
 Raw values for RepoManager. More...
 

Private Attributes

RWCOW_pointer< Impl_pimpl
 Pointer to implementation. More...
 

Friends

class RepoManager
 
std::ostream & operator<< (std::ostream &str, const RepoInfo &obj)
 

Related Functions

(Note that these are not member functions.)

typedef shared_ptr< RepoInfoRepoInfo_Ptr
 
typedef shared_ptr< const
RepoInfo
RepoInfo_constPtr
 
typedef std::list< RepoInfoRepoInfoList
 
std::ostream & operator<< (std::ostream &str, const RepoInfo &obj)
 

Detailed Description

What is known about a repository.

The class RepoInfo represents everything that is known about a software repository.

It can be used to store information about known sources.

This class tries to be compatible with the concept of a .repo file used by YUM and also available in the openSUSE build service. See man yum.conf.

Example file

[ruby]
name=Ruby repository (openSUSE_10.2)
type=rpm-md
baseurl=http://software.opensuse.org/download/ruby/openSUSE_10.2/
http://some.opensuse.mirror/ruby/openSUSE_10.2/
gpgcheck=1
gpgkey=http://software.opensuse.org/openSUSE-Build-Service.asc
Note
A RepoInfo is a hint about how to create a Repository.
Name, baseUrls and mirrorUrl are subject to repo variable replacement (
See Also
RepoVariablesStringReplacer).

Definition at line 71 of file RepoInfo.h.

Member Typedef Documentation

typedef std::list<Url> zypp::RepoInfo::url_set

Definition at line 103 of file RepoInfo.h.

typedef url_set::size_type zypp::RepoInfo::urls_size_type

Definition at line 104 of file RepoInfo.h.

Definition at line 105 of file RepoInfo.h.

Constructor & Destructor Documentation

zypp::RepoInfo::RepoInfo ( )

Definition at line 255 of file RepoInfo.cc.

zypp::RepoInfo::~RepoInfo ( )
virtual

Definition at line 259 of file RepoInfo.cc.

Member Function Documentation

unsigned zypp::RepoInfo::defaultPriority ( )
static

The default priority (99).

Definition at line 265 of file RepoInfo.cc.

unsigned zypp::RepoInfo::noPriority ( )
static

The least priority (unsigned(-1)).

Definition at line 268 of file RepoInfo.cc.

unsigned zypp::RepoInfo::priority ( ) const

Repository priority for solver.

Some number between 1 (highest priority) and 99 (defaultPriority).

Definition at line 262 of file RepoInfo.cc.

void zypp::RepoInfo::setPriority ( unsigned  newval_r)

Set repository priority for solver.

A newval_r of 0 sets the default priority.

See Also
priority.

Definition at line 271 of file RepoInfo.cc.

bool zypp::RepoInfo::baseUrlsEmpty ( ) const

whether repository urls are available

Definition at line 426 of file RepoInfo.cc.

bool zypp::RepoInfo::baseUrlSet ( ) const

Whether there are manualy configured repository urls.

If false, a mirrorlist might be used.

Definition at line 429 of file RepoInfo.cc.

RepoInfo::urls_size_type zypp::RepoInfo::baseUrlsSize ( ) const

number of repository urls

Definition at line 423 of file RepoInfo.cc.

RepoInfo::urls_const_iterator zypp::RepoInfo::baseUrlsBegin ( ) const

iterator that points at begin of repository urls

Definition at line 417 of file RepoInfo.cc.

RepoInfo::urls_const_iterator zypp::RepoInfo::baseUrlsEnd ( ) const

iterator that points at end of repository urls

Definition at line 420 of file RepoInfo.cc.

Url zypp::RepoInfo::url ( ) const
inline

Pars pro toto: The first repository url.

Definition at line 131 of file RepoInfo.h.

Url zypp::RepoInfo::rawUrl ( ) const

Pars pro toto: The first repository raw url (no variables replaced)

Definition at line 414 of file RepoInfo.cc.

RepoInfo::url_set zypp::RepoInfo::baseUrls ( ) const

The complete set of repository urls.

These are either the configured baseurls, or if empty, the downloaded mirror list (

See Also
mirrorListUrl)

Definition at line 399 of file RepoInfo.cc.

RepoInfo::url_set zypp::RepoInfo::rawBaseUrls ( ) const

The complete set of raw repository urls (no variables replaced)

Definition at line 402 of file RepoInfo.cc.

void zypp::RepoInfo::addBaseUrl ( const Url url)

Add a base url.

See Also
baseUrls
Parameters
urlThe base url for the repository.

To recreate the base URLs list, use setBaseUrl(const Url &) followed by addBaseUrl().

Definition at line 336 of file RepoInfo.cc.

void zypp::RepoInfo::setBaseUrl ( const Url url)

Clears current base URL list and adds url.

Definition at line 344 of file RepoInfo.cc.

Pathname zypp::RepoInfo::path ( ) const

Repository path.

Pathname relative to the base Url where the product/repository is located

For media containing more than one product, or repositories not located at the root of the media it is important to know the path to the product directory relative to the media root. So a media verifier can be set for that media. You may also read it as baseUrl = url to mount and path = path on the mounted media.

It is not mandatory, and the default is /.

Note
As a repository can have multiple Urls, the path is unique and the same for all Urls, so it is assumed all the Urls have the same media layout.

Definition at line 405 of file RepoInfo.cc.

void zypp::RepoInfo::setPath ( const Pathname &  path)

set the product path.

See Also
path()
Parameters
paththe path to the product

Definition at line 350 of file RepoInfo.cc.

Url zypp::RepoInfo::mirrorListUrl ( ) const

Url of a file which contains a list of repository urls.

Definition at line 387 of file RepoInfo.cc.

Url zypp::RepoInfo::rawMirrorListUrl ( ) const

The raw mirrorListUrl (no variables replaced).

Definition at line 390 of file RepoInfo.cc.

void zypp::RepoInfo::setMirrorListUrl ( const Url url)

Set mirror list url.

See Also
mirrorListUrl
Parameters
urlThe base url for the list

Definition at line 327 of file RepoInfo.cc.

void zypp::RepoInfo::setMetalinkUrl ( const Url url)

Like setMirrorListUrl but expect metalink format.

Definition at line 330 of file RepoInfo.cc.

repo::RepoType zypp::RepoInfo::type ( ) const

Type of repository,.

Definition at line 384 of file RepoInfo.cc.

void zypp::RepoInfo::setProbedType ( const repo::RepoType t) const

This allows to adjust the RepoType lazy, from NONE to some probed value, even for const objects.

This is a NOOP if the current type is not NONE.

Definition at line 356 of file RepoInfo.cc.

void zypp::RepoInfo::setType ( const repo::RepoType t)

set the repository type

See Also
type
Parameters
t

Definition at line 353 of file RepoInfo.cc.

Pathname zypp::RepoInfo::metadataPath ( ) const

Path where this repo metadata was read from.

Note
could be an empty pathname for repo infos created in memory.

Definition at line 378 of file RepoInfo.cc.

void zypp::RepoInfo::setMetadataPath ( const Pathname &  path)

set the path where the local metadata is stored

The path to the metadata of this repository was defined, or empty if nowhere.

Parameters
pathdirectory path

Definition at line 360 of file RepoInfo.cc.

Pathname zypp::RepoInfo::packagesPath ( ) const

Path where this repo packages are cached.

Definition at line 381 of file RepoInfo.cc.

void zypp::RepoInfo::setPackagesPath ( const Pathname &  path)

set the path where the local packages are stored

Parameters
pathdirectory path

Definition at line 363 of file RepoInfo.cc.

bool zypp::RepoInfo::gpgCheck ( ) const

Whether default signature checking should be performed for this repo.

This will turn on repoGpgCheck for signed repos and pkgGpgCheck for unsigned ones or if repoGpgCheck is off.

The default is true but may be overwritten by zypp.conf or a .repo file.

Definition at line 275 of file RepoInfo.cc.

void zypp::RepoInfo::setGpgCheck ( TriBool  value_r)

Set the value for gpgCheck (or indeterminate to use the default).

Definition at line 278 of file RepoInfo.cc.

void zypp::RepoInfo::setGpgCheck ( bool  value_r)

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 281 of file RepoInfo.cc.

bool zypp::RepoInfo::repoGpgCheck ( ) const

Whether the signature of repo metadata should be checked for this repo.

The default is defined by gpgCheck but may be overwritten by zypp.conf or a .repo file.

Definition at line 285 of file RepoInfo.cc.

void zypp::RepoInfo::setRepoGpgCheck ( TriBool  value_r)

Set the value for repoGpgCheck (or indeterminate to use the default).

Definition at line 292 of file RepoInfo.cc.

bool zypp::RepoInfo::pkgGpgCheck ( ) const

Whether the signature of rpm packages should be checked for this repo.

The default is defined by gpgCheck but may be overwritten by zypp.conf or a .repo file.

Definition at line 296 of file RepoInfo.cc.

void zypp::RepoInfo::setPkgGpgCheck ( TriBool  value_r)

Set the value for pkgGpgCheck (or indeterminate to use the default).

Definition at line 304 of file RepoInfo.cc.

TriBool zypp::RepoInfo::validRepoSignature ( ) const

Whether the repo metadata are signed and successfully validated or indeterminate if unsigned.

The value is usually set by repo::Downloader when retrieving the metadata.

Definition at line 314 of file RepoInfo.cc.

void zypp::RepoInfo::setValidRepoSignature ( TriBool  value_r)

Set the value for validRepoSignature (or indeterminate if unsigned).

Definition at line 323 of file RepoInfo.cc.

Url zypp::RepoInfo::gpgKeyUrl ( ) const

Key to use for gpg checking of this repository.

Parameters
urlUrl to the key in ASCII armored format
Note
This is a just a hint to the application and can be ignored.

Definition at line 393 of file RepoInfo.cc.

Url zypp::RepoInfo::rawGpgKeyUrl ( ) const

The raw gpgKeyUrl (no variables replaced).

Definition at line 396 of file RepoInfo.cc.

void zypp::RepoInfo::setGpgKeyUrl ( const Url gpgkey)

Key to use for gpg checking of this repository.

Parameters
urlUrl to the key in ASCII armored format
Note
This is a just a hint to the application and can be ignored.

Definition at line 333 of file RepoInfo.cc.

bool zypp::RepoInfo::keepPackages ( ) const

Whether packages downloaded from this repository will be kept in local cache.

Definition at line 375 of file RepoInfo.cc.

void zypp::RepoInfo::setKeepPackages ( bool  keep)

Set if packaqes downloaded from this repository will be kept in local cache.

If the setting is true, all downloaded packages from this repository will be copied to the local raw cache.

Parameters
keeptrue (keep the downloaded packages) or false (delete them after installation)

Definition at line 366 of file RepoInfo.cc.

std::string zypp::RepoInfo::service ( ) const

Gets name of the service to which this repository belongs or empty string if it has been added manually.

Definition at line 408 of file RepoInfo.cc.

void zypp::RepoInfo::setService ( const std::string &  name)

sets service which added this repository

Definition at line 369 of file RepoInfo.cc.

std::string zypp::RepoInfo::targetDistribution ( ) const

Distribution for which is this repository meant.

Definition at line 411 of file RepoInfo.cc.

void zypp::RepoInfo::setTargetDistribution ( const std::string &  targetDistribution)

Sets the distribution for which is this repository meant.

This is an in-memory value only, does not get written to the .repo file upon saving.

Definition at line 372 of file RepoInfo.cc.

const std::set< std::string > & zypp::RepoInfo::contentKeywords ( ) const

Content keywords defined.

Definition at line 432 of file RepoInfo.cc.

void zypp::RepoInfo::addContent ( const std::string &  keyword_r)

Add content keywords.

Definition at line 435 of file RepoInfo.cc.

template<class TIterator >
void zypp::RepoInfo::addContentFrom ( TIterator  begin_r,
TIterator  end_r 
)
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 358 of file RepoInfo.h.

template<class TContainer >
void zypp::RepoInfo::addContentFrom ( const TContainer &  container_r)
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 362 of file RepoInfo.h.

bool zypp::RepoInfo::hasContent ( ) const

Check for content keywords.

They may be missing due to missing metadata in disabled repos.

Definition at line 438 of file RepoInfo.cc.

bool zypp::RepoInfo::hasContent ( const std::string &  keyword_r) const

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 441 of file RepoInfo.cc.

template<class TIterator >
bool zypp::RepoInfo::hasContentAll ( TIterator  begin_r,
TIterator  end_r 
) const
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 373 of file RepoInfo.h.

template<class TContainer >
bool zypp::RepoInfo::hasContentAll ( const TContainer &  container_r) const
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 377 of file RepoInfo.h.

template<class TIterator >
bool zypp::RepoInfo::hasContentAny ( TIterator  begin_r,
TIterator  end_r 
) const
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 381 of file RepoInfo.h.

template<class TContainer >
bool zypp::RepoInfo::hasContentAny ( const TContainer &  container_r) const
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 385 of file RepoInfo.h.

bool zypp::RepoInfo::hasLicense ( ) const

Whether there is a license associated with the repo.

Definition at line 446 of file RepoInfo.cc.

bool zypp::RepoInfo::needToAcceptLicense ( ) const

Whether the repo license has to be accepted, e.g.

there is no no acceptance needed for openSUSE.

Definition at line 452 of file RepoInfo.cc.

std::string zypp::RepoInfo::getLicense ( const Locale lang_r = Locale()) const

Return the best license for the current (or a specified) locale.

Definition at line 483 of file RepoInfo.cc.

std::string zypp::RepoInfo::getLicense ( const Locale lang_r = Locale())

Definition at line 480 of file RepoInfo.cc.

LocaleSet zypp::RepoInfo::getLicenseLocales ( ) const

Return the locales the license is available for.

Locale::noCode is included in case of license.txt which does not specify a specific locale.

Definition at line 523 of file RepoInfo.cc.

std::ostream & zypp::RepoInfo::dumpOn ( std::ostream &  str) const
virtual

Write a human-readable representation of this RepoInfo object into the str stream.

Useful for logging.

Reimplemented from zypp::repo::RepoInfoBase.

Definition at line 556 of file RepoInfo.cc.

std::ostream & zypp::RepoInfo::dumpAsIniOn ( std::ostream &  str) const
virtual

Write this RepoInfo object into str in a .repo file format.

Raw values, no variable replacement.

Reimplemented from zypp::repo::RepoInfoBase.

Definition at line 600 of file RepoInfo.cc.

std::ostream & zypp::RepoInfo::dumpAsXmlOn ( std::ostream &  str,
const std::string &  content = "" 
) const
virtual

Write an XML representation of this RepoInfo object.

Repo variables replaced.

Parameters
str
contentthis argument is ignored (used in other classed derived from RepoInfoBase.

Reimplemented from zypp::repo::RepoInfoBase.

Definition at line 647 of file RepoInfo.cc.

void zypp::RepoInfo::getRawGpgChecks ( TriBool g_r,
TriBool r_r,
TriBool p_r 
) const
private

Raw values for RepoManager.

Definition at line 307 of file RepoInfo.cc.

Friends And Related Function Documentation

typedef shared_ptr<RepoInfo> RepoInfo_Ptr
related

Definition at line 446 of file RepoInfo.h.

typedef shared_ptr<const RepoInfo> RepoInfo_constPtr
related

Definition at line 448 of file RepoInfo.h.

typedef std::list<RepoInfo> RepoInfoList
related

Definition at line 450 of file RepoInfo.h.

friend class RepoManager
friend

Definition at line 434 of file RepoInfo.h.

std::ostream& operator<< ( std::ostream &  str,
const RepoInfo obj 
)
friend

Definition at line 680 of file RepoInfo.cc.

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

Stream output

Definition at line 680 of file RepoInfo.cc.

Member Data Documentation

const RepoInfo zypp::RepoInfo::noRepo
static

Represents no Repository (one with an empty alias).

Definition at line 80 of file RepoInfo.h.

RWCOW_pointer<Impl> zypp::RepoInfo::_pimpl
private

Pointer to implementation.

Definition at line 441 of file RepoInfo.h.


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