1Fedora::Rebuild::SolverU(s3e)r Contributed Perl DocumentaFteidoonra::Rebuild::Solver(3)
2
3
4
6 Fedora::Rebuild::Solver - Dependency solver
7
9 new(packages => $packages, dependencyfilter => sub {})
10 The constructor new prepares initilialize a depencency solver on top of
11 a packackage set. Possible attributes are:
12
13 packages
14 Set of packages, Fedora::Rebuild::Set::Package object, with
15 populated provides and requires. This attribute is mandatory.
16
17 dependencyfilter
18 Reference to a function with three arguments (dependency name,
19 relation flag, version) returning false if the dependency should be
20 considered, true otherwise. If attribute is "undef" or missing, no
21 filtering will be performed (i.e. the same effect as "sub {1}").
22 This attribute is optional.
23
25 cache
26 This is cache of binary packages already resolved as installable or not
27 installable.
28
29 To keep coherency, do not update "$self->packages" or referenced
30 packages. This is a reference to hash of binary package names. Values
31 hold a verdict (true for installable, false otherwise) and a message
32 (string of dependencies or reason why not installable).
33
34 providers
35 This is a reverse cache of binary packages and their providers.
36
37 To keep coherency, do not update "$self->packages" or referenced
38 packages. This is a Fedora::Rebuild::Providers object. This attribute
39 is built in constructor to have it ready before spawning threads.
40
42 invalidate_cache()
43 This call invalidates internal cache of verdicts. No arguments are
44 recognized.
45
46 add_to_cache($binarypackage, $is_installable, $message)
47 Add is_installable() result into verdict cache.
48
49 is_installable_recursive($package, $binarypackage, $message, $verbose,
50 $backpath)
51 Decides a package is installable now and set string of dependencies.
52
53 This is a private method, use is_installable() instead.
54
55 $package
56 is a source package object.
57
58 $binarypackage
59 is a binary package ENVR as index to $package->runrequies.
60
61 $message
62 is reference to variable where to store (not-)found dependencies.
63 Pass undef if you don't care.
64
65 verbose
66 if true, log whole dependency tree. Becuse this can consume a lot
67 of memory recommended value is false that will cause logging only
68 unsatisfied dependencies.
69
70 $backpath
71 is a reference to list of binary packages on the path in the
72 dependecy tree from parent to root (i.e. root is last element).
73 It's used to detect a cycle.
74
75 Return 0 for false, 1 for true, 2 for cycle. Fill list of dependencies
76 into $$message (without trailing new line) which is a reference itself.
77
78 is_installable($self, $package, $binarypackage, $message, $verbose)
79 Decides a $binarypackage compiled from source $package is installable
80 now.
81
82 This is hard problem as it requires recursive evaluation of each
83 package satisifying run-time dependency of previous package.
84
85 Return 0 for false, 1 or true, undef for error while deciding. Fill an
86 error message (without trailing new line) into reference of third
87 argument if defined.
88
89 is_buildable($package, $message, $verbose)
90 Decides a package is buildable now and set string of dependenices.
91
92 Return 0 for false, 1 or true. Fill list of dependencies into $message
93 (without trailing new line) which is a reference itself (or undef if
94 you don't care).
95
96
97
98perl v5.38.0 2023-07-20 Fedora::Rebuild::Solver(3)