Author: mlandres Date: Tue Sep 9 13:05:48 2008 New Revision: 10970 URL: http://svn.opensuse.org/viewcvs/zypp?rev=10970&view=rev Log: - Add ServiceInfo interface to define a set of catalogs (repository aliases) to be enabled on next refresh. Modified: trunk/libzypp/devel/devel.ma/NewPool.cc trunk/libzypp/package/libzypp.changes trunk/libzypp/zypp/ServiceInfo.cc trunk/libzypp/zypp/ServiceInfo.h Modified: trunk/libzypp/devel/devel.ma/NewPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=10970&r1=10969&r2=10970&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/NewPool.cc (original) +++ trunk/libzypp/devel/devel.ma/NewPool.cc Tue Sep 9 13:05:48 2008 @@ -445,11 +445,6 @@ ResPool pool( ResPool::instance() ); sat::Pool satpool( sat::Pool::instance() ); - Edition e("1.a"); - DBG << e.copmpare( Edition("1a") ) << endl; - DBG << e.copmpare( Edition("1=a") ) << endl; - DBG << e.copmpare( Edition("1#$%^&*()_a") ) << endl; -return 0; if ( 1 ) { Measure x( "INIT TARGET" ); Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=10970&r1=10969&r2=10970&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Tue Sep 9 13:05:48 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Tue Sep 9 13:04:11 CEST 2008 - ma@suse.de + +- Add ServiceInfo interface to define a set of catalogs (repository + aliases) to be enabled on next refresh. +- revision 10970 + +------------------------------------------------------------------- Tue Sep 9 11:40:42 CEST 2008 - ma@suse.de - Fix reading of Traget::targetDistribution. Modified: trunk/libzypp/zypp/ServiceInfo.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ServiceInfo.cc?rev=10970&r1=10969&r2=10970&view=diff ============================================================================== --- trunk/libzypp/zypp/ServiceInfo.cc (original) +++ trunk/libzypp/zypp/ServiceInfo.cc Tue Sep 9 13:05:48 2008 @@ -24,7 +24,7 @@ using zypp::xml::escape; /////////////////////////////////////////////////////////////////////////////// -namespace zypp +namespace zypp {////////////////////////////////////////////////////////////////////////////// @@ -44,8 +44,11 @@ // struct ServiceInfo::Impl : public repo::RepoInfoBase::Impl { + typedef ServiceInfo::CatalogsToEnable CatalogsToEnable; + public: Url url; + CatalogsToEnable catalogsToEnable; public: Impl() : repo::RepoInfoBase::Impl() {} @@ -69,7 +72,7 @@ /////////////////////////////////////////////////////////////////// const ServiceInfo ServiceInfo::noService; - + ServiceInfo::ServiceInfo() : _pimpl( new Impl() ) {} ServiceInfo::ServiceInfo(const string & alias) @@ -84,9 +87,32 @@ void ServiceInfo::setUrl( const Url& url ) { _pimpl->url = url; } + bool catalogsToEnableEmpty() const + { return _pimpl->catalogsToEnable.empty(); } + + CatalogsToEnable::size_type catalogsToEnableSize() const + { return _pimpl->catalogsToEnable.size(); } + + CatalogsToEnable::const_iterator catalogsToEnableBegin() const + { return _pimpl->catalogsToEnable.begin(); } + + CatalogsToEnable::const_iterator catalogsToEnableEnd() const + { return _pimpl->catalogsToEnable.end(); } + + bool catalogToEnableFind( const std::string & alias_r ) const + { return( _pimpl->catalogsToEnable.find( alias_r ) != _pimpl->catalogsToEnable.end() ); } + + void addCatalogToEnable( const std::string & alias_r ) + { return _pimpl->catalogsToEnable.insert( alias_r ); } + + void delCatalogToEnable( const std::string & alias_r ) + { return _pimpl->catalogsToEnable.erase( alias_r ); } + + std::ostream & ServiceInfo::dumpAsIniOn( std::ostream & str ) const { - return RepoInfoBase::dumpAsIniOn(str) << "url = " << url() << endl; + return RepoInfoBase::dumpAsIniOn(str) + << "url = " << url() << endl; } std::ostream & ServiceInfo::dumpAsXMLOn( std::ostream & str) const @@ -100,7 +126,7 @@ << " url=\"" << escape(url().asString()) << "\"" << "/>" << endl; } - + std::ostream & operator<<( std::ostream& str, const ServiceInfo &obj ) { return obj.dumpAsIniOn(str); Modified: trunk/libzypp/zypp/ServiceInfo.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ServiceInfo.h?rev=10970&r1=10969&r2=10970&view=diff ============================================================================== --- trunk/libzypp/zypp/ServiceInfo.h (original) +++ trunk/libzypp/zypp/ServiceInfo.h Tue Sep 9 13:05:48 2008 @@ -62,8 +62,6 @@ */ Url url() const; - public: - /** * Sets url for this service * @@ -71,6 +69,30 @@ */ void setUrl( const Url& url ); + + /** \name Set of catalogs (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:setstd::string 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 ); + //@} + public: /** * Writes ServiceInfo to stream in ".service" format -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org