ref: refs/heads/master
commit a9585e0715f8541910cbb10f5835787643425db0
Author: Michael Calmer
Date: Tue Feb 10 17:52:02 2009 +0100
add repoManager() to ZyppAC class and use it in the code.
---
src/SUSE_SoftwareInstallationServiceProvider.cc | 2 +-
src/SUSE_SoftwareRepositoryProvider.cc | 16 ++++++++--------
src/SUSE_zypp.h | 11 ++++++-----
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/src/SUSE_SoftwareInstallationServiceProvider.cc b/src/SUSE_SoftwareInstallationServiceProvider.cc
index 4014e4c..d7864e7 100644
--- a/src/SUSE_SoftwareInstallationServiceProvider.cc
+++ b/src/SUSE_SoftwareInstallationServiceProvider.cc
@@ -203,7 +203,7 @@ CmpiStatus SUSE_SoftwareInstallationServiceProviderClass::refreshAllRepositories
pol = RepoManager::RefreshIfNeededIgnoreDelay;
break;
}
- RepoManager repoManager( zyppac->getSysRoot() );
+ RepoManager repoManager( zyppac->repoManager() );
try
{
diff --git a/src/SUSE_SoftwareRepositoryProvider.cc b/src/SUSE_SoftwareRepositoryProvider.cc
index 458db47..dd8b517 100644
--- a/src/SUSE_SoftwareRepositoryProvider.cc
+++ b/src/SUSE_SoftwareRepositoryProvider.cc
@@ -55,7 +55,7 @@ CmpiStatus SUSE_SoftwareRepositoryProviderClass::enumInstanceNames( const CmpiCo
return rc;
}
- RepoManager repoManager( zyppac->getSysRoot() );
+ RepoManager repoManager( zyppac->repoManager() );
RepoInfoList repos = repoManager.knownRepositories();
for ( RepoInfoList::iterator it = repos.begin(); it != repos.end(); ++it )
@@ -92,7 +92,7 @@ CmpiStatus SUSE_SoftwareRepositoryProviderClass::enumInstances( const CmpiContex
return rc;
}
- RepoManager repoManager( zyppac->getSysRoot() );
+ RepoManager repoManager( zyppac->repoManager() );
RepoInfoList repos = repoManager.knownRepositories();
for ( RepoInfoList::iterator it = repos.begin(); it != repos.end(); ++it )
@@ -141,7 +141,7 @@ CmpiStatus SUSE_SoftwareRepositoryProviderClass::getInstance( const CmpiContext
return rc;
}
- RepoManager repoManager( zyppac->getSysRoot() );
+ RepoManager repoManager( zyppac->repoManager() );
if( ! repoManager.hasRepo( ln ) )
{
CmpiStatus rc( CMPI_RC_ERR_FAILED, "Could not find this instance." );
@@ -204,7 +204,7 @@ CmpiStatus SUSE_SoftwareRepositoryProviderClass::setInstance (const CmpiContext
return rc;
}
- RepoManager repoManager( zyppac->getSysRoot() );
+ RepoManager repoManager( zyppac->repoManager() );
// Check, if repo exists
if( ! repoManager.hasRepo( newn ) )
{
@@ -269,7 +269,7 @@ CmpiStatus SUSE_SoftwareRepositoryProviderClass::deleteInstance (const CmpiConte
return rc;
}
- RepoManager repoManager( zyppac->getSysRoot() );
+ RepoManager repoManager( zyppac->repoManager() );
// Check, if repo exists
if( ! repoManager.hasRepo( newn ) )
{
@@ -334,7 +334,7 @@ CmpiStatus SUSE_SoftwareRepositoryProviderClass::createInstance (const CmpiConte
return rc;
}
- RepoManager repoManager( zyppac->getSysRoot() );
+ RepoManager repoManager( zyppac->repoManager() );
// Check, if repo exists
if( repoManager.hasRepo( newn ) )
{
@@ -574,7 +574,7 @@ CmpiStatus SUSE_SoftwareRepositoryProviderClass::requestStateChange(const CmpiCo
return CmpiStatus ( CMPI_RC_OK );
}
- RepoManager repoManager( zyppac->getSysRoot() );
+ RepoManager repoManager( zyppac->repoManager() );
if( ! repoManager.hasRepo( ln ) )
{
_CMPIZYPP_TRACE(1,("--- %s CMPI GetInstance() failed : Could not find this instance.", _ClassName ));
@@ -662,7 +662,7 @@ CmpiStatus SUSE_SoftwareRepositoryProviderClass::refresh(const CmpiContext &ctx,
break;
}
- RepoManager repoManager( zyppac->getSysRoot() );
+ RepoManager repoManager( zyppac->repoManager() );
if( ! repoManager.hasRepo( ln ) )
{
_CMPIZYPP_TRACE(1,("--- %s CMPI InvokeMethod() failed : Could not find this instance.", _ClassName ));
diff --git a/src/SUSE_zypp.h b/src/SUSE_zypp.h
index 2ccd7f5..442737e 100644
--- a/src/SUSE_zypp.h
+++ b/src/SUSE_zypp.h
@@ -26,11 +26,12 @@ namespace cmpizypp
ZyppAC();
~ZyppAC();
- zypp::Pathname getSysRoot() const { return sysRoot; }
- zypp::Target & target() const { return *zypp::getZYpp()->getTarget(); }
- zypp::ResPool pool() const { return zypp::ResPool::instance(); }
- zypp::ResPoolProxy poolProxy() const { return pool().proxy(); }
- zypp::sat::Pool satpool() const { return zypp::sat::Pool::instance(); }
+ zypp::Pathname getSysRoot() const { return sysRoot; }
+ zypp::Target & target() const { return *zypp::getZYpp()->getTarget(); }
+ zypp::ResPool pool() const { return zypp::ResPool::instance(); }
+ zypp::ResPoolProxy poolProxy() const { return pool().proxy(); }
+ zypp::sat::Pool satpool() const { return zypp::sat::Pool::instance(); }
+ zypp::RepoManager repoManager() const { return zypp::RepoManager( sysRoot ); }
static std::string exceptionString( const zypp::Exception & err_r, const std::string & prefix = std::string() );
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org