As we need the ruelinfo to do this, we also put them into the
returned data, so we now have (litpkg, rid, type, from, to, dep)
hexels instead of the (litpkg, rid) tupels.
This functionality is useful for multiple programs that use
libsolv, so it does not make sense to duplicate the code
into each of them.
So we now offer solver_get_decisionlist() to get a list of
decisions that let to the installation/deinstallation of a
package. There is also solver_get_decisionlist_multiple() that
can be used if multiple packages should be considered.
The output is a list of (package, reason, info) triplets.
Package is positive for installs, negative for conflicts.
This commits also deprecates solver_describe_weakdep_decision().
it makes more sense to unify weakdep decisions with rule
decisions as both come from package dependencies.
So we now have solver_allweakdepinfos() and solver_weakdepinfo()
that returns the ruleinfo for a weakdep decision. You can then
use solver_ruleinfo2str() to convert the ruleinfo to a string.
solver_get_learnt: return all rearnt rules used in the proof
of a problem or another learnt rule.
solver_get_proof: return the decisions that led to the
problem or learnt rule.
Note that this is experimental and subject to change. We will
need to add some sorting code to solver_get_proof() to group
similar steps, but this means that we need to get the
ruleinfo for the involved rules. But in that case we can
as well also return the ruleinfo data with the call.
Jon Turney [Sun, 14 Aug 2022 17:45:20 +0000 (18:45 +0100)]
Ensure duplinvolvedmap_all is reset when a solver is reused
Otherwise, if solver is used with a SOLVER_DISTUPGRADE job, then reused
without one, this will cause solver_addduprules() to be called, even
though needduprules is 0, which will crash trying to dereference
solv->dupmap, which is NULL because solver_createdupmaps() hasn't been
called.
conda: add support for package signature verification
This commits adds SOLVABLE_SIGNATUREDATA which contains the data
needed to verify the signatures of a package. You will need
to pass CONDA_ADD_WITH_SIGNATUREDATA to the flags in the
repo_add_conda call to enable this.
banjiuqingshan [Sat, 18 Jun 2022 17:43:51 +0000 (01:43 +0800)]
Fix memory leak when using testsolv to execute cases
*resultp will only keep the pointer of the last cycle, which will lead to memory leakage.
This solves the first memory leak problem in issue #496 "==255147==error..."
New strategy: take the package update map into account when creating
choice rules. This simplifies the code quite a bit. Also check at
the end of the solving if a choice rule led to two packages providing
the same thing. In that case, break the choice rule and re-run the
solver.
Userdata can be arbritrary (binary)data with a maximum size of
65535 bytes. It can be read without reading the complete
solv file, but do not forget to rewind the fp after reading
the user data.
New functions:
void
void repowriter_set_userdata(Repowriter *writer, const void *data, int len)
int solv_read_userdata(FILE *fp, unsigned char **datap, int *lenp)
niner [Tue, 8 Feb 2022 17:10:54 +0000 (18:10 +0100)]
Fix segfault on conflict resolution when using bindings
Solutionelement objects were created with a wrong solutionid (i.e. the
solution element id was used for the solutionid field). This led to invalid
array indexes when trying to read the extraflags which then escalated
into a segfault. Fix by setting solutionid correctly in the Solutionelement
constructor.
Try to keep packages from a cycle close togther in the transaction order
If there are multiple free-to-install packages and we pick a
package from a cycle, we should try to finish the cycle as
fast as possible to keep the time where we have an inconsistent
system as small as possible.
Lukáš Hrázký [Fri, 15 Oct 2021 13:51:19 +0000 (15:51 +0200)]
Add an ifdef allowing to rename Solvable dependency members
In C++20 "requires" is a new keyword, causing a conflict with the
Solvable::requires attribute. From the outside this can only be fixed
with an ugly preprocessor redefinition of the symbol around each libsolv
header include.
This commit adds an #ifdef allowing to rename the dep attributes in case
C++20 or higher is used, which can be easily defined in one place in the
libolv user's build system.
- add flag to bindings
- support flag/ruletype in testcases
- support strict repo prio problems in solution generation
- implement automatic disabling of strict repo rules due to install jobs
- add a testcase
For some reason libxml2 insists on re-escaping '&' characters
by substituting them with "&". The rpm dependencies are
stored in attributes, so this is not an academic matter.
Undo the damage done by libxml2 by replacing all & occurences
by a single '&'.