[Aptitude-devel] r3008 - in branches/aptitude-0.3/aptitude: . src/cmdline src/generic/problemresolver

Daniel Burrows dburrows@costa.debian.org
Sun, 10 Apr 2005 13:53:33 +0000


Author: dburrows
Date: Sun Apr 10 13:53:30 2005
New Revision: 3008

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/cmdline/cmdline_do_action.cc
   branches/aptitude-0.3/aptitude/src/generic/problemresolver/problemresolver.h
Log:
Fix compile problems.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sun Apr 10 13:53:30 2005
@@ -1,5 +1,10 @@
 2005-04-10  Daniel Burrows  <dburrows@debian.org>
 
+	* src/generic/problemresolver/problemresolver.h:
+
+	  Add missing "const"s to some function prototypes, comment out
+	  some non-generic debug code.
+
 	* src/generic/aptitude_resolver.cc, src/generic/aptitude_resolver.h:
 
 	  Rename add_scores -> add_actions_scores, and write

Modified: branches/aptitude-0.3/aptitude/src/cmdline/cmdline_do_action.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/cmdline/cmdline_do_action.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/cmdline/cmdline_do_action.cc	Sun Apr 10 13:53:30 2005
@@ -176,10 +176,13 @@
 
   // Try to avoid removing packages; prefer keeping them or even
   // upgrading.
-  resolver.add_scores(50, 25,
-		      -50, -10,
-		      -20, -15,
-		      -40);
+  resolver.add_action_scores(50, 25,
+			     -50, -10,
+			     -20, -15,
+			     -40);
+
+  // Prefer higher-priority versions of packages (not excessively)
+  resolver.add_priority_scores(5, 4, 3, 1, -1);
 
   // See what happens (for the debugging output).
 

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	Sun Apr 10 13:53:30 2005
@@ -590,25 +590,25 @@
     package source_package=source_version.get_package();
     version sol_version=s.version_of(source_package);
 
-    if(d.solvers_begin().end())
-      {
-	std::cout << "No solvers for " << d.get_dep().ParentPkg().Name() 
-		  << " " << d.get_dep().DepType() << " "
-		  << d.get_dep().TargetPkg().Name();
-	if(d.get_dep().TargetVer())
-	  std::cout << " (" << d.get_dep().CompType()
-		    << " " << d.get_dep().TargetVer() << ")";
-
-	if(!d.get_prv().end())
-	  std::cout << "  (through "
-		    << d.get_prv().OwnerPkg().Name() << " "
-		    << d.get_prv().OwnerVer().VerStr()
-		    << " Provides "
-		    << d.get_prv().ParentPkg().Name()
-		    << ")";
+//     if(d.solvers_begin().end())
+//       {
+// 	std::cout << "No solvers for " << d.get_dep().ParentPkg().Name() 
+// 		  << " " << d.get_dep().DepType() << " "
+// 		  << d.get_dep().TargetPkg().Name();
+// 	if(d.get_dep().TargetVer())
+// 	  std::cout << " (" << d.get_dep().CompType()
+// 		    << " " << d.get_dep().TargetVer() << ")";
+
+// 	if(!d.get_prv().end())
+// 	  std::cout << "  (through "
+// 		    << d.get_prv().OwnerPkg().Name() << " "
+// 		    << d.get_prv().OwnerVer().VerStr()
+// 		    << " Provides "
+// 		    << d.get_prv().ParentPkg().Name()
+// 		    << ")";
 
-	std::cout << std::endl;
-      }
+// 	std::cout << std::endl;
+//       }
 
     // if not, then the dep is satisfied!
     assert(sol_version == source_version);
@@ -683,7 +683,7 @@
    *  result in a bias towards that version appearing in the final
    *  solution.
    */
-  void set_version_score(version &ver, int score)
+  void set_version_score(const version &ver, int score)
   {
     assert(ver.get_id()<universe.get_version_count());
     version_scores[ver.get_id()]=score;
@@ -692,14 +692,14 @@
   /** As set_version_score, but instead of replacing the current score
    *  increment it.
    */
-  void add_version_score(version &ver, int score)
+  void add_version_score(const version &ver, int score)
   {
     assert(ver.get_id()<universe.get_version_count());
     version_scores[ver.get_id()]+=score;
   }
 
   /** \return the score of the version ver. */
-  int get_version_score(version &ver)
+  int get_version_score(const version &ver)
   {
     assert(ver.get_id()<universe.get_version_count());
     return version_scores[ver.get_id()];