| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The bounds checking on the vector accesses is killing performance,
so switch from vector to a basic array, given that we don't actually
need _any_ functionality from vector...
Of course while we are at it, let us define a safe wrapper around
it so we cannot accidentally index arrays for package IDs with
version IDs and whatnot.
|
| | |
| |
| |
| |
| | |
operator[] is a bit annoying here, but oh well, what can we
do?
|
| | |
| |
| |
| |
| |
| | |
This makes Work trivially destructible, and in turn solved, allowing
their queues to be destructed without running destructors, and avoiding
the copy should have a nice performance improvement.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of iterating over the version here and picking it, just
enqueue the package as well, which should allow us to select the
version at a later time.
This also causes a funny inverse problem now, though, as was evidenced
in one of the test cases: To summarize, if our optional roots are all
single items, they will be considered soft-unit, causing them to be
processed in order.
However it can be that an optional root has a specific version
selected because another version was rejected. Consider
X Conflicts A (= 1)
A, B have 2 versions: '2' available, '1' installed
B (= n) Depends A (= n)
Run `apt install X`. The expected result is for A and B to be
upgraded to version 2. With only a package root, if B appears
in the cache before A however, we will get:
Install X
Reject A (= 1)
Install B
Install B (= 1) # keep it installed
Reject A (= 2)
=> A is being removed as both versions are rejected
Hence we do also need to re-introduce the additional version
clause, now we get:
Install X
Reject A (= 1)
Install A (= 2) # it got "promoted" to a 'stronger' soft-unit
Install B
Fail B (= 1) # keep it installed
Install B (= 2)
Introduce a root state to hold all the clauses that don't have
another owner.
moo
|
| | |
| |
| |
| |
| | |
This vastly simplifies the code at the expense of performance,
lol.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When comparing packages, we compare the best version for the
package. To determine the best version, the rules for comparisons
are applied normally.
This allows us to mix packages and versions in a clause as the
solutions for a dependency, which means we'll be able to defer
the selection of a particular version of a package to a later
time.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Just propagate the stored clauses after we have discovered them;
this is quite straightforward. We now more reliably discover common
dependencies at the package level, adjust the test case accordingly.
The next step is to make discovery recursive, or iterative, to build
an entire recursive tree from all roots, and then we can reject reverse
dependencies based on it.
A bunch of refactorings are needed in the process. We remove the
useless Hint enumeration and insert a flags struct into the State,
such that we can record whether a package/version has been
discovered, to avoid spending double time on discovery.
|
| | |
| |
| |
| |
| |
| |
| | |
This is not *purely* a refactoring, we accidentally used the
version of the dependency when enqueuing conflicts rather than
the reason, so the conflict string in the test case is different;
the logging had the same issue.
|
| | |
| |
| |
| |
| | |
Extract clause into a separate struct and embed a copy of it in
our Work class.
|
| | |
| |
| |
| | |
Reuse the generic variable rendering
|
| | | |
|
| | |
| |
| |
| | |
It's a bit silly otherwise.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This removes a bunch of complexity, and generalizes the
propagation behavior, such that we don't need to do
if (w.solutions.size() == 1 && not w.optional)
Enqueue()
else
AddWork(w);
in our callers.
|
| | |
| |
| |
| |
| | |
It is very important that we check the return value of all these
functions, otherwise the logic is wrong.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Store all possible solutions and choices as Var. Currently any
Var in here must be a Version because CompareProviders3 cannot
compare versions against packages yet, but in the future (TM),
this will allow storing packages directly in clauses, which allows
defering version selection to a later point.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Moving the optional != b.optional comparison ahead of the group
one allows us to get a better behavior; and now we avoid the nested
if.
Also remove the special cases that ordered based on the reason
of the work item, these have been superseded by groups a while
ago.
|
| |/
|
|
| |
This was leftover from before the groups were added.
|
| |\
| |
| |
| |
| | |
dpkg: Pass --admindir if a different one is specified
See merge request apt-team/apt!445
|
| |/
|
|
|
|
|
| |
Otherwise if we set e.g. Dir, we end up with the foreign
architectures from the host which is wrong.
Fixes: 8e6a86aa3bc6d5a9013bb42fccea9bbce3fd97e2
|
| |\
| |
| |
| |
| | |
edit-sources: don't force .list as suffix
See merge request apt-team/apt!448
|
| |/ |
|
| |\
| |
| |
| |
| | |
completion: modernize-sources #1094904
See merge request apt-team/apt!447
|
| |/
|
|
| |
Closes: #1094904
|
| |
|
|
|
|
|
| |
/dev/stdout may not exist, so let's instead just reference
the std::cout stream.
Reported-by: h01ger on IRC
|
| | |
|
| |\
| |
| |
| |
| | |
Correctly calculate kernel size in /boot
See merge request apt-team/apt!444
|
| | |
| |
| |
| | |
I don't know why I used a double here this is awkward.
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
Change the code to get the size from the existing vmlinuz,
rather than using the package size, which only worked in
Ubuntu, and possibly not on all kernel packages either.
Refactor the code a bit to avoid the nested if as well,
and use off_t to measure and sum the sizes before switching
to floating point.
Closes: #1085184
|
| |\
| |
| |
| |
| | |
Also support debian-ports modernization
See merge request apt-team/apt!443
|
| |/
|
|
| |
That just needs using '-' to replace spaces in Origin to get the keyring file name.
|
| |\
| |
| |
| |
| | |
`stats` rabbithole: Do not overflow ver/desc<->file relation counters
See merge request apt-team/apt!441
|
| | |
| |
| |
| |
| |
| | |
It is a tiny struct, so the difference in 'stats' is minor even with all
the versions but it is more correct and also helps in case the Extra
struct is changed to predictably trigger a binary cache invalidation.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Avoiding duplications is one thing, but it could also be handy to know
all sources for a description so that you can e.g. avoid opening another
file or similar such if its also present in one you already have open.
Given how the structures were set up this was probably intended all
along and either worked at some point or was abandoned for the
duplicates that we started culling heavily with the introduction of
MultiArch as at that point they blew up the cache and needed to be dealt
with.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
The architectures are supposed to share the descriptions as they are
(very usually) the same, but the code was happily creating structs
for every architecture of a package which is especially pointless as
for e.g. Debian those will be the short description likely superseded
in output and all uses by the 'en' "translation".
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Same reason as with the description size before, but this one had
actually one extremely dated user in src:apt left with dumpavail,
which is changed to an implementation that is (in comparison) a bit
slower, but should be good enough for a command that is ideally not
used anymore (even if codesearch suggests otherwise).
After all, what makes this a bit slower is not that we don't know the
size, but that this one does additional work preparing for accessing
the fields which we don't do. In exchange pkgTagFile has a better
implementation for "Jitter" than the old code that we would "just"
need to copy here if speed were really an issue.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Nothing in src:apt uses this information and that isn't all to
surprising as it is usually not that interesting to know how big
a specific stanza of a description is as the max size is available
and you are usually working with more than one description.
So this information just takes up space in our binary cacheā¦
64 bits per structure which can quickly add up to whole MBs
depending on how many (and which) sources you have enabled.
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The counters aren't used for anything really except for the 'stats'
command that is off in its display and calculation due to 16bit not
being enough for counting all the relations we have.
Semi-broken more than a decade ago as I accidentally aligned it with
the other file relation counters which count far less frequent ones
through, so 'unsigned long' should have been changed to the id type
rather than the smaller fileid type.
Of course, this commit only prepares the fix as this would be an ABI
break, so with the current ABI we are still overflowing.
Regression-of: 4ad8619bb1f0bf777d17c568bb7a6cf7f30aac34
|
| |
|
|
| |
Gbp-Dch: ignore
|
| |\
| |
| |
| |
| | |
solver3: Unit propagation queues
See merge request apt-team/apt!440
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of directly propagating in a recursive fashion,
queue propagations in a queue and work on them in a loop
per the miniSAT paper.
We call Propagate() only at the end of the FromDepCache()
function and then in the Solve loop. Delaying the initial
propagation means that we get a stronger reasoning:
Assume you have x->a->b->c, y->c and you install x,y:
- Previously we traversed: x, y, x->a, a->b, b->c, (y->c)
- but now we traverse: x, y, x->a, y->c, a->b, (b->c)
Notably c now has the implication y->c instead of x->a->b->c.
Inside the solver we need to call Propagate in a loop:
Propagating facts can fail and we then backtrack. If backtracking
is succesful, we have gained a new fact to propagate.
|
| | |
| |
| |
| |
| |
| | |
Do not enqueue common dependencies if a version is selected already,
this avoids test suites changing now in behavior as the ordering is
different.
|
| | |
| |
| |
| |
| |
| | |
This is more or less unused; but it particularly has the bad
problem of forcing new unsat recommends to be solved *before*
dependencies. Which is awkward.
|
| |/
|
|
|
| |
If both items are optional, unit items should be processed
first.
|
| |
|
|
| |
Closes: #1092563
|
| |\
| |
| |
| |
| | |
po/zh_CN.po: Refresh Simplified Chinese translation for apt
See merge request apt-team/apt!432
|
| |/ |
|