sourCEntral - mobile manpages

pdf

Fedora::Rebuild::Solver

NAME

Fedora::Rebuild::Solver − Dependency solver

CONSTRUCTOR

new(packages => $packages, dependencyfilter => sub {})
The constructor new prepares initilialize a depencency solver on top of a packackage set. Possible attributes are:
packages

Set of packages, Fedora::Rebuild::Set::Package object, with populated provides and requires. This attribute is mandatory.

dependencyfilter

Reference to a function with three arguments (dependency name, relation flag, version) returning false if the dependency should be considered, true otherwise. If attribute is "undef" or missing, no filtering will be performed (i.e. the same effect as "sub {1}"). This attribute is optional.

PRIVATE ATTRIBUTES

cache
This is cache of binary packages already resolved as installable or not installable.

To keep coherency, do not update "$self−>packages" or referenced packages. This is a reference to hash of binary package names. Values hold a verdict (true for installable, false otherwise) and a message (string of dependencies or reason why not installable).

providers
This is a reverse cache of binary packages and their providers.

To keep coherency, do not update "$self−>packages" or referenced packages. This is a Fedora::Rebuild::Providers object. This attribute is built in constructor to have it ready before spawning threads.

METHODS

invalidate_cache()
This call invalidates internal cache of verdicts. No arguments are recognized.

add_to_cache($binarypackage, $is_installable, $message)
Add "is_installable()" result into verdict cache.

is_installable_recursive($package, $binarypackage, $message, $backpath)
Decides a package is installable now and set string of dependencies.

This is a private method, use is_installable() instead.
$package

is a source package object.

$binarypackage

is a binary package ENVR as index to $package−>runrequies.

$message

is reference to variable where to store (not−)found dependencies. Pass undef if you don’t care.

$backpath

is a reference to list of binary packages on the path in the dependecy tree from parent to root (i.e. root is last element). It’s used to detect a cycle.

Return 0 for false, 1 for true, 2 for cycle. Fill list of dependencies into $$message (without trailing new line) which is a reference itself.

is_installable($self, $package, $binarypackage, $message)
Decides a $binarypackage compiled from source $package is installable now.

This is hard problem as it requires recursive evaluation of each package satisifying run-time dependency of previous package.

Return 0 for false, 1 or true, undef for error while deciding. Fill an error message (without trailing new line) into reference of third argument if defined.

is_buildable($package, $message)
Decides a package is buildable now and set string of dependenices.

Return 0 for false, 1 or true. Fill list of dependencies into $message (without trailing new line) which is a reference itself (or undef if you don’t care).

pdf