From 4a17862a159a85256d2f0ec74938562b10c924e5 Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Thu, 11 Sep 2008 23:38:07 +0000 Subject: [PATCH] - s/Catalog/Repo/g - s/catalog/Repo/g --- zypp/ServiceInfo.cc | 72 ++++++++++++++++++++-------------------- zypp/ServiceInfo.h | 60 ++++++++++++++++----------------- zypp/parser/ServiceFileReader.cc | 13 ++++++-- 3 files changed, 77 insertions(+), 68 deletions(-) diff --git a/zypp/ServiceInfo.cc b/zypp/ServiceInfo.cc index f30d2b3..3527c53 100644 --- a/zypp/ServiceInfo.cc +++ b/zypp/ServiceInfo.cc @@ -45,14 +45,14 @@ namespace zypp // struct ServiceInfo::Impl : public repo::RepoInfoBase::Impl { - typedef ServiceInfo::CatalogsToEnable CatalogsToEnable; - typedef ServiceInfo::CatalogsToDisable CatalogsToDisable; + typedef ServiceInfo::ReposToEnable ReposToEnable; + typedef ServiceInfo::ReposToDisable ReposToDisable; public: Url url; repo::ServiceType type; - CatalogsToEnable catalogsToEnable; - CatalogsToDisable catalogsToDisable; + ReposToEnable reposToEnable; + ReposToDisable reposToDisable; public: Impl() @@ -121,48 +121,48 @@ namespace zypp void ServiceInfo::setProbedType( const repo::ServiceType &t ) const { _pimpl->setProbedType( t ); } - bool ServiceInfo::catalogsToEnableEmpty() const - { return _pimpl->catalogsToEnable.empty(); } + bool ServiceInfo::reposToEnableEmpty() const + { return _pimpl->reposToEnable.empty(); } - ServiceInfo::CatalogsToEnable::size_type ServiceInfo::catalogsToEnableSize() const - { return _pimpl->catalogsToEnable.size(); } + ServiceInfo::ReposToEnable::size_type ServiceInfo::reposToEnableSize() const + { return _pimpl->reposToEnable.size(); } - ServiceInfo::CatalogsToEnable::const_iterator ServiceInfo::catalogsToEnableBegin() const - { return _pimpl->catalogsToEnable.begin(); } + ServiceInfo::ReposToEnable::const_iterator ServiceInfo::reposToEnableBegin() const + { return _pimpl->reposToEnable.begin(); } - ServiceInfo::CatalogsToEnable::const_iterator ServiceInfo::catalogsToEnableEnd() const - { return _pimpl->catalogsToEnable.end(); } + ServiceInfo::ReposToEnable::const_iterator ServiceInfo::reposToEnableEnd() const + { return _pimpl->reposToEnable.end(); } - bool ServiceInfo::catalogToEnableFind( const std::string & alias_r ) const - { return( _pimpl->catalogsToEnable.find( alias_r ) != _pimpl->catalogsToEnable.end() ); } + bool ServiceInfo::repoToEnableFind( const std::string & alias_r ) const + { return( _pimpl->reposToEnable.find( alias_r ) != _pimpl->reposToEnable.end() ); } - void ServiceInfo::addCatalogToEnable( const std::string & alias_r ) - { _pimpl->catalogsToEnable.insert( alias_r ); } + void ServiceInfo::addRepoToEnable( const std::string & alias_r ) + { _pimpl->reposToEnable.insert( alias_r ); } - void ServiceInfo::delCatalogToEnable( const std::string & alias_r ) - { _pimpl->catalogsToEnable.erase( alias_r ); } + void ServiceInfo::delRepoToEnable( const std::string & alias_r ) + { _pimpl->reposToEnable.erase( alias_r ); } - bool ServiceInfo::catalogsToDisableEmpty() const - { return _pimpl->catalogsToDisable.empty(); } + bool ServiceInfo::reposToDisableEmpty() const + { return _pimpl->reposToDisable.empty(); } - ServiceInfo::CatalogsToDisable::size_type ServiceInfo::catalogsToDisableSize() const - { return _pimpl->catalogsToDisable.size(); } + ServiceInfo::ReposToDisable::size_type ServiceInfo::reposToDisableSize() const + { return _pimpl->reposToDisable.size(); } - ServiceInfo::CatalogsToDisable::const_iterator ServiceInfo::catalogsToDisableBegin() const - { return _pimpl->catalogsToDisable.begin(); } + ServiceInfo::ReposToDisable::const_iterator ServiceInfo::reposToDisableBegin() const + { return _pimpl->reposToDisable.begin(); } - ServiceInfo::CatalogsToDisable::const_iterator ServiceInfo::catalogsToDisableEnd() const - { return _pimpl->catalogsToDisable.end(); } + ServiceInfo::ReposToDisable::const_iterator ServiceInfo::reposToDisableEnd() const + { return _pimpl->reposToDisable.end(); } - bool ServiceInfo::catalogToDisableFind( const std::string & alias_r ) const - { return( _pimpl->catalogsToDisable.find( alias_r ) != _pimpl->catalogsToDisable.end() ); } + bool ServiceInfo::repoToDisableFind( const std::string & alias_r ) const + { return( _pimpl->reposToDisable.find( alias_r ) != _pimpl->reposToDisable.end() ); } - void ServiceInfo::addCatalogToDisable( const std::string & alias_r ) - { _pimpl->catalogsToDisable.insert( alias_r ); } + void ServiceInfo::addRepoToDisable( const std::string & alias_r ) + { _pimpl->reposToDisable.insert( alias_r ); } - void ServiceInfo::delCatalogToDisable( const std::string & alias_r ) - { _pimpl->catalogsToDisable.erase( alias_r ); } + void ServiceInfo::delRepoToDisable( const std::string & alias_r ) + { _pimpl->reposToDisable.erase( alias_r ); } std::ostream & ServiceInfo::dumpAsIniOn( std::ostream & str ) const @@ -171,10 +171,10 @@ namespace zypp << "url = " << url() << endl << "type = " << type() << endl; - if ( ! catalogsToEnableEmpty() ) - str << "catalogstoenable = " << str::joinEscaped( catalogsToEnableBegin(), catalogsToEnableEnd() ) << endl; - if ( ! catalogsToDisableEmpty() ) - str << "catalogstodisable = " << str::joinEscaped( catalogsToDisableBegin(), catalogsToDisableEnd() ) << endl; + if ( ! reposToEnableEmpty() ) + str << "repostoenable = " << str::joinEscaped( reposToEnableBegin(), reposToEnableEnd() ) << endl; + if ( ! reposToDisableEmpty() ) + str << "repostodisable = " << str::joinEscaped( reposToDisableBegin(), reposToDisableEnd() ) << endl; return str; } diff --git a/zypp/ServiceInfo.h b/zypp/ServiceInfo.h index a366b7f..5a4182b 100644 --- a/zypp/ServiceInfo.h +++ b/zypp/ServiceInfo.h @@ -88,49 +88,49 @@ namespace zypp void setProbedType( const repo::ServiceType & t ) const; - /** \name Set of catalogs (repository aliases) to enable on next refresh. + /** \name Set of repos (repository aliases) to enable on next refresh. * * Per default new repositories are created in disabled state. But repositories * mentioned here will be created in enabled state on the next refresh. * Afterwards they get removed from the list. */ //@{ - /** Container of catalogs. */ - typedef std::set CatalogsToEnable; - bool catalogsToEnableEmpty() const; - CatalogsToEnable::size_type catalogsToEnableSize() const; - CatalogsToEnable::const_iterator catalogsToEnableBegin() const; - CatalogsToEnable::const_iterator catalogsToEnableEnd() const; - - /** Wheter \c alias_r is mentioned in CatalogsToEnable. */ - bool catalogToEnableFind( const std::string & alias_r ) const; - - /** Add \c alias_r to the set of CatalogsToEnable. */ - void addCatalogToEnable( const std::string & alias_r ); - /** Remove \c alias_r to the set of CatalogsToEnable. */ - void delCatalogToEnable( const std::string & alias_r ); + /** Container of repos. */ + typedef std::set ReposToEnable; + bool reposToEnableEmpty() const; + ReposToEnable::size_type reposToEnableSize() const; + ReposToEnable::const_iterator reposToEnableBegin() const; + ReposToEnable::const_iterator reposToEnableEnd() const; + + /** Wheter \c alias_r is mentioned in ReposToEnable. */ + bool repoToEnableFind( const std::string & alias_r ) const; + + /** Add \c alias_r to the set of ReposToEnable. */ + void addRepoToEnable( const std::string & alias_r ); + /** Remove \c alias_r to the set of ReposToEnable. */ + void delRepoToEnable( const std::string & alias_r ); //@} - /** \name Set of catalogs (repository aliases) to disable on next refresh. + /** \name Set of repos (repository aliases) to disable on next refresh. * * Repositories mentioned here will be disabled on the next refresh, in case they * still exist. Afterwards they get removed from the list. */ //@{ - /** Container of catalogs. */ - typedef std::set CatalogsToDisable; - bool catalogsToDisableEmpty() const; - CatalogsToDisable::size_type catalogsToDisableSize() const; - CatalogsToDisable::const_iterator catalogsToDisableBegin() const; - CatalogsToDisable::const_iterator catalogsToDisableEnd() const; - - /** Wheter \c alias_r is mentioned in CatalogsToDisable. */ - bool catalogToDisableFind( const std::string & alias_r ) const; - - /** Add \c alias_r to the set of CatalogsToDisable. */ - void addCatalogToDisable( const std::string & alias_r ); - /** Remove \c alias_r to the set of CatalogsToDisable. */ - void delCatalogToDisable( const std::string & alias_r ); + /** Container of repos. */ + typedef std::set ReposToDisable; + bool reposToDisableEmpty() const; + ReposToDisable::size_type reposToDisableSize() const; + ReposToDisable::const_iterator reposToDisableBegin() const; + ReposToDisable::const_iterator reposToDisableEnd() const; + + /** Wheter \c alias_r is mentioned in ReposToDisable. */ + bool repoToDisableFind( const std::string & alias_r ) const; + + /** Add \c alias_r to the set of ReposToDisable. */ + void addRepoToDisable( const std::string & alias_r ); + /** Remove \c alias_r to the set of ReposToDisable. */ + void delRepoToDisable( const std::string & alias_r ); //@} public: diff --git a/zypp/parser/ServiceFileReader.cc b/zypp/parser/ServiceFileReader.cc index e9c2ac3..3730449 100644 --- a/zypp/parser/ServiceFileReader.cc +++ b/zypp/parser/ServiceFileReader.cc @@ -70,13 +70,22 @@ namespace zypp service.setAutorefresh( str::strToTrue( it->second ) ); else if ( it->first == "type" ) service.setType( repo::ServiceType(it->second) ); - else if ( it->first == "catalogstoenable" ) + else if ( it->first == "repostoenable" ) { std::vector aliases; str::splitEscaped( it->second, std::back_inserter(aliases) ); for_( ait, aliases.begin(), aliases.end() ) { - service.addCatalogToEnable( *ait ); + service.addRepoToEnable( *ait ); + } + } + else if ( it->first == "repostodisable" ) + { + std::vector aliases; + str::splitEscaped( it->second, std::back_inserter(aliases) ); + for_( ait, aliases.begin(), aliases.end() ) + { + service.addRepoToDisable( *ait ); } } else -- 2.7.4