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 ofDebian::AptContents, used when locating which package a required module belongs to. πdpkg_availableβ An instance ofDpkg::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 useModule::Depends::Intrusivefor discovering dependencies in caseModule::Dependsfails. 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 ofDebian::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*andlibperl*β These are replaced withperlas per Perl policy. β¨ - dependencies on
perl-baseand build-dependencies onperlorperl-baseβ These are removed, unless they specify a version greater than the one available inoldstableor the dependency relation is not>=or>>.
Return value:
undefβ if the dependency is redundant.- pruned dependency β otherwise.
perl-modules*andlibperl*replaced withperl.
πͺ 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 & LICENSE π
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 isperl v5.40.1, dated2026-05-08,Debian...romCPAN(3pm). go forth and fill thatdebian/control, you absolute icon ππΈ
π¦ where this page comes from
- ubuntu stonking: dh-make-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