_items_to_lock.unique ();
}
+void
+SATResolver::addPoolItemToKeep (PoolItem item)
+{
+ _items_to_keep.push_back (item);
+ _items_to_keep.unique ();
+}
//---------------------------------------------------------------------------
resolver.addPoolItemToRemove(item); // -> remove !
}
else if (status.isLocked()
- || (status.isKept()
- && !by_solver)) {
- resolver.addPoolItemToLock (item);
+ && !by_solver) {
+ resolver.addPoolItemToLock (item);
}
+ else if (status.isKept()
+ && !by_solver) {
+ resolver.addPoolItemToKeep (item);
+ }
return true;
}
_items_to_install.clear();
_items_to_remove.clear();
_items_to_lock.clear();
+ _items_to_keep.clear();
invokeOnEach ( _pool.begin(), _pool.end(),
functor::functorRef<bool,PoolItem>(info) );
}
}
+ for (PoolItemList::const_iterator iter = _items_to_keep.begin(); iter != _items_to_keep.end(); iter++) {
+ sat::detail::SolvableIdType ident( (*iter)->satSolvable().id() );
+ if (iter->status().isInstalled()) {
+ MIL << "Keep installed item " << *iter << " with the string ID: " << ident << endl;
+ queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE | SOLVER_WEAK);
+ queue_push( &(_jobQueue), ident );
+ } else {
+ MIL << "Keep NOT installed item " << *iter << " with the string ID: " << ident << endl;
+ queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE | SOLVER_WEAK);
+ queue_push( &(_jobQueue), ident );
+ }
+ }
+
_solv = solver_create( _SATPool, sat::Pool::instance().systemRepo().get() );
_solv->vendorCheckCb = &vendorCheck;
_solv->fixsystem = _fixsystem;
PoolItemList _items_to_install;
PoolItemList _items_to_remove;
PoolItemList _items_to_lock;
+ PoolItemList _items_to_keep;
bool _fixsystem; // repair errors in rpm dependency graph
bool _allowdowngrade; // allow to downgrade installed solvable
void addPoolItemsToInstallFromList (PoolItemList & rl);
void addPoolItemToLock (PoolItem item);
+ void addPoolItemToKeep (PoolItem item);
void addPoolItemToRemove (PoolItem item);
void addPoolItemsToRemoveFromList (PoolItemList & rl);