summaryrefslogtreecommitdiff
path: root/src/solver.c
AgeCommit message (Collapse)AuthorFilesLines
2012-10-05solver: fix back jumping once moreTimo Teräs1-17/+33
2012-10-05solver: record dependency apk_name in apk_decisionTimo Teräs1-51/+19
We can't just use the primary name, as that would mess up backtracking. We need to record the name which caused the name to get considered - that way the right last_touched_decision is used on backtracking.
2012-10-03solver: various fixesTimo Teräs1-14/+58
* push_decision expects to always get the package primary 'name' as apk_name. ASSERT that and fix problem cases. (though - this might need to be reverted, and store the non primary name in apk_decision instead to accomodate for better backtracking optimizations) * fix error reporting of virtual package names * make 'assign_name' errors soft. the incorrect packages just are no longer consider instead of aborting whole calculation. * fix backtracking of virtual packages that are not depended directly
2012-10-03solver: improve assert error messagesNatanael Copa1-2/+3
Print name of package and void double "ERROR"
2012-10-03solver: fix compile with -Werror on 64bitNatanael Copa1-1/+1
2012-09-20apk: implement --progress-fd to write progress to a specified fdTimo Teräs1-17/+27
2012-04-27solver: fix install_if triggers on cyclic and early depsTimo Teräs1-11/+15
2012-04-27solver: fix backtracking with install_if dependenciesTimo Teräs1-17/+20
2012-03-31solver: fix a type from previous commitTimo Teräs1-1/+1
2012-03-31solver: fix installation of non-repository packagesTimo Teräs1-1/+2
2012-03-01solver: properly set allowed flag for installed packagesTimo Teräs1-3/+6
2012-02-29solver: rename some fieldsTimo Teräs1-24/+25
2012-02-29solver: merge apk_name_state to apk_nameTimo Teräs1-223/+136
apk_name_state is now quite small; and we avoid overhead of two pointers (+ malloc overhead) when we just make it part of apk_name. It also fixes some problems (that got introduced) where apk_name_state was not allocated.
2012-02-29solver, test: make conflicts unconditionalTimo Teräs1-13/+36
Solver will now never report partial solution where a conflict constraint is not satisfied. The is because with --force we might install the partial solution; and if conflicted packages were to be installed we might have extra trouble.
2012-02-28solver: ask confirmation in interactive mode only if there's changesTimo Teräs1-1/+2
2012-02-28solver: do not consider non-allowed packages in main loopTimo Teräs1-43/+32
Instead cache the allowed pinning decision, and use it. Update install decision heuristic to also use this cached information.
2012-02-28solver: consider provided names also for preferenceTimo Teräs1-2/+13
ref #574
2012-02-28solver: fix conflicting provides detectionTimo Teräs1-2/+15
ref #574
2012-02-28solver: allow multiple packages with same virtual providesTimo Teräs1-8/+14
ref #574
2012-02-27solver, test: implements more provides things, add testsTimo Teräs1-30/+92
ref #574
2012-02-27solver: have most inherited things per-package and clean upsTimo Teräs1-156/+168
Required for provides support as package might be pulled in via non-primary package name. This allows relatively easily to pass through inherited flags via the provided names. ref #574.
2012-02-27solver: remove minimum penalty logicTimo Teräs1-49/+7
Reasoning: - it is less useful now that we do not do common dependency merging - provides support would make the required logic overly complicated - callgrind reports that depending on the case it can improve or decrease performance (the overhead pays off only in some cases); the difference is not large either way
2012-02-24solver, dot: elementary provides fixesTimo Teräs1-21/+57
implementation is still not near finished, but now at least it can handle it to a minimum degree. many cases are not done right yet, though. ref #574.
2012-02-24all: introduce apk_provides and use it in apk_nameTimo Teräs1-73/+79
in preparation for provides support. implements also some dependency satisfaction helper routines. ref #574.
2012-02-24solver: unallowed pinning is worse than changing installed packageTimo Teräs1-10/+7
2012-02-24solver: non preferred actions are worse then non preferred pinningTimo Teräs1-6/+16
Otherwise we might start to change packages unexpectedly when not upgrading. This also fixes some other things the solver might've decided to do. Add also few test cases to detect bad behaviour.
2012-02-24test: improve pinning testsTimo Teräs1-1/+4
2012-02-23solver: fix output of broken dependenciesTimo Teräs1-1/+1
2012-02-23solver: report size difference in kibi- or mebibytesTimo Teräs1-5/+11
2012-02-22solver: lock early names that have only single option leftTimo Teräs1-3/+13
care is needed to get the score right.
2012-02-22solver: lazily update name state in main loopTimo Teräs1-171/+125
2012-02-22solver: handle fix/reinstall betterTimo Teräs1-30/+36
In case someone did "fix --force" for package for which we have no APK available, we would uninstall the package instead of silently ignoring the request. This could mean worse things. So now we just consider unavailable packages a bad deal for reinstall requests. And will downgrade if necessary. But if we really don't have any APK available, we just skip the request but report it.
2012-02-22solver: transitive dependency requiringTimo Teräs1-12/+41
If n+1 packages depend A, and A depend on B. Add n+1 dependencies to B. Otherwise if someone conflicts B, B might be left out. Leaving package unassigned is no longer a non-preferred action, this fixes the final test case that was failing. And with --force we might even install that scenario. Add also some debug checks.
2012-02-22solver: remove dependency merging; it's not worth itTimo Teräs1-77/+4
callgrind says it's more overhead than improvement. back jumping effectively prunes all bad trees. but can be added later if it becomes needed; due to e.g. provides support.
2012-02-22db, solver, io: scan cache items at startupTimo Teräs1-42/+36
It is faster to just scan the cache directory for existing packages at startup than trying to faccessat() them on demand. It also makes quite a few parts of the code more readable and simpler.
2012-02-21solver: make apk_score a 64-bit int for speedTimo Teräs1-9/+49
2012-02-21solver: remove unneeded flagTimo Teräs1-4/+1
2012-02-21solver: implement backwards jumping and various other optimizationsTimo Teräs1-149/+215
2012-02-20solver: rewrite backtracking and scoring systemTimo Teräs1-406/+690
* properly do absolute scoring now, the previous scoring where preference could get reduced could have caused incorrect early pruning of search tree * backtracking is now separated from package state, and first branching point is the decision if a name is left unassigned or if something _has_ to be assigned. this allows multiple future search tree optimizations like handling of common dependencies early. * merge common dependency names early to provide deeper forward checking.
2012-02-17apk: fix some unharmful leaks reported by valgrindTimo Teräs1-0/+1
2012-02-17solver: get rid of saved score in backtrackingTimo Teräs1-41/+57
also, discover late if package is needed or not.
2012-02-16solver: convert some package state flags to bitfieldsTimo Teräs1-11/+13
2012-02-16solver: name's unlocked chosen is always next package getting lockedTimo Teräs1-35/+28
Instead of "skipping" certain packages, we include them as-if required, and at expansion time we decide if they actually need to be considered for installation. This cleans up the expansion main loop a little bit and makes the code work together better.
2012-02-16solver: rework internals a bitTimo Teräs1-138/+190
* cleaned up little bit on the internal state machine * the decision applying mechanism now aborts early to avoid work if we are approaching bad solution candidate * package availability checking is now done on-demand; which could still be improved
2012-02-16solver: fix allowed pinning calculationTimo Teräs1-2/+2
2012-02-16solver: record repository tag, and flags in solutionTimo Teräs1-55/+92
name state could get overwritten later, so we can't use that when generating the changeset.
2012-02-16solver: remove an unneeded name state variableTimo Teräs1-5/+0
2012-02-15solver, db: repository pinning improvementsTimo Teräs1-48/+73
* solver internally calculates now using tags; not repository masks * installeddb now contains the tag name where the package came from -> we can now handle upgrades properly * the pinning is still a preference, and not strictly enforced; versioned dependencies may overrule preference
2012-01-20solver: fix regression from "calculate branch minimum penalty early"Timo Teräs1-7/+21
Forgot to reset per-name penalty when it got locked by apply_decision. This also fine tunes compare_package_preference() to always prefer packages specified on command line speeding up calculation certain complicated solutions.
2012-01-17solver, upgrade: properly detect missing repository tagsTimo Teräs1-2/+2
* upgrade needs explicit check so we don't try self-upgrade (which would print additional messages on screen) * add can fix problems, so check against the new world * merge the code in few places