libzypp 8.13.6
|
What is known about a repository. More...
#include <RepoInfo.h>
Classes | |
struct | Impl |
RepoInfo implementation. More... | |
Public Types | |
typedef std::set< Url > | url_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. | |
void | setPriority (unsigned newval_r) |
Set repository priority for solver. | |
bool | baseUrlsEmpty () const |
whether repository urls are available | |
bool | baseUrlSet () const |
whether there are manualy configured repository urls | |
urls_size_type | baseUrlsSize () const |
number of repository urls | |
urls_const_iterator | baseUrlsBegin () const |
iterator that points at begin of repository urls | |
urls_const_iterator | baseUrlsEnd () const |
iterator that points at end of repository urls | |
Url | url () const |
Pars pro toto: The first repository url. | |
std::set< Url > | baseUrls () const |
A Url under which the metadata are located, or a set of mirrors. | |
void | addBaseUrl (const Url &url) |
Add a base url. | |
void | setBaseUrl (const Url &url) |
Clears current base URL list and adds url. | |
Pathname | path () const |
Repository path. | |
void | setPath (const Pathname &path) |
set the product path. | |
Url | mirrorListUrl () const |
Url of a file which contains a list of Urls If empty, the base url will be used. | |
void | setMirrorListUrl (const Url &url) |
Set mirror list url. | |
repo::RepoType | type () const |
Type of repository,. | |
void | setProbedType (const repo::RepoType &t) const |
This allows to adjust the RepoType lazy, from NONE to some probed value, even for const objects. | |
void | setType (const repo::RepoType &t) |
set the repository type | |
Pathname | metadataPath () const |
Path where this repo metadata was read from. | |
void | setMetadataPath (const Pathname &path) |
set the path where the local metadata is stored | |
Pathname | packagesPath () const |
Path where this repo packages are cached. | |
void | setPackagesPath (const Pathname &path) |
set the path where the local packages are stored | |
bool | gpgCheck () const |
Whether to check or not this repository with gpg. | |
void | setGpgCheck (bool check) |
Whether to check or not this repository with gpg. | |
Url | gpgKeyUrl () const |
Key to use for gpg checking of this repository. | |
void | setGpgKeyUrl (const Url &gpgkey) |
Key to use for gpg checking of this repository. | |
bool | keepPackages () const |
Whether to keep the packages downloaded from this repository will be kept in local cache. | |
void | setKeepPackages (bool keep) |
Set if the packaqes downloaded from this repository will be kept in local cache. | |
std::string | service () const |
Gets name of the service to which this repository belongs or empty string if it has been added manually. | |
void | setService (const std::string &name) |
sets service which added this repository | |
std::string | targetDistribution () const |
Distribution for which is this repository meant. | |
void | setTargetDistribution (const std::string &targetDistribution) |
Sets the distribution for which is this repository meant. | |
virtual std::ostream & | dumpOn (std::ostream &str) const |
Write a human-readable representation of this RepoInfo object into the str stream. | |
virtual std::ostream & | dumpAsIniOn (std::ostream &str) const |
Write this RepoInfo object into str in a .repo file format. | |
virtual std::ostream & | dumpAsXMLOn (std::ostream &str) const |
Write an XML representation of this RepoInfo object. | |
virtual std::ostream & | dumpAsXMLOn (std::ostream &str, const std::string &content) const |
Write an XML representation of this RepoInfo object. | |
Repository license | |
bool | hasLicense () const |
Whether there is a license associated with the repo. | |
std::string | getLicense (const Locale &lang_r=Locale()) |
Return the best license for the current (or a specified) locale. | |
LocaleSet | getLicenseLocales () const |
Return the locales the license is available for. | |
Static Public Member Functions | |
static unsigned | defaultPriority () |
The default priority (99 ). | |
Static Public Attributes | |
static const RepoInfo | noRepo |
Represents no Repository (one with an empty alias). | |
Private Attributes | |
RWCOW_pointer< Impl > | _pimpl |
Pointer to implementation. | |
Friends | |
std::ostream & | operator<< (std::ostream &str, const RepoInfo &obj) |
Related Functions | |
(Note that these are not member functions.) | |
typedef shared_ptr< RepoInfo > | RepoInfo_Ptr |
typedef shared_ptr< const RepoInfo > | RepoInfo_constPtr |
typedef std::list< RepoInfo > | RepoInfoList |
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/ gpgcheck=1 gpgkey=http://software.opensuse.org/openSUSE-Build-Service.asc enabled=1 priority=10
Definition at line 66 of file RepoInfo.h.
typedef std::set<Url> zypp::RepoInfo::url_set |
Definition at line 94 of file RepoInfo.h.
typedef url_set::size_type zypp::RepoInfo::urls_size_type |
Definition at line 95 of file RepoInfo.h.
typedef transform_iterator<repo::RepoVariablesUrlReplacer, url_set::const_iterator> zypp::RepoInfo::urls_const_iterator |
Definition at line 96 of file RepoInfo.h.
zypp::RepoInfo::RepoInfo | ( | ) |
Definition at line 165 of file RepoInfo.cc.
zypp::RepoInfo::~RepoInfo | ( | ) | [virtual] |
Definition at line 174 of file RepoInfo.cc.
unsigned zypp::RepoInfo::defaultPriority | ( | ) | [static] |
The default priority (99
).
Definition at line 181 of file RepoInfo.cc.
References zypp::RepoInfo::Impl::defaultPriority.
Referenced by dumpAsIniOn().
unsigned zypp::RepoInfo::priority | ( | ) | const |
Repository priority for solver.
Some number between 1
(highest priority) and 99
(defaultPriority).
Definition at line 179 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpAsIniOn(), dumpOn(), zypp::solver::detail::HelixControl::HelixControl(), and zypp::sat::detail::PoolImpl::setRepoInfo().
void zypp::RepoInfo::setPriority | ( | unsigned | newval_r | ) |
Set repository priority for solver.
A newval_r
of 0
sets the default priority.
Definition at line 183 of file RepoInfo.cc.
References _pimpl, and zypp::RepoInfo::Impl::defaultPriority.
Referenced by zypp::parser::RepoindexFileReader::Impl::consumeNode(), and zypp::parser::repositories_in_stream().
bool zypp::RepoInfo::baseUrlsEmpty | ( | ) | const |
whether repository urls are available
Definition at line 312 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::assert_urls(), zypp::repo::PackageProvider::doProvidePackage(), zypp::repo::RepoMediaAccess::provideFile(), zypp::repo::PackageProvider::providePackage(), and url().
bool zypp::RepoInfo::baseUrlSet | ( | ) | const |
whether there are manualy configured repository urls
Definition at line 315 of file RepoInfo.cc.
References _pimpl.
RepoInfo::urls_size_type zypp::RepoInfo::baseUrlsSize | ( | ) | const |
number of repository urls
Definition at line 309 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository().
RepoInfo::urls_const_iterator zypp::RepoInfo::baseUrlsBegin | ( | ) | const |
iterator that points at begin of repository urls
Definition at line 295 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository(), zypp::HistoryLog::addRepository(), zypp::RepoManager::buildCache(), zypp::repo::PackageProvider::doProvidePackage(), dumpAsXMLOn(), dumpOn(), zypp::solver::detail::HelixControl::HelixControl(), zypp::HistoryLog::modifyRepository(), zypp::repo::RepoMediaAccess::provideFile(), zypp::repo::PackageProvider::providePackage(), zypp::RepoManager::refreshMetadata(), and url().
RepoInfo::urls_const_iterator zypp::RepoInfo::baseUrlsEnd | ( | ) | const |
iterator that points at end of repository urls
Definition at line 302 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository(), dumpAsXMLOn(), dumpOn(), zypp::solver::detail::HelixControl::HelixControl(), zypp::repo::RepoMediaAccess::provideFile(), and zypp::RepoManager::refreshMetadata().
Url zypp::RepoInfo::url | ( | ) | const [inline] |
Pars pro toto: The first repository url.
Definition at line 120 of file RepoInfo.h.
References baseUrlsBegin(), and baseUrlsEmpty().
Referenced by zypp::misc::defaultLoadSystem(), zypp::repo::RepoException::dumpOn(), setGpgKeyUrl(), setMirrorListUrl(), and zypp::sat::detail::PoolImpl::setRepoInfo().
std::set< Url > zypp::RepoInfo::baseUrls | ( | ) | const |
A Url under which the metadata are located, or a set of mirrors.
This can't be empty in order the repository to be valid unless the download of the mirror list succeeds and it contains a valid url.
Definition at line 274 of file RepoInfo.cc.
References _pimpl.
void zypp::RepoInfo::addBaseUrl | ( | const Url & | url | ) |
Add a base url.
url | The base url for the repository. |
To recreate the base URLs list, use setBaseUrl(const Url &) followed by addBaseUrl().
Definition at line 203 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_stream(), and setBaseUrl().
void zypp::RepoInfo::setBaseUrl | ( | const Url & | url | ) |
Clears current base URL list and adds url.
Definition at line 208 of file RepoInfo.cc.
References _pimpl, and addBaseUrl().
Referenced by zypp::parser::RepoindexFileReader::Impl::consumeNode(), and zypp::RepoManager::getRepositoryInfo().
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 /
.
Definition at line 286 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository(), zypp::RepoManager::buildCache(), zypp::RepoManager::checkIfToRefreshMetadata(), zypp::repo::yum::Downloader::download(), zypp::repo::susetags::Downloader::download(), dumpAsIniOn(), dumpOn(), zypp::solver::detail::HelixControl::HelixControl(), zypp::rawproductdata_path_for_repoinfo(), zypp::RepoManager::refreshMetadata(), setMetadataPath(), setPackagesPath(), and setPath().
void zypp::RepoInfo::setPath | ( | const Pathname & | path | ) |
set the product path.
path | the path to the product |
Definition at line 214 of file RepoInfo.cc.
References _pimpl, and path().
Referenced by zypp::parser::RepoindexFileReader::Impl::consumeNode(), and zypp::parser::repositories_in_stream().
Url zypp::RepoInfo::mirrorListUrl | ( | ) | const |
Url of a file which contains a list of Urls If empty, the base url will be used.
Definition at line 266 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpAsXMLOn().
void zypp::RepoInfo::setMirrorListUrl | ( | const Url & | url | ) |
Set mirror list url.
url | The base url for the list |
Definition at line 193 of file RepoInfo.cc.
Referenced by zypp::parser::repositories_in_stream().
repo::RepoType zypp::RepoInfo::type | ( | ) | const |
Type of repository,.
Definition at line 263 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::buildCache(), zypp::RepoManager::checkIfToRefreshMetadata(), zypp::misc::defaultLoadSystem(), dumpAsIniOn(), dumpAsXMLOn(), dumpOn(), zypp::solver::detail::HelixControl::HelixControl(), zypp::RepoManager::metadataStatus(), zypp::RepoManager::refreshMetadata(), and zypp::RepoManager::touchIndexFile().
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 224 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::sat::Solvable::lookupLocation(), and zypp::RepoManager::refreshMetadata().
void zypp::RepoInfo::setType | ( | const repo::RepoType & | t | ) |
set the repository type
t |
Definition at line 219 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository(), zypp::parser::RepoindexFileReader::Impl::consumeNode(), zypp::RepoManager::refreshMetadata(), and zypp::parser::repositories_in_stream().
Pathname zypp::RepoInfo::metadataPath | ( | ) | const |
Path where this repo metadata was read from.
Definition at line 257 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpOn(), and zypp::repo::RepoMediaAccess::Impl::setVerifierForRepo().
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.
path | directory path |
Definition at line 228 of file RepoInfo.cc.
References _pimpl, and path().
Referenced by zypp::RepoManager::addRepository().
Pathname zypp::RepoInfo::packagesPath | ( | ) | const |
Path where this repo packages are cached.
Definition at line 260 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpOn(), zypp::repo::RepoMediaAccess::provideFile(), and zypp::repo::PackageProvider::providePackage().
void zypp::RepoInfo::setPackagesPath | ( | const Pathname & | path | ) |
set the path where the local packages are stored
path | directory path |
Definition at line 233 of file RepoInfo.cc.
References _pimpl, and path().
Referenced by zypp::RepoManager::addRepository().
bool zypp::RepoInfo::gpgCheck | ( | ) | const |
Whether to check or not this repository with gpg.
Definition at line 254 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::repo::yum::Downloader::download(), dumpAsIniOn(), dumpAsXMLOn(), and dumpOn().
void zypp::RepoInfo::setGpgCheck | ( | bool | check | ) |
Whether to check or not this repository with gpg.
check | true (check) or false (dont'check) |
Definition at line 188 of file RepoInfo.cc.
References _pimpl, and zypp::applydeltarpm::check().
Referenced by zypp::parser::repositories_in_stream().
Url zypp::RepoInfo::gpgKeyUrl | ( | ) | const |
Key to use for gpg checking of this repository.
url | Url to the key in ASCII armored format |
Definition at line 271 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpAsIniOn(), dumpAsXMLOn(), and dumpOn().
void zypp::RepoInfo::setGpgKeyUrl | ( | const Url & | gpgkey | ) |
Key to use for gpg checking of this repository.
url | Url to the key in ASCII armored format |
Definition at line 198 of file RepoInfo.cc.
Referenced by zypp::parser::repositories_in_stream().
bool zypp::RepoInfo::keepPackages | ( | ) | const |
Whether to keep the packages downloaded from this repository will be kept in local cache.
Definition at line 319 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpAsIniOn(), dumpOn(), zypp::repo::RepoMediaAccess::provideFile(), and zypp::repo::PackageProvider::providePackage().
void zypp::RepoInfo::setKeepPackages | ( | bool | keep | ) |
Set if the 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.
keep | true (keep the downloaded packages) or false (delete them after installation) |
Definition at line 238 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_stream().
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 289 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpAsIniOn(), dumpOn(), and zypp::RepoManager::MatchServiceAlias::operator()().
void zypp::RepoInfo::setService | ( | const std::string & | name | ) |
sets service which added this repository
Definition at line 243 of file RepoInfo.cc.
References _pimpl, and zypp::repo::RepoInfoBase::name().
Referenced by zypp::parser::repositories_in_stream().
std::string zypp::RepoInfo::targetDistribution | ( | ) | const |
Distribution for which is this repository meant.
Definition at line 292 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoCollector::collect(), dumpOn(), and setTargetDistribution().
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 248 of file RepoInfo.cc.
References _pimpl, and targetDistribution().
Referenced by zypp::parser::RepoindexFileReader::Impl::consumeNode().
bool zypp::RepoInfo::hasLicense | ( | ) | const |
Whether there is a license associated with the repo.
Definition at line 326 of file RepoInfo.cc.
Return the best license for the current (or a specified) locale.
Definition at line 335 of file RepoInfo.cc.
References _pimpl, zypp::Locale::bestMatch(), zypp::ExternalProgram::close(), zypp::Locale::code(), zypp::ExternalProgram::Discard_Stderr, zypp::str::form(), getLicenseLocales(), zypp::Locale::noCode, zypp::externalprogram::ExternalDataSource::receiveLine(), and WAR.
Referenced by zypp::ResObject::licenseToConfirm().
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 377 of file RepoInfo.cc.
References _pimpl, zypp::ExternalProgram::close(), zypp::str::hasPrefix(), zypp::str::hasSuffix(), zypp::externalprogram::ExternalDataSource::receiveLine(), zypp::C_Str::size(), zypp::ExternalProgram::Stderr_To_Stdout, and WAR.
Referenced by getLicense().
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 414 of file RepoInfo.cc.
References _pimpl, baseUrlsBegin(), baseUrlsEnd(), gpgCheck(), gpgKeyUrl(), keepPackages(), metadataPath(), packagesPath(), path(), priority(), service(), targetDistribution(), and type().
Referenced by zypp::operator<<().
std::ostream & zypp::RepoInfo::dumpAsIniOn | ( | std::ostream & | str | ) | const [virtual] |
Write this RepoInfo object into str in a .repo file format.
Reimplemented from zypp::repo::RepoInfoBase.
Definition at line 454 of file RepoInfo.cc.
References _pimpl, zypp::str::asString(), zypp::repo::RepoType::asString(), defaultPriority(), gpgCheck(), gpgKeyUrl(), keepPackages(), path(), priority(), service(), and type().
Referenced by zypp::RepoManager::addRepository(), and zypp::RepoManager::modifyRepository().
std::ostream & zypp::RepoInfo::dumpAsXMLOn | ( | std::ostream & | str | ) | const [virtual] |
Write an XML representation of this RepoInfo object.
Reimplemented from zypp::repo::RepoInfoBase.
Definition at line 494 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.
str | |
content | this argument is ignored (used in other classed derived from RepoInfoBase. |
Reimplemented from zypp::repo::RepoInfoBase.
Definition at line 497 of file RepoInfo.cc.
References _pimpl, zypp::repo::RepoInfoBase::alias(), zypp::str::asString(), zypp::repo::RepoType::asString(), zypp::repo::RepoInfoBase::autorefresh(), baseUrlsBegin(), baseUrlsEnd(), zypp::repo::RepoInfoBase::enabled(), zypp::str::escape(), gpgCheck(), gpgKeyUrl(), mirrorListUrl(), zypp::repo::RepoInfoBase::name(), zypp::repo::RepoType::NONE, and type().
typedef shared_ptr<RepoInfo> RepoInfo_Ptr [related] |
Definition at line 365 of file RepoInfo.h.
typedef shared_ptr<const RepoInfo> RepoInfo_constPtr [related] |
Definition at line 367 of file RepoInfo.h.
typedef std::list<RepoInfo> RepoInfoList [related] |
Definition at line 369 of file RepoInfo.h.
std::ostream & operator<< | ( | std::ostream & | str, |
const RepoInfo & | obj | ||
) | [friend] |
Stream output
Definition at line 528 of file RepoInfo.cc.
const RepoInfo zypp::RepoInfo::noRepo [static] |
Represents no Repository (one with an empty alias).
Definition at line 75 of file RepoInfo.h.
Referenced by zypp::RepoManager::getRepo().
RWCOW_pointer<Impl> zypp::RepoInfo::_pimpl [private] |
Pointer to implementation.
Reimplemented from zypp::repo::RepoInfoBase.
Definition at line 357 of file RepoInfo.h.
Referenced by addBaseUrl(), baseUrls(), baseUrlsBegin(), baseUrlsEmpty(), baseUrlsEnd(), baseUrlSet(), baseUrlsSize(), dumpAsIniOn(), dumpAsXMLOn(), dumpOn(), getLicense(), getLicenseLocales(), gpgCheck(), gpgKeyUrl(), hasLicense(), keepPackages(), metadataPath(), mirrorListUrl(), packagesPath(), path(), priority(), service(), setBaseUrl(), setGpgCheck(), setGpgKeyUrl(), setKeepPackages(), setMetadataPath(), setMirrorListUrl(), setPackagesPath(), setPath(), setPriority(), setProbedType(), setService(), setTargetDistribution(), setType(), targetDistribution(), and type().