Mailinglist Archive: zypp-commit (606 mails)

< Previous Next >
[zypp-commit] r9444 - in /trunk/libzypp/zypp/sat: SATResolver.cc SATResolver.h
  • From: schubi2@xxxxxxxxxxxxxxxx
  • Date: Tue, 08 Apr 2008 09:52:46 -0000
  • Message-id: <20080408095246.885FF26F47@xxxxxxxxxxxxxxxx>
Author: schubi2
Date: Tue Apr 8 11:52:46 2008
New Revision: 9444

URL: http://svn.opensuse.org/viewcvs/zypp?rev=9444&view=rev
Log:
cleanup while state changes; added update for special items

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=9444&r1=9443&r2=9444&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/SATResolver.cc (original)
+++ trunk/libzypp/zypp/sat/SATResolver.cc Tue Apr 8 11:52:46 2008
@@ -154,7 +154,7 @@


void
-SATResolver::addPoolItemToInstall (PoolItem item)
+SATResolver::resetItemTransaction (PoolItem item)
{
bool found = false;
for (PoolItemList::const_iterator iter = _items_to_remove.begin();
@@ -166,9 +166,54 @@
}
}
if (!found) {
- _items_to_install.push_back (item);
- _items_to_install.unique ();
+ for (PoolItemList::const_iterator iter = _items_to_install.begin();
+ iter != _items_to_install.end(); iter++) {
+ if (*iter == item) {
+ _items_to_install.remove(*iter);
+ found = true;
+ break;
+ }
+ }
}
+ if (!found) {
+ for (PoolItemList::const_iterator iter = _items_to_keep.begin();
+ iter != _items_to_keep.end(); iter++) {
+ if (*iter == item) {
+ _items_to_keep.remove(*iter);
+ found = true;
+ break;
+ }
+ }
+ }
+ if (!found) {
+ for (PoolItemList::const_iterator iter = _items_to_lock.begin();
+ iter != _items_to_lock.end(); iter++) {
+ if (*iter == item) {
+ _items_to_lock.remove(*iter);
+ found = true;
+ break;
+ }
+ }
+ }
+ if (!found) {
+ for (PoolItemList::const_iterator iter = _items_to_update.begin();
+ iter != _items_to_update.end(); iter++) {
+ if (*iter == item) {
+ _items_to_update.remove(*iter);
+ found = true;
+ break;
+ }
+ }
+ }
+}
+
+
+void
+SATResolver::addPoolItemToInstall (PoolItem item)
+{
+ resetItemTransaction (item);
+ _items_to_install.push_back (item);
+ _items_to_install.unique ();
}


@@ -184,19 +229,9 @@
void
SATResolver::addPoolItemToRemove (PoolItem item)
{
- bool found = false;
- for (PoolItemList::const_iterator iter = _items_to_install.begin();
- iter != _items_to_install.end(); iter++) {
- if (*iter == item) {
- _items_to_install.remove(*iter);
- found = true;
- break;
- }
- }
- if (!found) {
- _items_to_remove.push_back (item);
- _items_to_remove.unique ();
- }
+ resetItemTransaction (item);
+ _items_to_remove.push_back (item);
+ _items_to_remove.unique ();
}


@@ -211,6 +246,7 @@
void
SATResolver::addPoolItemToLock (PoolItem item)
{
+ resetItemTransaction (item);
_items_to_lock.push_back (item);
_items_to_lock.unique ();
}
@@ -218,6 +254,7 @@
void
SATResolver::addPoolItemToKeep (PoolItem item)
{
+ resetItemTransaction (item);
_items_to_keep.push_back (item);
_items_to_keep.unique ();
}
@@ -422,6 +459,18 @@
queue_push( &(_jobQueue), id );
}

+ for (PoolItemList::const_iterator iter = _items_to_update.begin(); iter !=
_items_to_update.end(); iter++) {
+ PoolItem r = *iter;
+
+ Id id = (*iter)->satSolvable().id();
+ if (id == ID_NULL) {
+ ERR << "Update explicit: " << *iter << " not found" << endl;
+ }
+ MIL << "Update explicit " << *iter << " with the SAT-Pool ID: " << id
<< endl;
+ queue_push( &(_jobQueue), SOLVER_INSTALL_SOLVABLE_UPDATE );
+ queue_push( &(_jobQueue), id );
+ }
+
for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter !=
_items_to_remove.end(); iter++) {
sat::detail::IdType ident( (*iter)->satSolvable().ident().id() );
MIL << "Delete " << *iter << " with the string ID: " << ident << endl;

Modified: trunk/libzypp/zypp/sat/SATResolver.h
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SATResolver.h?rev=9444&r1=9443&r2=9444&view=diff
==============================================================================
--- trunk/libzypp/zypp/sat/SATResolver.h (original)
+++ trunk/libzypp/zypp/sat/SATResolver.h Tue Apr 8 11:52:46 2008
@@ -66,6 +66,7 @@

// list populated by calls to addPoolItemTo*()
PoolItemList _items_to_install;
+ PoolItemList _items_to_update;
PoolItemList _items_to_remove;
PoolItemList _items_to_lock;
PoolItemList _items_to_keep;
@@ -83,6 +84,7 @@

// ---------------------------------- methods
std::string SATprobleminfoString (Id problem, std::string &detail);
+ void resetItemTransaction (PoolItem item);

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