.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Dpkg::Deps 3perl" .TH Dpkg::Deps 3perl 2024-01-19 1.22.3 libdpkg-perl .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Dpkg::Deps \- parse and manipulate dependencies of Debian packages .SH DESCRIPTION .IX Header "DESCRIPTION" The Dpkg::Deps module provides classes implementing various types of dependencies. .PP The most important function is \fBdeps_parse()\fR, it turns a dependency line in a set of Dpkg::Deps::{Simple,AND,OR,Union} objects depending on the case. .SH FUNCTIONS .IX Header "FUNCTIONS" All the deps_* functions are exported by default. .ie n .IP "deps_eval_implication($rel_p, $v_p, $rel_q, $v_q)" 4 .el .IP "deps_eval_implication($rel_p, \f(CW$v_p\fR, \f(CW$rel_q\fR, \f(CW$v_q\fR)" 4 .IX Item "deps_eval_implication($rel_p, $v_p, $rel_q, $v_q)" ($rel_p, \f(CW$v_p\fR) and ($rel_q, \f(CW$v_q\fR) 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. .Sp 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 there's no implication. .Sp The \f(CW$v_p\fR and \f(CW$v_q\fR parameter should be Dpkg::Version objects. .ie n .IP "$dep = deps_concat(@dep_list)" 4 .el .IP "\f(CW$dep\fR = deps_concat(@dep_list)" 4 .IX Item "$dep = deps_concat(@dep_list)" This function concatenates multiple dependency lines into a single line, joining them with ", " if appropriate, and always returning a valid string. .ie n .IP "$dep = deps_parse($line, %options)" 4 .el .IP "\f(CW$dep\fR = deps_parse($line, \f(CW%options\fR)" 4 .IX Item "$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 behavior of that function. .RS 4 .IP "use_arch (defaults to 1)" 4 .IX Item "use_arch (defaults to 1)" Take into account the architecture restriction part of the dependencies. Set to 0 to completely ignore that information. .IP "host_arch (defaults to the current architecture)" 4 .IX Item "host_arch (defaults to the current architecture)" Define the host architecture. By default it uses \&\fBDpkg::Arch::get_host_arch()\fR to identify the proper architecture. .IP "build_arch (defaults to the current architecture)" 4 .IX Item "build_arch (defaults to the current architecture)" Define the build architecture. By default it uses \&\fBDpkg::Arch::get_build_arch()\fR to identify the proper architecture. .IP "reduce_arch (defaults to 0)" 4 .IX Item "reduce_arch (defaults to 0)" If set to 1, ignore dependencies that do not concern the current host architecture. This implicitly strips off the architecture restriction list so that the resulting dependencies are directly applicable to the current architecture. .IP "use_profiles (defaults to 1)" 4 .IX Item "use_profiles (defaults to 1)" Take into account the profile restriction part of the dependencies. Set to 0 to completely ignore that information. .IP "build_profiles (defaults to no profile)" 4 .IX Item "build_profiles (defaults to no profile)" Define the active build profiles. By default no profile is defined. .IP "reduce_profiles (defaults to 0)" 4 .IX Item "reduce_profiles (defaults to 0)" If set to 1, ignore dependencies that do not concern the current build profile. This implicitly strips off the profile restriction formula so that the resulting dependencies are directly applicable to the current profiles. .IP "reduce_restrictions (defaults to 0)" 4 .IX Item "reduce_restrictions (defaults to 0)" If set to 1, ignore dependencies that do not concern the current set of restrictions. This implicitly strips off any architecture restriction list or restriction formula so that the resulting dependencies are directly applicable to the current restriction. This currently implies \f(CW\*(C`reduce_arch\*(C'\fR and \f(CW\*(C`reduce_profiles\*(C'\fR, and overrides them if set. .IP "union (defaults to 0)" 4 .IX Item "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. .IP "virtual (defaults to 0)" 4 .IX Item "virtual (defaults to 0)" If set to 1, allow only virtual package version relations, that is none, or "=". This should be set whenever working with Provides fields. .IP "build_dep (defaults to 0)" 4 .IX Item "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. .IP "tests_dep (defaults to 0)" 4 .IX Item "tests_dep (defaults to 0)" If set to 1, allow tests-specific package names in dependencies, that is "@" and "@builddeps@" (since dpkg 1.18.7). This should be set whenever working with dependency fields from \fIdebian/tests/control\fR. .Sp This option implicitly (and forcibly) enables \f(CW\*(C`build_dep\*(C'\fR because test dependencies are based on build dependencies (since dpkg 1.22.1). .RE .RS 4 .RE .ie n .IP "$bool = deps_iterate($deps, $callback_func)" 4 .el .IP "\f(CW$bool\fR = deps_iterate($deps, \f(CW$callback_func\fR)" 4 .IX Item "$bool = deps_iterate($deps, $callback_func)" This function visits all elements of the dependency object, calling the callback function for each element. .Sp The callback function is expected to return true when everything is fine, or false if something went wrong, in which case the iteration will stop. .Sp Return the same value as the callback function. .ie n .IP "deps_compare($a, $b)" 4 .el .IP "deps_compare($a, \f(CW$b\fR)" 4 .IX Item "deps_compare($a, $b)" Implements a comparison operator between two dependency objects. This function is mainly used to implement the \fBsort()\fR method. .SH "CLASSES \- Dpkg::Deps::*" .IX Header "CLASSES - Dpkg::Deps::*" 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 class and combine several dependencies in 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. .PP In practice, the code is only meant to handle the realistic cases which, given Debian's dependencies structure, imply those restrictions: AND can contain Simple or OR objects, OR can only contain Simple objects. .PP Dpkg::Deps::KnownFacts is a special class 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 provide. .SH CHANGES .IX Header "CHANGES" .SS "Version 1.07 (dpkg 1.20.0)" .IX Subsection "Version 1.07 (dpkg 1.20.0)" New option: Add virtual option to \fBdeps_parse()\fR. .SS "Version 1.06 (dpkg 1.18.7; module version bumped on dpkg 1.18.24)" .IX Subsection "Version 1.06 (dpkg 1.18.7; module version bumped on dpkg 1.18.24)" New option: Add tests_dep option to \fBdeps_parse()\fR. .SS "Version 1.05 (dpkg 1.17.14)" .IX Subsection "Version 1.05 (dpkg 1.17.14)" New function: \fBdeps_iterate()\fR. .SS "Version 1.04 (dpkg 1.17.10)" .IX Subsection "Version 1.04 (dpkg 1.17.10)" New options: Add use_profiles, build_profiles, reduce_profiles and reduce_restrictions to \fBdeps_parse()\fR. .SS "Version 1.03 (dpkg 1.17.0)" .IX Subsection "Version 1.03 (dpkg 1.17.0)" New option: Add build_arch option to \fBdeps_parse()\fR. .SS "Version 1.02 (dpkg 1.17.0)" .IX Subsection "Version 1.02 (dpkg 1.17.0)" New function: \fBdeps_concat()\fR .SS "Version 1.01 (dpkg 1.16.1)" .IX Subsection "Version 1.01 (dpkg 1.16.1)" .SS "Version 1.00 (dpkg 1.15.6)" .IX Subsection "Version 1.00 (dpkg 1.15.6)" Mark the module as public.