[Aptitude-svn-commit] r3936 - in branches/aptitude-0.3/aptitude: .
src/generic/problemresolver
Daniel Burrows
dburrows at costa.debian.org
Sat Aug 20 17:45:39 UTC 2005
Author: dburrows
Date: Sat Aug 20 17:45:36 2005
New Revision: 3936
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h
Log:
Mark solutions containing a known conflict as irrelevant.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Sat Aug 20 17:45:36 2005
@@ -2,6 +2,11 @@
* src/generic/problemresolver/problemresolver.h:
+ When checking whether a solution is irrelevant, also check
+ whether it contains a known conflict.
+
+ * src/generic/problemresolver/problemresolver.h:
+
Split the monstrosity of will_conflict into four routines.
* src/generic/problemresolver/problemresolver.h:
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 17:45:36 2005
@@ -469,6 +469,28 @@
return conflicts.end();
}
+ /** Test whether the given solution contains a conflict. */
+ bool contains_conflict(const solution &s) const
+ {
+ std::map<package, act_conflict> m;
+ populate_partial_conflict(s, m);
+
+ typename std::set<std::map<package, act_conflict> >::const_iterator
+ found = subsumes_any_conflict(m);
+ bool rval = (found != conflicts.end());
+
+ if(debug && rval)
+ {
+ std::cout << "The conflict ";
+ dump(std::cout, *found);
+ std::cout << " is triggered by the solution ";
+ s.dump(std::cout);
+ std::cout << std::endl;
+ }
+
+ return rval;
+ }
+
/** Test whether the given solution contains a conflict when the
* given action is taken.
*
@@ -1422,6 +1444,9 @@
if(closed.find(s) != closed.end())
return true;
+ if(contains_conflict(s))
+ return true;
+
// The efficiency of this step hinges on the *assumption* that the
// number of solutions that will be generated is small relative to
// the number of potential solutions.
More information about the Aptitude-svn-commit
mailing list