.\" -*- 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 "Debian::Dependency 3pm" .TH Debian::Dependency 3pm 2024-03-14 "perl v5.38.2" "User Contributed Perl Documentation" .\" 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 Debian::Dependency \- dependency relationship between Debian packages .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 8 \& # simple dependency \& my $d = Debian::Dependency\->new( \*(Aqperl\*(Aq ); \& # also parses a single argument \& my $d = Debian::Dependency\->new(\*(Aqperl (>= 5.10)\*(Aq); \& # dependency with a version \& my $d = Debian::Dependency\->new( \*(Aqperl\*(Aq, \*(Aq5.10\*(Aq ); \& # dependency with version and relation \& my $d = Debian::Dependency\->new( \*(Aqperl\*(Aq, \*(Aq>=\*(Aq, \*(Aq5.10\*(Aq ); \& \& print $d\->pkg; # \*(Aqperl\*(Aq \& print $d\->ver; # \*(Aq5.10\*(Aq \& \& # for people who like to type much \& my $d = Debian::Dependency\->new( { pkg => \*(Aqperl\*(Aq, ver => \*(Aq5.10\*(Aq, profile => \*(Aq!nocheck\*(Aq } ); \& \& # stringification \& print "$d" # \*(Aqperl (>= 5.10)\*(Aq \& \& # \*(Aqadding\*(Aq \& $deps = $dep1 + $dep2; \& $deps = $dep1 + \*(Aqfoo (>= 1.23)\*(Aq .Ve .SS CLASS_METHODS .IX Subsection "CLASS_METHODS" .IP \fBnew()\fR 4 .IX Item "new()" Construct a new instance. .IP "new( { pkg => 'package', rel => '>=', ver => '1.9', profile => '!nocheck' } )" 4 .IX Item "new( { pkg => 'package', rel => '>=', ver => '1.9', profile => '!nocheck' } )" If a hash reference is passed as an argument, its contents are used to initialize the object. Only \f(CW\*(C`pkg\*(C'\fR is required. .IP "new( [ { pkg => 'foo' }, 'bar (<= 3)' ] );" 4 .IX Item "new( [ { pkg => 'foo' }, 'bar (<= 3)' ] );" If an array reference is passed as an argument, its elements are used for constructing a dependency with alternatives. .IP "new('foo (= 42)')" 4 .IX Item "new('foo (= 42)')" .PD 0 .IP "new('foo (= 42) | bar')" 4 .IX Item "new('foo (= 42) | bar')" .PD If a single argument is given, the construction is passed to the \f(CW\*(C`parse\*(C'\fR constructor. .IP "new( 'foo', '1.4' )" 4 .IX Item "new( 'foo', '1.4' )" Two arguments are interpreted as package name and version. The relation is assumed to be '>='. .IP "new( 'foo', '=', '42' )" 4 .IX Item "new( 'foo', '=', '42' )" Three arguments are interpreted as package name, relation and version. .IP set 4 .IX Item "set" Overrides the set method from Class::Accessor. Used to convert zero versions (for example \fI0\fR or \fI0.000\fR) to void versions. .IP \fBparse()\fR 4 .IX Item "parse()" Takes a single string argument and parses it. .Sp Examples: .RS 4 .IP perl 4 .IX Item "perl" .PD 0 .IP "perl (>= 5.8)" 4 .IX Item "perl (>= 5.8)" .IP "libversion-perl (<< 3.4)" 4 .IX Item "libversion-perl (<< 3.4)" .IP "libfoo (>= 23) [amd64] " 4 .IX Item "libfoo (>= 23) [amd64] " .RE .RS 4 .RE .PD .SS FIELDS .IX Subsection "FIELDS" .IP pkg 4 .IX Item "pkg" Contains the name of the package that is depended upon .IP rel 4 .IX Item "rel" Contains the relation of the dependency. May be any of '<<', '<=', '=', '>=' or '>>'. Default is '>='. .IP ver 4 .IX Item "ver" Contains the version of the package the dependency is about. The value is an instance of Dpkg::Version class. If you set it to a scalar value, that is given to Dpkg::Version\->\fBnew()\fR. .PP \&\f(CW\*(C`rel\*(C'\fR and \f(CW\*(C`ver\*(C'\fR are either both present or both missing. .PP Examples .PP .Vb 2 \& print $dep\->pkg; \& $dep\->ver(\*(Aq3.4\*(Aq); .Ve .IP profile 4 .IX Item "profile" Contains the "restriction formulas" (build profile) of a dependency; optional. .SH METHODS .IX Header "METHODS" .IP satisfies($dep) 4 .IX Item "satisfies($dep)" Returns true if \fR\f(CI$dep\fR\fI\fR states a dependency that is already covered by this instance. In other words, if this method returns true, any package satisfying the dependency of this instance will also satisfy \fI\fR\f(CI$dep\fR\fI\fR ($dep is redundant in dependency lists where this instance is already present). .Sp \&\fR\f(CI$dep\fR\fI\fR can be either an instance of the Debian::Dependency class, or a plain string. .Sp .Vb 4 \& my $dep = Debian::Dependency\->new(\*(Aqfoo (>= 2)\*(Aq); \& print $dep\->satisfies(\*(Aqfoo\*(Aq) ? \*(Aqyes\*(Aq : \*(Aqno\*(Aq; # no \& print $dep\->satisfies(\*(Aqbar\*(Aq) ? \*(Aqyes\*(Aq : \*(Aqno\*(Aq; # no \& print $dep\->satisfies(\*(Aqfoo (>= 2.1)\*(Aq) ? \*(Aqyes\*(Aq : \*(Aqno\*(Aq; # yes .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" Debian::Dependencies .SH AUTHOR .IX Header "AUTHOR" .IP "Damyan Ivanov " 4 .IX Item "Damyan Ivanov " .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" .PD 0 .IP "Copyright (C) 2008,2009,2010 Damyan Ivanov " 4 .IX Item "Copyright (C) 2008,2009,2010 Damyan Ivanov " .IP "Copyright (C) 2019 gregor herrmann " 4 .IX Item "Copyright (C) 2019 gregor herrmann " .PD .PP This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110\-1301 USA.