Debian...romCPAN(3pm)

πŸ’– Debian...romCPAN(3pm) πŸ’–

okay bestie, so picture this: you've got an unpacked CPAN distribution just sitting there, and your debian/control file is looking real empty. That's where Debian::Control::FromCPAN comes in β€” she fills in debian/control from an unpacked CPAN distribution. no cap. πŸ‘‘

It's a Perl module, page 3pm, part of the User Contributed Perl Documentation situation. Also, huge news: Debian::Control::FromCPAN inherits from Debian::Control. slay. πŸ’…


✨ SYNOPSIS ✨

my $c = Debian::Control::FromCPAN->new();
$c->discover_dependencies( { ... } );
$c->prune_perl_deps;

like, that's the whole vibe right there. πŸ¦‹


🌸 METHODS 🌸

πŸ’« discover_dependencies( [ { options hash } ] )

She goes out, discovers module dependencies, and fills in the dependency fields in debian/control accordingly. main character behaviour honestly.

Options:

  • apt_contents β€” An instance of Debian::AptContents, used when locating which package a required module belongs to. πŸ”
  • dpkg_available β€” An instance of Dpkg::Index, used when checking whether the locally available package is the required version. For example:
my $available = Dpkg::Index->new(type => CTRL_INFO_PKG);
$available->load("$Dpkg::ADMINDIR/available");
  • dir β€” The directory where the cpan distribution was unpacked. πŸ“
  • intrusive β€” A flag indicating permission to use Module::Depends::Intrusive for discovering dependencies in case Module::Depends fails. Since this requires loading all Perl modules in the distribution (and running their BEGIN blocks (and the BEGIN blocks of their dependencies, recursively)), it is recommended to use this only when dealing with trusted sources. 🚨
bestie I am BEGGING you, trusted sources only, she is nosy and runs everything.
  • require_deps β€” If true, causes the method to die if some a package for some dependency cannot be found. Otherwise only a warning is issued. πŸ’€
  • verbose β€” πŸ‘€
  • wnpp_query β€” An instance of Debian::WNPP::Query, used when checking for WNPP bugs of depended upon packages.

Returns: a list of module names for which no suitable Debian packages were found. (so if the list comes back, uh oh 😭)


πŸ”Ž find_debs_for_modules dep hash[, APT contents[, verbose[, DPKG available]]]

Scans the given hash of dependencies ( module => version ) and returns matching Debian package dependency specification (as an instance of Debian::Dependencies class) and a list of missing modules.

Installed packages and perl core are searched first, then the APT contents. πŸ₯‡

If a Dpkg::Index object is passed, also check the available package version. πŸ“Œ


🧹 prune_simple_perl_dep

Input:

  • dependency object β€” shall be a simple dependency (no alternatives)
  • (optional) build dependency flag β€” true value indicates the dependency is a build-time one

The following checks are made:

  • dependencies on perl-modules* and libperl* β€” These are replaced with perl as per Perl policy. ✨
  • dependencies on perl-base and build-dependencies on perl or perl-base β€” These are removed, unless they specify a version greater than the one available in oldstable or the dependency relation is not >= or >>.

Return value:

  • undef β€” if the dependency is redundant.
  • pruned dependency β€” otherwise. perl-modules* and libperl* replaced with perl.

πŸͺ„ prune_perl_dep

Similar to prune_simple_perl_dep, but supports alternative dependencies. If any of the alternatives is redundant, the whole dependency is considered redundant. team effort fr fr 🫢


🧼 prune_perl_deps

Remove redundant (build-)dependencies on perl, libperl, perl-modules and perl-base. bye bye clutter 🌈


πŸ‘‘ CLASS METHODS πŸ‘‘

πŸŽ€ module_name_to_pkg_name

Receives a perl module name like Foo::Bar and returns a suitable Debian package name for it, like libfoo-bar-perl. it's giving glow-up ✨


Copyright (C) 2009, 2010, 2012 Damyan Ivanov dmn@debian.org

Copyright (C) 2019, 2020, 2024 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.


🫢 and that's the whole page bestie β€” this doc is perl v5.40.1, dated 2026-05-08, Debian...romCPAN(3pm). go forth and fill that debian/control, you absolute icon πŸ’–πŸŒΈ
πŸ“¦ where this page comes from