Author: mlandres
Date: Thu Sep 11 17:01:48 2008
New Revision: 11018
URL: http://svn.opensuse.org/viewcvs/zypp?rev=11018&view=rev
Log:
add catalogsToDisable to service
Modified:
trunk/libzypp/devel/devel.ma/NewPool.cc
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=11018&r1=11017&r2=11018&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/NewPool.cc (original)
+++ trunk/libzypp/devel/devel.ma/NewPool.cc Thu Sep 11 17:01:48 2008
@@ -430,16 +430,6 @@
#undef OUTS
}
-namespace zypp
-{
- enum TestE {
- TE1, TE2, TE3
- };
-
- inline void fromString( const std::string & str_r, TestE & cl_r )
- { cl_r = TE1; }
-
-}
/******************************************************************
**
@@ -454,11 +444,20 @@
INT << "===[START]==========================================" << endl;
ZConfig::instance();
+#if 0
+ ServiceInfo s( "STest", Url("dir:///somewhere") );
+ DBG << s << endl;
+ s.addCatalogToEnable( "foo" );
+ s.addCatalogToEnable( "ba a" );
+ s.addCatalogToEnable( "kaa" );
+
+ RepoManager repoManager( makeRepoManager( sysRoot ) );
+ RepoInfoList repos = repoManager.knownRepositories();
+ RepoInfoList services = repoManager.knownServices();
-#if 1
- DBG << str::fromString<TestE>("te1") << endl;
+ DBG << s << endl;
///////////////////////////////////////////////////////////////////
INT << "===[END]============================================" << endl << endl;
Modified: trunk/libzypp/zypp/ServiceInfo.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ServiceInfo.cc?rev=11018&r1=11017&r2=11018&view=diff
==============================================================================
--- trunk/libzypp/zypp/ServiceInfo.cc (original)
+++ trunk/libzypp/zypp/ServiceInfo.cc Thu Sep 11 17:01:48 2008
@@ -46,10 +46,12 @@
struct ServiceInfo::Impl : public repo::RepoInfoBase::Impl
{
typedef ServiceInfo::CatalogsToEnable CatalogsToEnable;
+ typedef ServiceInfo::CatalogsToDisable CatalogsToDisable;
public:
Url url;
- CatalogsToEnable catalogsToEnable;
+ CatalogsToEnable catalogsToEnable;
+ CatalogsToDisable catalogsToDisable;
public:
Impl() : repo::RepoInfoBase::Impl() {}
@@ -110,11 +112,35 @@
{ _pimpl->catalogsToEnable.erase( alias_r ); }
+ bool ServiceInfo::catalogsToDisableEmpty() const
+ { return _pimpl->catalogsToDisable.empty(); }
+
+ ServiceInfo::CatalogsToDisable::size_type ServiceInfo::catalogsToDisableSize() const
+ { return _pimpl->catalogsToDisable.size(); }
+
+ ServiceInfo::CatalogsToDisable::const_iterator ServiceInfo::catalogsToDisableBegin() const
+ { return _pimpl->catalogsToDisable.begin(); }
+
+ ServiceInfo::CatalogsToDisable::const_iterator ServiceInfo::catalogsToDisableEnd() const
+ { return _pimpl->catalogsToDisable.end(); }
+
+ bool ServiceInfo::catalogToDisableFind( const std::string & alias_r ) const
+ { return( _pimpl->catalogsToDisable.find( alias_r ) != _pimpl->catalogsToDisable.end() ); }
+
+ void ServiceInfo::addCatalogToDisable( const std::string & alias_r )
+ { _pimpl->catalogsToDisable.insert( alias_r ); }
+
+ void ServiceInfo::delCatalogToDisable( const std::string & alias_r )
+ { _pimpl->catalogsToDisable.erase( alias_r ); }
+
+
std::ostream & ServiceInfo::dumpAsIniOn( std::ostream & str ) const
{
RepoInfoBase::dumpAsIniOn(str) << "url = " << url() << endl;
if ( ! catalogsToEnableEmpty() )
str << "catalogstoenable = " << str::joinEscaped( catalogsToEnableBegin(), catalogsToEnableEnd() ) << endl;
+ if ( ! catalogsToDisableEmpty() )
+ str << "catalogstodisable = " << str::joinEscaped( catalogsToDisableBegin(), catalogsToDisableEnd() ) << endl;
return str;
}
@@ -130,7 +156,7 @@
<< " enabled=\"" << enabled() << "\""
<< " autorefresh=\"" << autorefresh() << "\""
<< " url=\"" << escape(url().asString()) << "\"";
-
+
if (content.empty())
str << "/>" << endl;
else
Modified: trunk/libzypp/zypp/ServiceInfo.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/ServiceInfo.h?rev=11018&r1=11017&r2=11018&view=diff
==============================================================================
--- trunk/libzypp/zypp/ServiceInfo.h (original)
+++ trunk/libzypp/zypp/ServiceInfo.h Thu Sep 11 17:01:48 2008
@@ -94,6 +94,28 @@
void delCatalogToEnable( const std::string & alias_r );
//@}
+ /** \name Set of catalogs (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::setstd::string 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 );
+ //@}
+
public:
/**
* Writes ServiceInfo to stream in ".service" format
@@ -109,7 +131,7 @@
/**
* Write an XML representation of this ServiceInfo object.
- *
+ *
* \param str
* \param content if not empty, produces