#include <RepoInfo.h>
Public Types | |
| typedef unsigned long | NumericId |
| 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 () | |
| ~RepoInfo () | |
| std::string | alias () const |
| unique identifier for this source. | |
| ZYPP_DEPRECATED std::set< Url > | baseUrls () const |
| A Url under which the metadata are located, or a set of mirrors. | |
| Pathname | path () const |
| Url | mirrorListUrl () const |
| Url of a file which contains a list of Urls If empty, the base url will be used. | |
| 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 | |
| urls_size_type | baseUrlsSize () const |
| number of repository urls | |
| bool | baseUrlsEmpty () const |
| whether repository urls are available | |
| bool | enabled () const |
| If enabled is false, then this repository must be ignored as if does not exists, except when checking for duplicate alias. | |
| bool | autorefresh () const |
| If true, the repostory must be refreshed before creating resolvables from it. | |
| repo::RepoType | type () const |
| Type of repository,. | |
| std::string | name () const |
| Pathname | filepath () const |
| Pathname | metadataPath () const |
| bool | gpgCheck () const |
| Url | gpgKeyUrl () const |
| RepoInfo & | addBaseUrl (const Url &url) |
| Add a base url. | |
| RepoInfo & | setBaseUrl (const Url &url) |
| Clears current base URL list and adds url. | |
| RepoInfo & | setPath (const Pathname &path) |
| set the product path. | |
| RepoInfo & | setMirrorListUrl (const Url &url) |
| Set mirror list url. | |
| RepoInfo & | setEnabled (bool enabled) |
| enable or disable the repository | |
| RepoInfo & | setAutorefresh (bool autorefresh) |
| enable or disable autorefresh | |
| RepoInfo & | setAlias (const std::string &alias) |
| set the repository alias | |
| RepoInfo & | setType (const repo::RepoType &t) |
| set the repository type | |
| RepoInfo & | setName (const std::string &name) |
| set the repository name | |
| RepoInfo & | setFilepath (const Pathname &filename) |
| RepoInfo & | setMetadataPath (const Pathname &path) |
| RepoInfo & | setGpgCheck (bool check) |
| RepoInfo & | setGpgKeyUrl (const Url &gpgkey) |
| std::ostream & | dumpOn (std::ostream &str) const |
| Write a human-readable representation of this RepoInfo object into the str stream. | |
| std::ostream & | dumpRepoOn (std::ostream &str) const |
| Write this RepoInfo object into str in a
.repo file format. | |
Private Attributes | |
| RWCOW_pointer< Impl > | _pimpl |
| Pointer to implementation. | |
Friends | |
| std::ostream & | operator<< (std::ostream &str, const RepoInfo &obj) |
| Stream output. | |
Classes | |
| struct | Impl |
| RepoInfo implementation. More... | |
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
Definition at line 64 of file RepoInfo.h.
| typedef unsigned long zypp::RepoInfo::NumericId |
Definition at line 72 of file RepoInfo.h.
| typedef std::set<Url> zypp::RepoInfo::url_set |
Definition at line 120 of file RepoInfo.h.
| typedef url_set::size_type zypp::RepoInfo::urls_size_type |
Definition at line 122 of file RepoInfo.h.
| typedef transform_iterator<repo::RepoVariablesUrlReplacer, url_set::const_iterator> zypp::RepoInfo::urls_const_iterator |
Definition at line 123 of file RepoInfo.h.
| zypp::RepoInfo::RepoInfo | ( | ) |
Definition at line 83 of file RepoInfo.cc.
| zypp::RepoInfo::~RepoInfo | ( | ) |
Definition at line 92 of file RepoInfo.cc.
| std::string zypp::RepoInfo::alias | ( | ) | const |
unique identifier for this source.
If not specified It should be generated from the base url.
Normally, in a .repo file the section name is used ( [somerepo] )
Definition at line 185 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository(), zypp::assert_alias(), zypp::RepoManager::buildCache(), zypp::RepoManager::cacheStatus(), zypp::RepoManager::checkIfToRefreshMetadata(), zypp::cleanCacheInternal(), zypp::RepoManager::createFromCache(), dumpOn(), dumpRepoOn(), zypp::generate_filename(), zypp::RepoManager::getRepositoryInfo(), zypp::RepoManager::isCached(), zypp::RepoManager::modifyRepository(), name(), zypp::operator<(), zypp::target::operator<<(), zypp::operator<<(), zypp::operator==(), zypp::repo::RepoMediaAccess::provideFile(), zypp::rawcache_path_for_repoinfo(), zypp::RepoManager::removeRepository(), zypp::repo::RepoMediaAccess::Impl::setVerifierForRepo(), zypp::solver::detail::ResolverInfo::toString(), and zypp::repo::cached::RepoImpl::~RepoImpl().
| 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 214 of file RepoInfo.cc.
References _pimpl.
| Pathname zypp::RepoInfo::path | ( | ) | const |
Repository path Pathname relative to the base Url where the product/repository is located For medias containing more than one product, or repositories not located at the root of the media it is important to know the path of the media root relative to the product directory so a media verifier can be set for that media.
It is not mandatory, and the default is /
Definition at line 229 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::checkIfToRefreshMetadata(), dumpOn(), dumpRepoOn(), and zypp::RepoManager::refreshMetadata().
| Url zypp::RepoInfo::mirrorListUrl | ( | ) | const |
| RepoInfo::urls_const_iterator zypp::RepoInfo::baseUrlsBegin | ( | ) | const |
iterator that points at begin of repository urls
Definition at line 232 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository(), zypp::repo::PackageProvider::doProvidePackage(), dumpOn(), zypp::repo::RepoMediaAccess::provideFile(), zypp::repo::PackageProvider::providePackage(), and zypp::RepoManager::refreshMetadata().
| RepoInfo::urls_const_iterator zypp::RepoInfo::baseUrlsEnd | ( | ) | const |
iterator that points at end of repository urls
Definition at line 239 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpOn(), zypp::repo::RepoMediaAccess::provideFile(), and zypp::RepoManager::refreshMetadata().
| RepoInfo::urls_size_type zypp::RepoInfo::baseUrlsSize | ( | ) | const |
number of repository urls
Definition at line 246 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository().
| bool zypp::RepoInfo::baseUrlsEmpty | ( | ) | const |
whether repository urls are available
Definition at line 249 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::assert_urls(), zypp::repo::PackageProvider::doProvidePackage(), zypp::repo::RepoMediaAccess::provideFile(), and zypp::repo::PackageProvider::providePackage().
| bool zypp::RepoInfo::enabled | ( | ) | const |
If enabled is false, then this repository must be ignored as if does not exists, except when checking for duplicate alias.
Definition at line 176 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository(), dumpOn(), and dumpRepoOn().
| bool zypp::RepoInfo::autorefresh | ( | ) | const |
If true, the repostory must be refreshed before creating resolvables from it.
Definition at line 179 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpOn(), and dumpRepoOn().
| repo::RepoType zypp::RepoInfo::type | ( | ) | const |
Type of repository,.
Definition at line 205 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository(), zypp::RepoManager::buildCache(), zypp::RepoManager::checkIfToRefreshMetadata(), dumpOn(), dumpRepoOn(), zypp::RepoManager::metadataStatus(), zypp::RepoManager::refreshMetadata(), and zypp::RepoManager::touchIndexFile().
| std::string zypp::RepoInfo::name | ( | ) | const |
Repository short label Short label or description of the repository, to be used on the user interface. ie: "SUSE Linux 10.2 updates"
Definition at line 188 of file RepoInfo.cc.
References _pimpl, and alias().
Referenced by zypp::RepoManager::addRepository(), zypp::RepoManager::buildCache(), zypp::cleanCacheInternal(), zypp::RepoManager::createFromCache(), and zypp::RepoManager::removeRepository().
| Pathname zypp::RepoInfo::filepath | ( | ) | const |
File where this repo was read from
Definition at line 199 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::modifyRepository(), and zypp::RepoManager::removeRepository().
| Pathname zypp::RepoInfo::metadataPath | ( | ) | const |
Path where this repo metadata was read from
Definition at line 202 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::repo::RepoMediaAccess::Impl::setVerifierForRepo().
| bool zypp::RepoInfo::gpgCheck | ( | ) | const |
Whether to check or not this repository with gpg
Definition at line 182 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpOn(), and dumpRepoOn().
| Url zypp::RepoInfo::gpgKeyUrl | ( | ) | const |
Key to use for gpg checking of this repository
Definition at line 211 of file RepoInfo.cc.
References _pimpl.
Referenced by dumpOn(), and dumpRepoOn().
Definition at line 127 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_file(), and setBaseUrl().
Clears current base URL list and adds url.
Definition at line 133 of file RepoInfo.cc.
References _pimpl, and addBaseUrl().
Referenced by zypp::RepoManager::getRepositoryInfo().
| RepoInfo & zypp::RepoInfo::setPath | ( | const Pathname & | path | ) |
set the product path.
| path | the path to the product |
Definition at line 140 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_file().
Set mirror list url.
Definition at line 115 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_file().
| RepoInfo & zypp::RepoInfo::setEnabled | ( | bool | enabled | ) |
enable or disable the repository
| enabled |
Definition at line 97 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_file().
| RepoInfo & zypp::RepoInfo::setAutorefresh | ( | bool | autorefresh | ) |
enable or disable autorefresh
| enabled |
Definition at line 103 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_file().
| RepoInfo & zypp::RepoInfo::setAlias | ( | const std::string & | alias | ) |
set the repository alias
| alias |
Definition at line 146 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::getRepositoryInfo(), and zypp::parser::repositories_in_file().
| RepoInfo & zypp::RepoInfo::setType | ( | const repo::RepoType & | t | ) |
set the repository type
| t |
Definition at line 152 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::RepoManager::addRepository(), and zypp::parser::repositories_in_file().
| RepoInfo & zypp::RepoInfo::setName | ( | const std::string & | name | ) |
set the repository name
| name |
Definition at line 158 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_file().
| RepoInfo & zypp::RepoInfo::setFilepath | ( | const Pathname & | filename | ) |
set the path to the .repo file The path to the .repo file where this repository was defined, or empty if nowhere.
| path | File path |
Definition at line 164 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_file().
| RepoInfo & 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 170 of file RepoInfo.cc.
References _pimpl.
| RepoInfo & zypp::RepoInfo::setGpgCheck | ( | bool | check | ) |
Whether to check or not this repository with gpg
| check | true (check) or false (dont'check) |
Definition at line 109 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_file().
Key to use for gpg checking of this repository
Definition at line 121 of file RepoInfo.cc.
References _pimpl.
Referenced by zypp::parser::repositories_in_file().
| std::ostream & zypp::RepoInfo::dumpOn | ( | std::ostream & | str | ) | const |
Write a human-readable representation of this RepoInfo object into the str stream.
Useful for logging.
Definition at line 252 of file RepoInfo.cc.
References alias(), autorefresh(), baseUrlsBegin(), baseUrlsEnd(), enabled(), gpgCheck(), gpgKeyUrl(), path(), and type().
Referenced by zypp::operator<<().
| std::ostream & zypp::RepoInfo::dumpRepoOn | ( | std::ostream & | str | ) | const |
Write this RepoInfo object into str in a
.repo file format.
Definition at line 273 of file RepoInfo.cc.
References _pimpl, alias(), zypp::ui::asString(), zypp::repo::RepoType::asString(), autorefresh(), enabled(), gpgCheck(), gpgKeyUrl(), path(), and type().
Referenced by zypp::RepoManager::addRepository(), and zypp::RepoManager::modifyRepository().
| std::ostream & operator<< | ( | std::ostream & | str, | |
| const RepoInfo & | obj | |||
| ) | [friend] |
RWCOW_pointer<Impl> zypp::RepoInfo::_pimpl [private] |
Pointer to implementation.
Definition at line 317 of file RepoInfo.h.
Referenced by addBaseUrl(), alias(), autorefresh(), baseUrls(), baseUrlsBegin(), baseUrlsEmpty(), baseUrlsEnd(), baseUrlsSize(), dumpRepoOn(), enabled(), filepath(), gpgCheck(), gpgKeyUrl(), metadataPath(), mirrorListUrl(), name(), path(), setAlias(), setAutorefresh(), setBaseUrl(), setEnabled(), setFilepath(), setGpgCheck(), setGpgKeyUrl(), setMetadataPath(), setMirrorListUrl(), setName(), setPath(), setType(), and type().
1.5.3