Clemens Lang [Sat, 30 May 2015 19:56:22 +0000 (21:56 +0200)]
Fix incorrect comparison with multiple values
a == X || Y
is valid C, but does interesting things and probably not what you would
expect. Luckily, clang warns for this kind of problem:
warning: use of logical '||' with constant operand [-Wconstant-logical-operand]
Fix this by using the proper comparison logic, which is
a == X || a == Y
Signed-off-by: Clemens Lang <neverpanic@gmail.com>
Clemens Lang [Wed, 10 Jun 2015 23:07:16 +0000 (01:07 +0200)]
Fix library install names on OS X
Libraries on OS X are referenced using abolute paths. When linking
against a library, its so-called install name is copied into the binary
to reference the library. CMake supports setting this install name using
the INSTALL_NAME_DIR target property.
Signed-off-by: Clemens Lang <neverpanic@gmail.com>
Clemens Lang [Wed, 10 Jun 2015 23:14:59 +0000 (01:14 +0200)]
Add warnings for missing parts in new languages
This should simplify porting the libsolv bindings to new languages
because rather than failing with a cryption SWIG error, these warnings
should give developers a hint what needs to be done at minimum.
Signed-off-by: Clemens Lang <neverpanic@gmail.com>
Clemens Lang [Sat, 30 May 2015 13:29:43 +0000 (15:29 +0200)]
Implement libsolv Tcl bindings
Add the necessary build system changes and modifications in the SIWG
interface definition file to enable generation of Tcl bindings. The
build system generates and installs a Tcl module that can used from
tclsh using
% package require solv
Constants and operations are available in the solv:: namespace, e.g.
% puts $solv::Solver_POLICY_ILLEGAL_DOWNGRADE
will echo "1".
Rudimentary testing has been done, but this should be considered
experimental for now. We will fix problems as we encounter them.
Signed-off-by: Clemens Lang <neverpanic@gmail.com>
We now start with level == 0, which means that we need to do
the assertions. Also, we now return 0 from analyze_unsolvable,
meaning the assertions are no longer done there.
Instead of having a bastard solver_addrule which wither takes an offset
into whatprovides or a direct literal, we now have two functions:
solver_addrule2 will add a rule with one or two literals
solver_addrulen will add a rule specified by an offset into whatprovides
This should make the code cleaner, faster, and less memory is used also.
This commit also adds a pool_ids2whatprovides function.
Clemens Lang [Mon, 11 May 2015 17:54:51 +0000 (19:54 +0200)]
Avoid linker flags when not available, fixes OS X
The build currently fails on OS X because the OS X linker ld64 does not
support --as-needed or --version-script. Fix this by checking whether
these flags are supported by the currently used linker and only passing
them if they are.
We now use the installsuppdepq idea for packages as well. This also
has the positive side-effect that a supplements with an OR is
installed if one of the ORed packages is installed/updated and the
other was already installed.
We no longer consult the updatmap, but now check if a package was
updated with the update rule. This is so that we don't get
false positives if a package can't be updated for whatever
reason.
Multiple changes:
- we no longer prune to suggests/enhances, instead we move them
to the front so that a branch is created. This enables auto-minimization
later on.
- we de-prefer old versions, i.e. packages that have an update candidate.
- If there are common versioned dependencies, we use them to order
the packages.
No more dependency rewiting, plus support for complex deps.
Note that we can no longer support the .arch suffix, as many
dependency names contain a '.' and we don't know all valid
architectures. So you need to use 'name . arch' instead of
'name.arch'.
This can be used to read the autoinstalled package list from
/var/lib/apt/extended_states. Note that the pool must have
the whatprovides hash in place for this to work.
Yevhen Kyriukha [Thu, 29 Jan 2015 02:03:04 +0000 (04:03 +0200)]
Save "Status" field of debian packages during parsing of packages list.
When populating packages from "/var/lib/dpkg/status" into repo that should be marked as "installed repo",
there should be possible to filter partially installed packages based on their "Status" field.
This commit makes saving this field for later manual filtering.
fix solver_addpkgrulesforweak missing some splitprovide packages
This was because the updatemap gets extended when the dup rules
are created, but the map already gets used in solver_splitprovides.
So temporarily set updatemap_all in that case.
The next level is actually "level + 1", so by using level we punch
zeros in our decisionmap leading to some nasty bugs later on
(e.g. when we need to revert).