more debug
authorKlaus Kaempf <kkaempf@suse.de>
Thu, 9 Feb 2006 21:22:55 +0000 (21:22 +0000)
committerKlaus Kaempf <kkaempf@suse.de>
Thu, 9 Feb 2006 21:22:55 +0000 (21:22 +0000)
zypp/solver/detail/InstallOrder.cc
zypp/solver/detail/InstallOrder.h

index daafd2fb04b027ac9d731ea0af7edb8d8dff014e..887021ae6ccb3b7ad7fa9b85db69c6495fe8f67d 100644 (file)
@@ -113,20 +113,37 @@ InstallOrder::computeNextSet()
 void
 InstallOrder::setInstalled(PoolItem_Ref item )
 {
+    DBG << "InstallOrder::setInstalled " << item << endl;
+
+    Graph::const_iterator git( _rgraph.find(item) );
+    if (git == _rgraph.end()) {
+       ERR << "Not in _rgraph" << endl;
+       return;
+    }
+
     _dirty = true;
 
-    PoolItemSet adj = _rgraph[item];
 
-    DBG << "InstallOrder::setInstalled " << item << endl;
+    PoolItemSet adj = git->second;             //    adj = _rgraph[item];
 
     // order will be < 0
-    _nodes[item].order--;
+    Nodes::iterator nit( _nodes.find(item) );
+    if (nit == _nodes.end()) {
+       ERR << "Not in _nodes" << endl;
+       return;
+    }
+    nit->second.order--;                       //    _nodes[item].order--;
     _installed.insert (item);
     _toinstall.erase (item);
 
     for (PoolItemSet::iterator it = adj.begin(); it != adj.end(); ++it)
     {
-       NodeInfo& info = _nodes[*it];
+       nit = _nodes.find(*it);
+       if (nit == _nodes.end()) {
+           ERR << "Not in _nodes:" << *it << endl;
+           continue;
+       }
+       NodeInfo& info = nit->second;           // _nodes[*it];
        info.order--;
        if (info.order < 0)
        {
@@ -166,7 +183,7 @@ InstallOrder::startrdfs()
     for (PoolItemSet::iterator it = _toinstall.begin(); it != _toinstall.end(); ++it)
     {
        PoolItem_Ref item = *it;
-       _nodes[item] = NodeInfo (item);
+       _nodes.insert( Nodes::value_type( item, NodeInfo (item) ) );
        _rgraph[item] = PoolItemSet();
        _graph[item] = PoolItemSet();
     }
@@ -175,7 +192,12 @@ InstallOrder::startrdfs()
     for (PoolItemSet::iterator it = _toinstall.begin(); it != _toinstall.end(); ++it)
     {
        const PoolItem_Ref item = *it;
-       if (_nodes[item].visited == false)
+       Nodes::const_iterator nit( _nodes.find(item) );
+       if (nit == _nodes.end()) {
+           ERR << "Can't find " << item << " in _nodes" << endl;
+           continue;
+       }
+       if (nit->second.visited == false)
        {
            DBG << "start recursion on " << item << endl;
            rdfsvisit (item);
@@ -232,7 +254,12 @@ InstallOrder::rdfsvisit (const PoolItem_Ref  item)
 
     DBG << "InstallOrder::rdfsvisit, visiting " << item << endl;
 
-    NodeInfo& nodeinfo = _nodes[item];
+    Nodes::iterator nit( _nodes.find( item ) );
+    if (nit == _nodes.end()) {
+       ERR << "Can't find " << item << " in _nodes" << endl;
+       return;
+    }
+    NodeInfo& nodeinfo = nit->second;
 
     nodeinfo.visited = true;
     nodeinfo.begintime = _rdfstime;
@@ -282,14 +309,19 @@ InstallOrder::rdfsvisit (const PoolItem_Ref  item)
        for (PoolItemSet::iterator it = tovisit.begin(); it != tovisit.end(); ++it)
        {
            const PoolItem_Ref must_visit = *it;
-           if (_nodes[must_visit].visited == false)
+           nit = _nodes.find( must_visit );
+           if (nit == _nodes.end()) {
+               ERR << "Can't find " << must_visit << " in _nodes" << endl;
+               continue;
+           }
+           if (nit->second.visited == false)
            {
                nodeinfo.order++;
                _rgraph[must_visit].insert (item);
                _graph[item].insert (must_visit);
                rdfsvisit(must_visit);
            }
-           else if (_nodes[must_visit].endtime == 0)
+           else if (nit->second.endtime == 0)
            {
                if (must_visit != item)
                {
@@ -316,7 +348,13 @@ InstallOrder::rdfsvisit (const PoolItem_Ref  item)
     }
     DBG << "_topsorted.push_back(" << item << ")" << endl;
     _topsorted.push_back(item);
-    _nodes[item].endtime = _rdfstime;
+    nit = _nodes.find( item );
+    if (nit == _nodes.end())  {
+       ERR << "Can't find " << item << " in nodes" << endl;
+    }
+    else {
+       nit->second.endtime = _rdfstime;
+    }
     _rdfstime++;
 
     DBG << item << " done" << endl;
index 4a85435293a41490e81dfc5aeb32128a17e57600..6c63a8bfc2a701708d31e8a972ae72e729020839 100644 (file)
@@ -80,7 +80,7 @@ class InstallOrder
 
            PoolItem_Ref item;
 
-           NodeInfo() : begintime(0), endtime(0), visited(false), order(0) {}
+//         NodeInfo() : begintime(0), endtime(0), visited(false), order(0) {}
            NodeInfo(PoolItem_Ref item) : begintime(0), endtime(0), visited(false), order(0), item(item) {}
        };