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

Daniel Burrows dburrows at costa.debian.org
Tue Aug 16 01:59:37 UTC 2005


Author: dburrows
Date: Tue Aug 16 01:59:33 2005
New Revision: 3861

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h
Log:
Fix how the new score is calculated when dropping a soft dep.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Tue Aug 16 01:59:33 2005
@@ -1,5 +1,10 @@
 2005-08-15  Daniel Burrows  <dburrows at debian.org>
 
+	* src/generic/problemresolver/problemresolver.h:
+
+	  Correct the calculation of the new score when choosing to leave
+	  a soft dependency unfixed.
+
 	* tests/test_resolver.cc:
 
 	  Correct the comparison of s1 and s2 (they should be equivalent).

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	Tue Aug 16 01:59:33 2005
@@ -854,7 +854,7 @@
       }
 
     // By definition we have a solution now.
-    int score = action_score + full_solution_score;
+    int score = action_score + full_solution_score + unfixed_soft_score * unresolved_soft_deps.size();
 
     return solution(project_iter_2nd(output_actions.begin()),
 		    project_iter_2nd(output_actions.end()),
@@ -1332,8 +1332,8 @@
 	// Only score change is that something goes from being broken
 	// to being permanently unfixed and "soft".
 	if(try_enqueue(solution(s, d,
-				s.get_score() - broken_score,
-				s.get_action_score() + unfixed_soft_score)))
+				s.get_score() - broken_score + unfixed_soft_score,
+				s.get_action_score())))
 	  ++count;
       }
   }



More information about the Aptitude-svn-commit mailing list