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 (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