[Aptitude-svn-commit] r3933 - in branches/aptitude-0.3/aptitude: . src/generic/problemresolver

Daniel Burrows dburrows at costa.debian.org
Sat Aug 20 00:33:22 UTC 2005


Author: dburrows
Date: Sat Aug 20 00:33:19 2005
New Revision: 3933

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h
Log:
Fix will_conflict.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sat Aug 20 00:33:19 2005
@@ -1,5 +1,9 @@
 2005-08-19  Daniel Burrows  <dburrows at debian.org>
 
+	* src/generic/problemresolver/problemresolver.h:
+
+	  Fix will_conflict (the previous definition was obviously wrong).
+
 	* src/generic/problemresolver/problemresolver.h, src/generic/problemresolver/solution.h:
 
 	  Add preliminary support for tracking logical conflicts within

Modified: branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h	Sat Aug 20 00:33:19 2005
@@ -407,29 +407,54 @@
 
     for(typename std::set<std::map<package, act_conflict> >::const_iterator ci = conflicts.begin();
 	ci != conflicts.end(); ++ci)
-      if(includes(ci.begin(), ci.end(),
-		  m.begin(), m.end()))
-	{
-	  if(debug)
-	    {
-	      std::cout << "Discovered conflict (";
-	      for(std::map<package, act_conflict> cj = ci->begin();
-		  cj != cj->end(); ++cj)
-		{
-		  if(cj != ci->begin())
-		    std::cout << ", ";
-		  std::cout << cj->first.name() << " " <<
-		    cj->second.ver.name();
+      {
+	typename std::map<package, act_conflict>::const_iterator cj = ci->begin();
+	typename std::map<package, act_conflict>::const_iterator mi = ci->begin();
 
-		  if(cj->second.from_dep_source)
-		    std::cout << " [" << cj->second.d << "]";
-		}
+	bool is_subset = true;
 
-	      std::cout << ")" << std::endl;
-	    }
+	while(cj != ci->end() &&
+	      mi != ci->end())
+	  {
+	    if(cj->first < mi->first)
+	      ++cj;
+	    else if(mi->first < cj->first)
+	      ++mi;
+	    else if(mi->second != cj->second)
+	      {
+		is_subset = false;
+		break;
+	      }
+	    else
+	      {
+		++mi;
+		++cj;
+	      }
+	  }
 
-	  return true;
-	}
+	if(is_subset)
+	  {
+	    if(debug)
+	      {
+		std::cout << "Discovered conflict (";
+		for(std::map<package, act_conflict> cj = ci->begin();
+		    cj != cj->end(); ++cj)
+		  {
+		    if(cj != ci->begin())
+		      std::cout << ", ";
+		    std::cout << cj->first.name() << " " <<
+		      cj->second.ver.name();
+
+		    if(cj->second.from_dep_source)
+		      std::cout << " [" << cj->second.d << "]";
+		  }
+
+		std::cout << ")" << std::endl;
+	      }
+
+	    return true;
+	  }
+      }
 
     return false;
   }



More information about the Aptitude-svn-commit mailing list