Author: mlandres
Date: Thu Oct 23 17:21:32 2008
New Revision: 11466
URL: http://svn.opensuse.org/viewcvs/zypp?rev=11466&view=rev
Log:
enhance system repo handling
Modified:
trunk/libzypp/zypp/sat/Pool.cc
trunk/libzypp/zypp/sat/Pool.h
trunk/libzypp/zypp/sat/detail/PoolImpl.h
trunk/libzypp/zypp/solver/detail/SATResolver.cc
Modified: trunk/libzypp/zypp/sat/Pool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.cc?rev=11466&r1=11465&r2=11466&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Pool.cc (original)
+++ trunk/libzypp/zypp/sat/Pool.cc Thu Oct 23 17:21:32 2008
@@ -124,6 +124,18 @@
return Repository();
}
+ Repository Pool::findSystemRepo() const
+ {
+ return Repository( myPool().systemRepo() );
+ }
+
+ Repository Pool::systemRepo()
+ {
+ if ( myPool().systemRepo() )
+ return Repository( myPool().systemRepo() );
+ return reposInsert( systemRepoAlias() );
+ }
+
Repository Pool::addRepoSolv( const Pathname & file_r, const std::string & alias_r )
{
// Using a temporay repo! (The additional parenthesis are required.)
Modified: trunk/libzypp/zypp/sat/Pool.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/Pool.h?rev=11466&r1=11465&r2=11466&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/Pool.h (original)
+++ trunk/libzypp/zypp/sat/Pool.h Thu Oct 23 17:21:32 2008
@@ -100,12 +100,10 @@
static const std::string & systemRepoAlias();
/** Return the system repository if it is on the pool. */
- Repository findSystemRepo() const
- { return reposFind( systemRepoAlias() ); }
+ Repository findSystemRepo() const;
/** Return the system repository, create it if missing. */
- Repository systemRepo()
- { return reposInsert( systemRepoAlias() ); }
+ Repository systemRepo();
public:
/** Load \ref Solvables from a solv-file into a \ref Repository named \c name_r.
Modified: trunk/libzypp/zypp/sat/detail/PoolImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/detail/PoolImpl.h?rev=11466&r1=11465&r2=11466&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/detail/PoolImpl.h (original)
+++ trunk/libzypp/zypp/sat/detail/PoolImpl.h Thu Oct 23 17:21:32 2008
@@ -88,6 +88,9 @@
bool isSystemRepo( ::_Repo * repo_r ) const
{ return repo_r && _pool->installed == repo_r; }
+ ::_Repo * systemRepo() const
+ { return _pool->installed; }
+
public:
/** \name Actions invalidating housekeeping data.
*
Modified: trunk/libzypp/zypp/solver/detail/SATResolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/SATResolver.cc?rev=11466&r1=11465&r2=11466&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/SATResolver.cc (original)
+++ trunk/libzypp/zypp/solver/detail/SATResolver.cc Thu Oct 23 17:21:32 2008
@@ -466,12 +466,10 @@
{
Id p;
p = _solv->decisionq.elements[i];
- if (p < 0 || !sat::Solvable(p))
- continue;
- if (sat::Solvable(p).repository().get() == _solv->installed)
+ if (p < 0 || !sat::Solvable(p) || sat::Solvable(p).isSystem())
continue;
- PoolItem poolItem = _pool.find (sat::Solvable(p));
+ PoolItem poolItem((sat::Solvable(p)));
if (poolItem) {
SATSolutionToPool (poolItem, ResStatus::toBeInstalled, ResStatus::SOLVER);
_result_items_to_install.push_back (poolItem);
@@ -481,30 +479,26 @@
}
/* solvables to be erased */
- if (_solv->installed)
- for (int i = _solv->installed->start; i < _solv->installed->start + _solv->installed->nsolvables; i++)
+ Repository systemRepo( sat::Pool::instance().findSystemRepo() ); // don't create if it does not exist
+ for_( it, systemRepo.solvablesBegin(), systemRepo.solvablesEnd() )
{
- if (_solv->decisionmap[i] > 0)
- continue;
+ if (_solv->decisionmap[it->id()] > 0)
+ continue;
- PoolItem poolItem = _pool.find (sat::Solvable(i));
- if (poolItem) {
- // Check if this is an update
- CheckIfUpdate info;
- invokeOnEach( _pool.byIdentBegin( poolItem ),
- _pool.byIdentEnd( poolItem ),
- resfilter::ByUninstalled(), // ByUninstalled
- functor::functorRef