Commit Graph

119 Commits (462bb3b8d3e9e88369e385ab770020e3ab20b041)

Author SHA1 Message Date
Timo Teräs 462bb3b8d3 solver: if pinning is specified, it overrides preferred repos
add also a test case for this
2013-09-06 14:21:59 +03:00
Natanael Copa ed06091189 solver: do not disqualify already disqualified packages
We should not disqualify non-selectable packages as it would mark it as
dirty, forcing it to reconsider the name again, which could end up in
an endless loop.

fixes #2135
2013-07-17 08:31:40 +03:00
Timo Teräs 4fad6d9c15 solver: use ffs (posix) instead of ffsl (gnu extension)
for musl compatibility
2013-07-04 09:00:23 +03:00
Timo Teräs 3f27da2ade solver: fix pinning+cache to work
Mistakenly allowed masked out package to be installed if it was
in cache.
2013-06-20 14:08:16 +03:00
Timo Teräs 17145f82ae solver: fix package deletion to consier provides properly 2013-06-19 21:39:01 +03:00
Timo Teräs e4c65886dd solver: properly order deletion of unneeded packages 2013-06-19 20:46:53 +03:00
Timo Teräs a984fd3679 solver: add logic: transitive provides exclusion
If name N is required, and all providers of A also provide B, it
means that only instances of B can be selected that provide N. This
is strong help with cases when so:libfoo.so.1 is updated to
so:libfoo.so.2 and not everything is recompiled.
2013-06-19 13:15:53 +03:00
Timo Teräs d315c9019c upgrade: new option: --latest (-l)
Select latest version of package (if it is not pinned), and print
error if it cannot be installed due to other dependencies.

Together with --available, it selects the latest package which is
present at least in some repository.

This also fixes few solver issues with ordering of package selection
that got quite apparent with this flag. Namely, we cannot "lock"
a package until it's reverse dependencies are locked or not all of
the solver flags are propagated properly.
2013-06-19 08:33:51 +03:00
Timo Teräs 01ec60f718 errors: improve analysis for virtual packages
if all packages named N provide the virtual package, list only the
name N instead of all packages providing it.
2013-06-18 08:03:40 +03:00
Timo Teräs 9d10037807 db: refactor repository file construction
Fixes also 'fetch' applet to prefer copying/linking to files from
cache if possible.
2013-06-17 14:38:27 +03:00
Timo Teräs 56b623b9e2 solver: use array_foreach_item and clean ups 2013-06-14 21:24:33 +03:00
Timo Teräs e51232e710 errors: rewrite the logic how errors are reported
Instead of the dependency oriented logic, switch to print them
for each package or name needed. Might give a bit more readable
errors now. There's still few corner cases that proper error is
not output, which are cought by the test cases.
2013-06-13 18:22:00 +03:00
Timo Teräs 25ff68a87e solver: prune broken world dependencies with --force
mostly useful for reboot, when all packages are not available.
2013-06-13 18:22:00 +03:00
Timo Teräs 59678309ea solver: corner case fixes
- try harder to not change anything during self-upgrade
- also honor locking to packages that where earlier used in
  merging common dependencies
- clarify upgrade applet help messages
2013-06-13 18:22:00 +03:00
Timo Teräs e7fd4d03bf solver: rewrite as deductive solver -- pinning support
Fix also pinning test cases to be more sane.
2013-06-13 18:22:00 +03:00
Timo Teräs 426a12686e solver: rewrite as deductive solver -- per name flags
Handle properly per-name preference flags, and add test cases
for testing those via fix applet.
2013-06-13 18:22:00 +03:00
Timo Teräs b8c44536ca solver: rewrite as deductive solver -- core features
Implementing basic dependency handling, install_if and awareness
of pinning.
2013-06-13 18:22:00 +03:00
William Pitcock 860aa642f0 Revert "Revert "solver: increase score fields to 32-bits (from 16-bits)""
This reverts commit a2d873a77c.
2013-06-12 10:47:11 -05:00
root a2d873a77c Revert "solver: increase score fields to 32-bits (from 16-bits)"
This reverts commit 84bfef1a6b.
2013-06-11 10:30:31 -05:00
Timo Teräs aec93ee730 db: unify handling of special packages
make cache a special kind of repository, and automatically cache
special packages (virtual packages, or ones installed from command
line). add test cases for handling virtual packages. fixes #1617.
2013-05-30 08:48:32 +03:00
Timo Teräs 84bfef1a6b solver: increase score fields to 32-bits (from 16-bits)
We are having so many packages that they might overflow otherwise.
"ERROR: Preference overflow" was already reported.
2013-04-29 14:14:57 +03:00
Timo Teräs 72cd34cf81 solver: remove backjumping by name
It is incorrect optimization causing valid solutions to be skipped.
Any performance it might've gained, should be fixed by reintroduction
of the minimum penalty logic added in previous commit.
2013-01-28 15:34:09 +02:00
Timo Teräs cb98b55b7e solver: reintroduce minimum penalty logic
Basic per-name per-package specific scoring added.
2013-01-28 15:31:34 +02:00
Timo Teräs 528156a9fa solver: do not backtrack over "exclude none"
Otherwise we can return no solution at all instead of partially
satisfied solution (and give proper error message).
2013-01-22 16:23:16 +02:00
Timo Teräs 93bd305713 solver: simplify strength evaluation in constraint handling 2013-01-21 15:37:23 +02:00
Timo Teräs 2a194f3e7b solver: check if solution is not found at all
This is an internal error.
2013-01-21 09:12:44 +02:00
Timo Teräs b960759daa solver: fix reset of last_touched to zero 2013-01-18 16:21:38 +02:00
Timo Teräs cb15b31b79 solver: some code clean ups 2013-01-18 16:20:55 +02:00
Natanael Copa 3c40070752 solver: build fix for debug print on x86_64
use %zu for size_t
2013-01-18 14:46:25 +01:00
Timo Teräs 86a7338575 solver: fix name assignment logic to not mess up internal state
Should get rid of error messages like:
ERROR: Saved_score {4/0/0,74} != score {6/0/0,74}
2013-01-18 11:38:31 +02:00
Timo Teräs 832dfed637 solver: fix package prefence calculation a bit 2012-11-04 12:13:19 +02:00
Timo Teräs 16b70566bf solver: additional backjumping scheme
Enabled when all attempts to satisfy a name failed, we know that we
can ignore all decisions until we find a decision affecting the name
we wanted to satisfy.
2012-10-08 15:22:06 +03:00
Timo Teräs 01d0e4c408 solver: optimize backjumping
to be functional when backtracking
2012-10-08 12:25:43 +03:00
Timo Teräs 831bce5cf9 solver: properly calculate decision "strength" with provides 2012-10-08 11:50:52 +03:00
Timo Teräs dec409c6d4 solver: fix back jumping once more 2012-10-05 17:26:53 +03:00
Timo Teräs bc7e8f5da8 solver: record dependency apk_name in apk_decision
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-05 15:48:12 +03:00
Timo Teräs 4dd8c58df9 solver: various fixes
* 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-03 15:07:31 +03:00
Natanael Copa 081155c438 solver: improve assert error messages
Print name of package and void double "ERROR"
2012-10-03 09:16:28 +02:00
Natanael Copa 00958d9207 solver: fix compile with -Werror on 64bit 2012-10-03 09:04:35 +02:00
Timo Teräs 43850a126b apk: implement --progress-fd to write progress to a specified fd 2012-09-20 15:12:15 +03:00
Timo Teräs bbba72c694 solver: fix install_if triggers on cyclic and early deps 2012-04-27 09:13:11 +03:00
Timo Teräs 29c7fb359e solver: fix backtracking with install_if dependencies 2012-04-27 08:47:20 +03:00
Timo Teräs 7458e4d3f4 solver: fix a type from previous commit 2012-03-31 23:31:43 +03:00
Timo Teräs a57db1bba0 solver: fix installation of non-repository packages 2012-03-31 23:27:15 +03:00
Timo Teräs 5ae0206d0b solver: properly set allowed flag for installed packages 2012-03-01 15:17:58 +02:00
Timo Teräs 3e429a8100 solver: rename some fields 2012-02-29 13:15:10 +02:00
Timo Teräs 2f66295fc7 solver: merge apk_name_state to apk_name
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-29 11:26:12 +02:00
Timo Teräs f27f194d92 solver, test: make conflicts unconditional
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-29 08:53:43 +02:00
Timo Teräs ef53dd52c5 solver: ask confirmation in interactive mode only if there's changes 2012-02-28 11:32:39 +02:00
Timo Teräs c7bd973367 solver: do not consider non-allowed packages in main loop
Instead cache the allowed pinning decision, and use it. Update
install decision heuristic to also use this cached information.
2012-02-28 11:27:56 +02:00