This class represents a single dependency statement. It has several interesting properties:
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. It is undefined when there's no restriction, otherwise it is 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 there is none). In the dependency “python:any (>= 2.6)”, the arch qualifier is “any”.
The restrictions formula for this dependency. It is undefined when there is no restriction formula. Otherwise it is an array ref.
- $dep = Dpkg::Deps::Simple->new([$dep[, %opts]]);
Creates a new object. Some options can be set through
Sets the host architecture.
Sets the build architecture.
Specifies whether the parser should consider it a build dependency. Defaults to 0.
Specifies whether the parser should consider it a tests dependency. Defaults to 0.
Clears any dependency information stored in
$dep->is_empty() returns true.
Parses the dependency string and modifies internal properties to match the parsed dependency.
- $dep->parse($fh, $desc)
Parse a dependency line from a filehandle.
Parse a dependency line from
Returns a string representing the dependency. If
$fhis set, it prints the string to the filehandle.
Save the dependency into the given
Returns 1 when
$other_dep. Returns 0 when
$depimplies NOT($other_dep). Returns undef when there is no implication.
$other_depdo not need to be of the same type.
Returns a list of sub-dependencies, which for this object it means it returns itself.
This method is a no-op for this object.
Returns true if the dependency applies to the indicated architecture.
Simplifies the dependency to contain only information relevant to the given architecture. This object can be left empty after this operation. This trims off the architecture restriction list of these objects.
Returns the package name if the dependency applies only to a subset of architectures.
Returns true if the dependency applies to the indicated profile.
Simplifies the dependency to contain only information relevant to the given profile. This object can be left empty after this operation. This trims off the profile restriction list of this object.
Evaluates the dependency given a list of installed packages and a list of virtual packages provided. These lists are part of the Dpkg::Deps::KnownFacts object given as parameters.
Returns 1 when it's true, 0 when it's false, undef when some information is lacking to conclude.
- $dep->simplify_deps($facts, @assumed_deps)
Simplifies the dependency as much as possible given the list of facts (see class Dpkg::Deps::KnownFacts) and a list of other dependencies that are known to be true.
Returns true if the dependency is empty and doesn't contain any useful information. This is true when the object has not yet been initialized.
Returns true if
$depcould be modified to represent the union of both dependencies. Otherwise returns false.
Version 1.02 (dpkg 1.17.10)
New methods: Add
Version 1.01 (dpkg 1.16.1)
New method: Add
New property: recognizes the arch qualifier “any” and stores it in the “archqual” property when present.
Version 1.00 (dpkg 1.15.6)
Mark the module as public.