Debian...ndency(3pm)
π Debian::Dependency β the whole vibe π
okay so bestie, gather round π«Ά this is the Debian::Dependency page from the perl manual situation (third section, 3pm, user-contributed perl docs, iykyk) and it's literally about dependency relationships between Debian packages. It's giving "who needs whom and at what version" energy and honestly? iconic. No cap.
β¨ NAME β¨
Debian::Dependency β the dependency relationship between Debian packages π
πΈ SYNOPSIS πΈ
here's the whole menu of ways you can build one, look at her go:
# simple dependency
my $d = Debian::Dependency->new( 'perl' );
# also parses a single argument
my $d = Debian::Dependency->new('perl (>= 5.10)');
# dependency with a version
my $d = Debian::Dependency->new( 'perl', '5.10' );
# dependency with version and relation
my $d = Debian::Dependency->new( 'perl', '>=', '5.10' );
print $d->pkg; # 'perl'
print $d->ver; # '5.10'
# for people who like to type much
my $d = Debian::Dependency->new( { pkg => 'perl', ver => '5.10', profile => '!nocheck' } );
# stringification
print "$d" # 'perl (>= 5.10)'
# 'adding'
$deps = $dep1 + $dep2;
$deps = $dep1 + 'foo (>= 1.23)'
like, stringification? we love her. adding dependencies together like they're friendship bracelets? obsessed π
π CLASS_METHODS π
new()
Constructs a brand new instance, fresh out the box β¨
new( { pkg => 'package', rel => '>=', ver => '1.9', profile => '!nocheck' } )
if you hand her a hash reference as the argument, she takes its contents and uses them to initialize the object. Only pkg is required β everything else is just extra seasoning π
new( [ { pkg => 'foo' }, 'bar (<= 3)' ] );
if you pass an array reference as the argument, its elements get used for constructing a dependency with alternatives. multiple options, main character energy π
new('foo (= 42)') / new('foo (= 42) | bar')
if you give her just a single argument, the whole construction gets handed off to the parse constructor. let her cook π
new( 'foo', '1.4' )
two arguments = package name and version. the relation just gets assumed to be '>='. she's filling in the blanks for you, queen π
new( 'foo', '=', '42' )
three arguments = package name, relation, and version. you said what you said π
set
Overrides the set method that comes from Class::Accessor. She uses it to convert zero versions (like 0 or 0.000) into void versions. no zeroes allowed on this ride β¨
parse()
Takes a single string argument and parses it. simple as that π¦
Examples:
perl
perl (>= 5.8)
libversion-perl (<< 3.4)
libfoo (>= 23) [amd64] <stage1 !cross>
π FIELDS π
pkg
Contains the name of the package that is depended upon. the whole point of the exercise fr fr π«Ά
rel
Contains the relation of the dependency. May be any of '<<', '<=', '=', '>=' or '>>'. Default is '>='.
ver
Contains the version of the package the dependency is about. The value is an instance of the Dpkg::Version class. If you set it to a scalar value, that value is given to Dpkg::Version->new().
β οΈ heads up bestie:"rel"and"ver"are either both present or both missing. no half-and-half situations, periodt.
Examples:
print $dep->pkg;
$dep->ver('3.4');
profile
Contains the "restriction formulas" (build profile) of a dependency; optional. little bonus field, we stan πΈ
π METHODS π
satisfies($dep)
Returns true if $dep 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 $dep (which means $dep is redundant in dependency lists where this instance is already present). it's the "yeah we already got that" check π
$dep can be either an instance of the Debian::Dependency class, or a plain string.
my $dep = Debian::Dependency->new('foo (>= 2)');
print $dep->satisfies('foo') ? 'yes' : 'no'; # no
print $dep->satisfies('bar') ? 'yes' : 'no'; # no
print $dep->satisfies('foo (>= 2.1)') ? 'yes' : 'no'; # yes
look at that β foo (>= 2.1) gets the yes because foo (>= 2) already covers it. ate π₯
π SEE ALSO π
Debian::Dependenciesβ go look, bestie, it's the whole fleet π¦
β AUTHOR β
Damyan Ivanov <dmn@debian.org> β thank you for your service, king π
π COPYRIGHT & LICENSE π
Copyright (C) 2008,2009,2010 Damyan Ivanov <dmn@debian.org>
Copyright (C) 2019 gregor herrmann <gregoa@debian.org>
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.
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.
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.
π«Ά legal text stays legal text, so read it properly, bestie β but also, GPL v2? iconic licensing moment.
aaaaand that's the whole page π this one came out of perl v5.40.1 and was dated 2026-05-08 β so go forth, make dependencies, stringify them, add them together, and vibe check your satisfies() calls. mwah πβ¨π
π¦ where this page comes from
- ubuntu stonking: libdebian-source-perl 0.133 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms