Mailinglist Archive: zypp-commit (223 mails)

< Previous Next >
[zypp-commit] r10580 - in /trunk/libzypp/zypp/solver/detail: SATResolver.cc SATResolver.h
  • From: schubi2@xxxxxxxxxxxxxxxx
  • Date: Mon, 14 Jul 2008 15:26:15 -0000
  • Message-id: <20080714152615.889FF344AD@xxxxxxxxxxxxxxxx>
Author: schubi2
Date: Mon Jul 14 17:26:15 2008
New Revision: 10580

URL: http://svn.opensuse.org/viewcvs/zypp?rev=10580&view=rev
Log:
cleanup

Modified:
trunk/libzypp/zypp/solver/detail/SATResolver.cc
trunk/libzypp/zypp/solver/detail/SATResolver.h

Modified: trunk/libzypp/zypp/solver/detail/SATResolver.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/SATResolver.cc?rev=10580&r1=10579&r2=10580&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/SATResolver.cc (original)
+++ trunk/libzypp/zypp/solver/detail/SATResolver.cc Mon Jul 14 17:26:15 2008
@@ -694,31 +694,8 @@
MIL << "Conflicts " << *iter << endl;
}

- for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter !=
_items_to_lock.end(); iter++) {
- sat::detail::SolvableIdType ident( (*iter)->satSolvable().id() );
- if (iter->status().isInstalled()) {
- MIL << "Lock installed item " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE );
- queue_push( &(_jobQueue), ident );
- } else {
- MIL << "Lock NOT installed item " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE );
- queue_push( &(_jobQueue), ident );
- }
- }
-
- 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 << endl;
- queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE | SOLVER_WEAK);
- queue_push( &(_jobQueue), ident );
- } else {
- MIL << "Keep NOT installed item " << *iter << ident << endl;
- queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE | SOLVER_WEAK);
- queue_push( &(_jobQueue), ident );
- }
- }
+ // set locks for the solver
+ setLocks();

// solving
bool ret = solving();
@@ -768,31 +745,9 @@
queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE_NAME );
queue_push( &(_jobQueue), ident);
}
- for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter !=
_items_to_lock.end(); iter++) {
- sat::detail::SolvableIdType ident( (*iter)->satSolvable().id() );
- if (iter->status().isInstalled()) {
- MIL << "Lock installed item " << *iter << ident << endl;
- queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE );
- queue_push( &(_jobQueue), ident );
- } else {
- MIL << "Lock NOT installed item " << *iter << ident << endl;
- queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE );
- queue_push( &(_jobQueue), ident );
- }
- }
- 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 << ident << endl;
- queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE | SOLVER_WEAK);
- queue_push( &(_jobQueue), ident );
- } else {
- MIL << "Keep NOT installed item " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE | SOLVER_WEAK);
- queue_push( &(_jobQueue), ident );
- }
- }
-
+
+ // set locks for the solver
+ setLocks();

// solving
bool ret = solving();
@@ -816,31 +771,8 @@
PoolItemSet(),
ObsoleteStrings());

- for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter !=
_items_to_lock.end(); iter++) {
- sat::detail::SolvableIdType ident( (*iter)->satSolvable().id() );
- if (iter->status().isInstalled()) {
- MIL << "Lock installed item " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE );
- queue_push( &(_jobQueue), ident );
- } else {
- MIL << "Lock NOT installed item " << *iter << endl;
- queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE );
- queue_push( &(_jobQueue), ident );
- }
- }
-
- 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 << endl;
- queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE | SOLVER_WEAK);
- queue_push( &(_jobQueue), ident );
- } else {
- MIL << "Keep NOT installed item " << *iter << ident << endl;
- queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE | SOLVER_WEAK);
- queue_push( &(_jobQueue), ident );
- }
- }
+ // set locks for the solver
+ void setLocks();

_solv = solver_create( _SATPool, sat::Pool::instance().systemRepo().get()
);
_solv->vendorCheckCb = &vendorCheck;
@@ -1291,6 +1223,35 @@
}
}

+void SATResolver::setLocks()
+{
+ for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter !=
_items_to_lock.end(); iter++) {
+ sat::detail::SolvableIdType ident( (*iter)->satSolvable().id() );
+ if (iter->status().isInstalled()) {
+ MIL << "Lock installed item " << *iter << endl;
+ queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE );
+ queue_push( &(_jobQueue), ident );
+ } else {
+ MIL << "Lock NOT installed item " << *iter << endl;
+ queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE );
+ queue_push( &(_jobQueue), ident );
+ }
+ }
+
+ 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 << endl;
+ queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE | SOLVER_WEAK);
+ queue_push( &(_jobQueue), ident );
+ } else {
+ MIL << "Keep NOT installed item " << *iter << ident << endl;
+ queue_push( &(_jobQueue), SOLVER_ERASE_SOLVABLE | SOLVER_WEAK);
+ queue_push( &(_jobQueue), ident );
+ }
+ }
+}
+


///////////////////////////////////////////////////////////////////

Modified: trunk/libzypp/zypp/solver/detail/SATResolver.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/SATResolver.h?rev=10580&r1=10579&r2=10580&view=diff
==============================================================================
--- trunk/libzypp/zypp/solver/detail/SATResolver.h (original)
+++ trunk/libzypp/zypp/solver/detail/SATResolver.h Mon Jul 14 17:26:15 2008
@@ -100,6 +100,8 @@
bool solving();
// cleanup solver
void solverEnd();
+ // set locks for the solver
+ void setLocks();

public:


--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages