Author: schubi2
Date: Fri Apr 4 17:05:04 2008
New Revision: 9384
URL: http://svn.opensuse.org/viewcvs/zypp?rev=9384&view=rev
Log:
distinguish between keep and lock in the solver request
Modified:
trunk/libzypp/zypp/sat/SATResolver.cc
trunk/libzypp/zypp/sat/SATResolver.h
Modified: trunk/libzypp/zypp/sat/SATResolver.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SATResolver.cc?rev=9384&r1=9383&r2=9384&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/SATResolver.cc (original)
+++ trunk/libzypp/zypp/sat/SATResolver.cc Fri Apr 4 17:05:04 2008
@@ -215,6 +215,12 @@
_items_to_lock.unique ();
}
+void
+SATResolver::addPoolItemToKeep (PoolItem item)
+{
+ _items_to_keep.push_back (item);
+ _items_to_keep.unique ();
+}
//---------------------------------------------------------------------------
@@ -337,10 +343,13 @@
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;
}
@@ -396,6 +405,7 @@
_items_to_install.clear();
_items_to_remove.clear();
_items_to_lock.clear();
+ _items_to_keep.clear();
invokeOnEach ( _pool.begin(), _pool.end(),
functor::functorRef(info) );
@@ -444,6 +454,19 @@
}
}
+ 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;
Modified: trunk/libzypp/zypp/sat/SATResolver.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SATResolver.h?rev=9384&r1=9383&r2=9384&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/SATResolver.h (original)
+++ trunk/libzypp/zypp/sat/SATResolver.h Fri Apr 4 17:05:04 2008
@@ -68,6 +68,7 @@
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
@@ -108,6 +109,7 @@
void addPoolItemsToInstallFromList (PoolItemList & rl);
void addPoolItemToLock (PoolItem item);
+ void addPoolItemToKeep (PoolItem item);
void addPoolItemToRemove (PoolItem item);
void addPoolItemsToRemoveFromList (PoolItemList & rl);
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org