From 0a90e41bb6fa1d213f320574969b25a0aff3084e Mon Sep 17 00:00:00 2001 From: Martin Vidner Date: Mon, 11 Jun 2007 14:37:06 +0000 Subject: [PATCH] Improved documentation. Renamed RepoInfo::urls to baseUrls. --- zypp/RepoInfo.cc | 18 +++++++++--------- zypp/RepoInfo.h | 21 ++++++++------------- zypp/RepoManager.cc | 4 ++-- zypp/RepoManager.h | 2 +- zypp/Repository.h | 2 +- 5 files changed, 21 insertions(+), 26 deletions(-) diff --git a/zypp/RepoInfo.cc b/zypp/RepoInfo.cc index 1121c7e..864e239 100644 --- a/zypp/RepoInfo.cc +++ b/zypp/RepoInfo.cc @@ -44,7 +44,7 @@ namespace zypp boost::tribool autorefresh; repo::RepoType type; Url mirrorlist_url; - std::set urls; + std::set baseUrls; std::string alias; std::string name; @@ -111,7 +111,7 @@ namespace zypp RepoInfo & RepoInfo::addBaseUrl( const Url &url ) { - _pimpl->urls.insert(url); + _pimpl->baseUrls.insert(url); return *this; } @@ -151,20 +151,20 @@ namespace zypp Url RepoInfo::mirrorListUrl() const { return _pimpl->mirrorlist_url; } - std::set RepoInfo::urls() const - { return _pimpl->urls; } + std::set RepoInfo::baseUrls() const + { return _pimpl->baseUrls; } - RepoInfo::urls_const_iterator RepoInfo::urlsBegin() const - { return _pimpl->urls.begin(); } + RepoInfo::urls_const_iterator RepoInfo::baseUrlsBegin() const + { return _pimpl->baseUrls.begin(); } - RepoInfo::urls_const_iterator RepoInfo::urlsEnd() const - { return _pimpl->urls.end(); } + RepoInfo::urls_const_iterator RepoInfo::baseUrlsEnd() const + { return _pimpl->baseUrls.end(); } std::ostream & RepoInfo::dumpOn( std::ostream & str ) const { str << "--------------------------------------" << std::endl; str << "- alias : " << alias() << std::endl; - std::set url_set(urls()); + std::set url_set(baseUrls()); for ( std::set::const_iterator it = url_set.begin(); it != url_set.end(); ++it ) diff --git a/zypp/RepoInfo.h b/zypp/RepoInfo.h index a333c9a..3c2d7c9 100644 --- a/zypp/RepoInfo.h +++ b/zypp/RepoInfo.h @@ -43,6 +43,7 @@ namespace zypp * 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 * @@ -56,8 +57,8 @@ namespace zypp * enabled=1 * \endcode * - * \note A Repository info is a hint about how - * to create a repository. + * \note A RepoInfo is a hint about how + * to create a Repository. */ class RepoInfo { @@ -78,37 +79,31 @@ namespace zypp std::string alias() const; /** - * The base Url is the Url of the repository that generates - * the authoritative metadata this repository provides. - * - * For example for the url http://updates.novell.com/10.2 - * the base url is http://updates.novell.com/10.2. - * For the url http://host.com/mirror/update.novell.com/10.2 - * the base url is http://updates.novell.com/10.2 + * 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. */ - std::set urls() const; + std::set baseUrls() const; /** * Url of a file which contains a list of Urls * If empty, the base url will be used. */ - Url mirrorListUrl() const; + Url mirrorListUrl() const; typedef std::set::const_iterator urls_const_iterator; /** * iterator that points at begin of repository urls */ - urls_const_iterator urlsBegin() const; + urls_const_iterator baseUrlsBegin() const; /** * iterator that points at end of repository urls */ - urls_const_iterator urlsEnd() const; + urls_const_iterator baseUrlsEnd() const; /** * If enabled is false, then this repository must be ignored as if does diff --git a/zypp/RepoManager.cc b/zypp/RepoManager.cc index b3b1a79..42edaca 100644 --- a/zypp/RepoManager.cc +++ b/zypp/RepoManager.cc @@ -127,7 +127,7 @@ namespace zypp static void assert_urls( const RepoInfo &info ) { - if (info.urls().empty()) + if (info.baseUrls().empty()) ZYPP_THROW(RepoNoUrlException()); } @@ -220,7 +220,7 @@ namespace zypp assert_urls(info); // try urls one by one - for ( RepoInfo::urls_const_iterator it = info.urlsBegin(); it != info.urlsEnd(); ++it ) + for ( RepoInfo::urls_const_iterator it = info.baseUrlsBegin(); it != info.baseUrlsEnd(); ++it ) { Url url(*it); filesystem::TmpDir tmpdir; diff --git a/zypp/RepoManager.h b/zypp/RepoManager.h index fb00242..4e71518 100644 --- a/zypp/RepoManager.h +++ b/zypp/RepoManager.h @@ -70,7 +70,7 @@ namespace zypp std::list knownRepositories() const; /** - * \short Refresh local cache + * \short Refresh local raw cache * * Will try to download the metadata * diff --git a/zypp/Repository.h b/zypp/Repository.h index c9b1a13..b596c2a 100644 --- a/zypp/Repository.h +++ b/zypp/Repository.h @@ -31,7 +31,7 @@ namespace zypp public: /** Default ctor: noRepository. - * Real Repositorys are to be created via RepositoryFactory. + * \see RepoManager::createFromCache. */ Repository(); -- 2.7.4