($rel_p, $v_p) and ($rel_q, $v_q) express two dependencies as (relation,
version). The relation variable can have the following values that are
exported by Dpkg::Version: REL_EQ, REL_LT, REL_LE, REL_GT, REL_GT.
This functions returns 1 if the p dependency implies the q
dependency. It returns 0 if the p dependency implies that q is
not satisfied. It returns undef when theres no implication.
The $v_p and $v_q parameter should be Dpkg::Version objects.
my $dep = deps_parse($line, %options)
This function parses the dependency line and returns an object, either a
Dpkg::Deps::AND or a Dpkg::Deps::Union. Various options can alter the
behaviour of that function.
use_arch (defaults to 1)
Take into account the architecture restriction part of the dependencies.
Set to 0 to completely ignore that information.
host_arch (defaults to the current architecture)
Define the host architecture. By default it uses
Dpkg::Arch::get_host_arch() to identify the proper architecture.
reduce_arch (defaults to 0)
If set to 1, ignore dependencies that do not concern the current host
architecture. This implicitely strips off the architecture restriction
list so that the resulting dependencies are directly applicable to the
union (defaults to 0)
If set to 1, returns a Dpkg::Deps::Union instead of a Dpkg::Deps::AND. Use
this when parsing non-dependency fields like Conflicts.
build_dep (defaults to 0)
If set to 1, allow build-dep only arch qualifiers, that is “:native”.
This should be set whenever working with build-deps.
Implements a comparison operator between two dependency objects.
This function is mainly used to implement the sort() method.
There are several kind of dependencies. A Dpkg::Deps::Simple dependency
represents a single dependency statement (it relates to one package only).
Dpkg::Deps::Multiple dependencies are built on top of this object
and combine several dependencies in a different manners. Dpkg::Deps::AND
represents the logical AND between dependencies while Dpkg::Deps::OR
represents the logical OR. Dpkg::Deps::Multiple objects can contain
Dpkg::Deps::Simple object as well as other Dpkg::Deps::Multiple objects.
In practice, the code is only meant to handle the realistic cases which,
given Debians dependencies structure, imply those restrictions: AND can
contain Simple or OR objects, OR can only contain Simple objects.
Dpkg::Deps::KnownFacts is a special object that is used while evaluating
dependencies and while trying to simplify them. It represents a set of
installed packages along with the virtual packages that they might
Returns true if the dependency is empty and doesnt contain any useful
information. This is true when a Dpkg::Deps::Simple object has not yet
been initialized or when a (descendant of) Dpkg::Deps::Multiple contains
an empty list of dependencies.
Returns a list of sub-dependencies. For Dpkg::Deps::Simple it returns
Returns a string representing the dependency. If $fh is set, it prints
the string to the filehandle.
Returns 1 when $dep implies $other_dep. Returns 0 when $dep implies
NOT($other_dep). Returns undef when theres no implication. $dep and
$other_dep do not need to be of the same type.
Sorts alphabetically the internal list of dependencies. Its a no-op for
Returns true if the dependency applies to the indicated architecture. For
multiple dependencies, it returns true if at least one of the
sub-dependencies apply to this architecture.
Simplifies the dependency to contain only information relevant to the given
architecture. A Dpkg::Deps::Simple object can be left empty after this
operation. For Dpkg::Deps::Multiple objects, the non-relevant
sub-dependencies are simply removed.
This trims off the architecture restriction list of Dpkg::Deps::Simple
Evaluates the dependency given a list of installed packages and a list of
virtual packages provided. Those lists are part of the
Dpkg::Deps::KnownFacts object given as parameters.
Returns 1 when its true, 0 when its false, undef when some information
is lacking to conclude.
Simplifies the dependency as much as possible given the list of facts (see
object Dpkg::Deps::KnownFacts) and a list of other dependencies that are
known to be true.
For a simple dependency, returns the package name if the dependency
applies only to a subset of architectures. For multiple dependencies, it
returns the list of package names that have such a restriction.
Clears any dependency information stored in $dep so that $dep->is_empty()
The package name (can be undef if the dependency has not been initialized
or if the simplification of the dependency lead to its removal).
The relational operator: =, <<, <=, >= or >>. It can be
undefined if the dependency had no version restriction. In that case the
following field is also undefined.
The list of architectures where this dependency is applicable. Its
undefined when theres no restriction, otherwise its an
array ref. It can contain an exclusion list, in that case each
architecture is prefixed with an exclamation mark.
The arch qualifier of the dependency (can be undef if theres none).
In the dependency python:any (>= 2.6), the arch qualifier is any.
Records that the given version of the package is installed. If
$version/$arch is undefined we know that the package is installed but we
dont know which version/architecture it is. $multiarch is the Multi-Arch
field of the package. If $multiarch is undef, it will be equivalent to
Note that $multiarch is only used if $arch is provided.
Records that the $by package provides the $virtual package. $relation
and $version correspond to the associated relation given in the Provides
field. This might be used in the future for versioned provides.
my ($check, $param) = $facts->check_package($package)
$check is one when the package is found. For a real package, $param
contains the version. For a virtual package, $param contains an array
reference containing the list of packages that provide it (each package is
listed as [ $provider, $relation, $version ]).
This function is obsolete and should not be used. Dpkg::Deps::KnownFacts
is only meant to be filled with data and then passed to Dpkg::Deps
methods where appropriate, but it should not be directly queried.