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.)
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.
{
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);
}
/* 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;
-
- 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<bool,PoolItem> (info) );
-
- if (info.is_updated) {
- SATSolutionToPool (poolItem, ResStatus::toBeUninstalledDueToUpgrade , ResStatus::SOLVER);
- } else {
- SATSolutionToPool (poolItem, ResStatus::toBeUninstalled, ResStatus::SOLVER);
- }
- _result_items_to_remove.push_back (poolItem);
+ if (_solv->decisionmap[it->id()] > 0)
+ continue;
+
+ PoolItem poolItem( *it );
+ // Check if this is an update
+ CheckIfUpdate info;
+ invokeOnEach( _pool.byIdentBegin( poolItem ),
+ _pool.byIdentEnd( poolItem ),
+ resfilter::ByUninstalled(), // ByUninstalled
+ functor::functorRef<bool,PoolItem> (info) );
+
+ if (info.is_updated) {
+ SATSolutionToPool (poolItem, ResStatus::toBeUninstalledDueToUpgrade , ResStatus::SOLVER);
} else {
- ERR << "id " << i << " not found in ZYPP pool." << endl;
+ SATSolutionToPool (poolItem, ResStatus::toBeUninstalled, ResStatus::SOLVER);
}
+ _result_items_to_remove.push_back (poolItem);
}
/* solvables which are recommended */