[Aptitude-devel] r2984 - in branches/aptitude-0.3/aptitude: . src/cmdline
Daniel Burrows
dburrows@costa.debian.org
Sun, 10 Apr 2005 01:03:07 +0000
Author: dburrows
Date: Sun Apr 10 01:03:04 2005
New Revision: 2984
Modified:
branches/aptitude-0.3/aptitude/ChangeLog
branches/aptitude-0.3/aptitude/src/cmdline/cmdline_do_action.cc
Log:
Hook up the new resolver to do dry runs on real problems.
Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog (original)
+++ branches/aptitude-0.3/aptitude/ChangeLog Sun Apr 10 01:03:04 2005
@@ -1,5 +1,10 @@
2005-04-09 Daniel Burrows <dburrows@debian.org>
+ * src/cmdline/cmdline_do_action.cc:
+
+ On dist-upgrade, etc, run the new resolver. Its output is
+ discarded -- this is just to see how it works on real problems.
+
* src/generic/aptitude_resolver.h, src/generic/problemresolver/problemresolver.h:
Further fixes for constness, typing problems.
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 01:03:04 2005
@@ -12,6 +12,7 @@
#include "cmdline_util.h"
#include <generic/apt.h>
+#include <generic/aptitude_resolver.h>
#include <generic/config_signal.h>
#include <aptitude.h>
@@ -167,6 +168,22 @@
}
(*apt_cache_file)->end_action_group(NULL);
+ // Ok, see what the aptitude fixer sez. Try penalizing brokenness
+ // fairly heavily:
+ aptitude_resolver resolver(-50, -10);
+
+ // Try to avoid removing packages; prefer keeping them or even
+ // upgrading.
+ resolver.add_scores(50, 25,
+ -50, -10,
+ -20, -15,
+ -40);
+
+ // See what happens (for the debugging output).
+ resolver.find_next_solution(10000);
+ resolver.find_next_solution(10000);
+ resolver.find_next_solution(10000);
+
if(dist_upgrade ||
(fix_broken && argc==1 && default_action==cmdline_install))
{