summaryrefslogtreecommitdiff
path: root/src/generic/apt/aptitude_resolver.h
AgeCommit message (Collapse)AuthorFilesLines
2010-04-20Allow "conflict" to be specified as a safety level again, with its old ↵Daniel Burrows1-0/+11
behavior, and fix setting safety levels using the old names. aptitude's behavior should now be fully compatible with pre-0.6.2 releases (by default). The safety level change fixes the fact that you could raise safety levels using the old names but not lower them.
2010-04-09Terminology change: replace "tier operation" with "cost" everywhere.Daniel Burrows1-4/+4
The only remaining references to tiers are in backwards-compatibility code; the "safety" cost component is composed of several "tiers" whose values can be configured.
2010-04-08Fix the prototype of aptitude_resolver's constructor to correctly declare ↵Daniel Burrows1-0/+1
that it takes a break-soft-dep tier operation.
2010-03-15Actually initialize the component name of hints.Daniel Burrows1-1/+1
That this didn't cause a unit test failure indicates a hole in the unit tests...which I don't have time to plug right now.
2010-03-15Write the backend half of the code to support customizable cost components.Daniel Burrows1-1/+6
Still needed: a parser, unit tests, documentation, and the final tying-together code in resolver_manager.
2010-03-15Introduce new hint types to tweak cost components.Daniel Burrows1-26/+51
This also starts to introduce the concept of a "cost component": an intermediate counter of some sort that can be used to assemble a cost. The eventual goal is to haved named components, like "removals" and "upgrade-cancels", and operators that combine them to form new cost components, like "removals + upgrade-cancels". "cost component" / "cost" is the terminology I eventually want to move towards, in favor of the confusing and badly-chosen "tier level" and "tier". This commit starts to introduce that terminology, and all my new commits will use it (except where local consistency demands otherwise). Eventually I need to make a pass over the code and rename lots of stuff.
2010-03-05Overhaul the resolver to distinguish between tiers and changes to tiers; ↵Daniel Burrows1-17/+18
this is the first step towards being able to minimize the number of changes meeting a criterion. The biggest change for this is that the new cost objects (tier operations) are not totally ordered, so various places that used to take a maximum now take a least-upper-bound instead; similarly for minimum and greatest-lower-bound. Still to do: find a sound way to allow the resolver to add together costs instead of upper-bounding them: "this change will force us to remove 10 packages". The new code seems to be a little too slow -- probably it lost some optimizations by accident. It does seem to be correct, though.
2009-03-29Reorganize and flesh out the code to get the tiering configuration.Daniel Burrows1-8/+0
This moves all those routines into aptitude_universe, because the code that will want to use them doesn't touch the resolver directly (only its output). Also implemented an (untested) routine to translate tiers into names in a configurable manner, and created a new logging domain for setting up initial tiers.
2009-03-29Write central routines for fetching the resolver's tier configuration.Daniel Burrows1-0/+8
2009-03-29Write support for resolver hints that adjust version tiers.Daniel Burrows1-27/+42
The syntax is "increase-tier-to TIER PACKAGE [VERSION]". The tier is either an integer, "conflict", or "minimum" (although "minimum" has no effect, so there's no point in using it).
2009-03-29Use tiering in the aptitude resolver to order returned solutions.Daniel Burrows1-1/+5
Right now the default tiers are: 10,000 -> "safe" solutions containing only new installs, upgrades and "keeps". 20,000 -> solutions that cancel all the user's actions. 30,000 -> solutions that remove packages. 40,000 -> solutions that break holds. 50,000 -> solutions that install non-default versions of packages. (the subordinate tier is the version priority) 60,000 -> solutions that remove Essential packages. Still to do: add tier hints, add a way to set tier names, show tiers and/or names in the UI (in place of the meaningless and confusing score value).
2009-03-29Make tiers be tuples of integers (lexicographically ordered) instead of ↵Daniel Burrows1-0/+4
plain integers. This allows us to classify solutions in a more fine-grained way. In particular, it provides a not-horrible way to integrate apt pin priorities into the resolver's decisions, by making them a subordinate level of ranking to the main tiering system. The current plan is that the first level of tiering is the only one the user sees (by default) and the only one that can be directly configured. The subordinate levels are filled in automatically (pin priorities are all I have in mind now, but I don't discount the possibility of introducing more levels in the future).
2009-03-23Restructure the resolver so that it stores and returns sets of choices using ↵Daniel Burrows1-2/+2
choice_sets, rather than manually storing the different types of choices in the solution object. This has two beneficial effects. First, it should make it a bit easier to add a new choice type, although many parts of the program will still have to be touched. Perhaps more importantly, this provides a cleaner conceptual model of what the resolver does: it finds "choice points" (that is to say, dependencies that need to be solved) and makes choices at them. This commit sneaks in a few optimizations that I came across in the process of rewiring all the resolver logic. The big one is that testing whether a solution violates a user constraint now requires steps proportional to the size of the solution, not to the number of user constraints. (each step is logarithmic in the number of constraints, but that's still a big improvement)
2009-02-16Allow user code to create customized resolver managers with different ↵Daniel Burrows1-0/+1
initial states. This can be used, for instance, to compute an upgrade without flagging the upgrade first.
2009-02-09Fix the prototype for aptitude_resolver::aptitude_resolver to match ↵Daniel Burrows1-0/+1
everything else (oops).
2009-02-05Initial pass over the resolver scoring code to ensure that it works with ↵Daniel Burrows1-0/+7
hypothetical installations.
2009-02-01Rename aptitude_resolver::resolver_hint to aptitude_resolver::hintDaniel Burrows1-21/+21
The old name was annoyingly long and also redundant.
2009-01-31When setting up the resolver, add scores that bias it towards installing ↵Daniel Burrows1-0/+13
dependency resolutions that apt would have. This needs some testing, as soon as I can figure out a good test case. The basic mechanism is to use the joint scores that have been in there for a while: if a dependency's targets aren't currently installed, we either apply a joint score to installing the depending package and the first dependency (the one apt would pick), OR (if the depending package is installed) we apply a score to the first dependency only. Note that this happens even for non-OR, non-virtual dependencies. Not sure if this is a good idea, or how to easily prevent it.
2009-01-31Fix some wrong comments: select_inst is the one that corresponds to a ↵Daniel Burrows1-1/+3
missing version, not select_all.
2009-01-17For consistency with the documentation, use "approve" instead of "accept" to ↵Daniel Burrows1-1/+1
mandate versions.
2009-01-16Parse hints from Aptitude::ProblemResolver::Hints, pass them into ↵Daniel Burrows1-2/+7
add_action_scores() instead of the resolver's constructor, and use them to configure the resolver. Still TODO: the code to account for actions performed on the resolver won't know about the hints and they won't be logged or printed with the debug output. Also, they need to be documented.
2009-01-16Implement operator!= on hints and version selectors.Daniel Burrows1-0/+2
2009-01-16Add a version selector type that only selects versions that are not equal to ↵Daniel Burrows1-0/+1
the given version.
2009-01-16Finish writing a parser for resolver hints.Daniel Burrows1-1/+7
2009-01-16Reverse the order of arguments we use when making a version comparison selector.Daniel Burrows1-2/+2
It makes more sense to me to put the operation first (as in, e.g., ">5.0").
2009-01-16Give the comparison operators better names.Daniel Burrows1-3/+3
2009-01-16Add a "inst" version selector that selects only versions that represent ↵Daniel Burrows1-0/+13
installing the package. This will be used, e.g., to describe a hint that says to reject a package entirely.
2009-01-16Add a version selector that selects all versions of a package.Daniel Burrows1-0/+11
2009-01-16Create a structured data type to store version comparison in resolver hints.Daniel Burrows1-19/+183
This commit also introduces the ability to select ranges of versions, not just individual versions, and the ability to compare two hints. All untested.
2008-10-06Switch everything over to the new search code.Daniel Burrows1-7/+9
This loses a little functionality in some places. Searches that go item-by-item (e.g., curses "/") are broken for ?term matchers (and hence also bare strings), and searches that return string groups (e.g., "aptitude search" with a format pattern containing substring IDs, or the "pattern" grouping policy) don't work. But other than that, everything should work.
2008-08-23Remove the max-successors option from the code and documentation.Daniel Burrows1-1/+1
I never found a good use for this option, its most likely effect is to lead to exponential blowup, and it makes it hard to efficiently implement the behavior of picking the broken dependency with the fewest number of successors.
2008-08-03Start working on a resolver hint mechanism.Daniel Burrows1-5/+115
2008-04-16Modified most header files descriptions to be Doxygen-parsable.Obey Arthur Liu1-14/+22
2008-03-14Write code to theoretically add appropriate scores / penalties to removing ↵Daniel Burrows1-0/+15
packages and installing their full replacements instead. Unfortunately, I can't test this: I don't have a handy example of a package that conflicts/replaces/provides another package (in the current archive there are no pairs where the replaced package is a real package, which makes sense). If nothing else, I can manufacture an example, maybe tomorrow though.
2008-03-06Allow the user to manually invoke the 'reject hold-breaking actions' logic.Daniel Burrows1-0/+5
2008-03-06When the resolver starts up, automatically reject forbidden versions and ↵Daniel Burrows1-1/+6
actions that break package holds. The user can override these rejects individually in the usual manner, or globally via Aptitude::ProblemResolver::Allow-Break-Holds. This should make the resolver's behavior a lot more intuitive for users, but it doesn't erase all the bugs on this subject due to the fact that apt's auto-install logic will break holds. This is one of many places (e.g., conflicts handling, reliable choices in safe-upgrade) where I think that apt's auto-install handling is dragging aptitude down. It may be time to replace it for good.
2008-02-04If we are allowed to generate the "cancel all actions" solution, the ↵Daniel Burrows1-1/+10
indicator will now say that it cancels everything instead of listing the component keeps that make it up.
2005-10-01[aptitude @ Import the Subversion repository into darcs.]Daniel Burrows1-0/+107