| CPAN::Mini::Inject(3pm) | User Contributed Perl Documentation | CPAN::Mini::Inject(3pm) |
CPAN::Mini::Inject - Inject modules into a CPAN::Mini mirror.
If you're not going to customize the way CPAN::Mini::Inject works you probably want to look at the mcpani command instead.
use CPAN::Mini::Inject;
$mcpi=CPAN::Mini::Inject->new;
$mcpi->parsecfg('t/.mcpani/config');
$mcpi->add(
module => 'CPAN::Mini::Inject',
authorid => 'SSORICHE',
version => ' 0.01',
file => 'mymodules/CPAN-Mini-Inject-0.01.tar.gz'
);
$mcpi->writelist;
$mcpi->update_mirror;
$mcpi->inject;
CPAN::Mini::Inject uses CPAN::Mini to build or update a local CPAN mirror from a remote one. It adds two extra features:
1. an additional repository of distribution files and related information (author and module versions), separate from the local and remote mirrors, to which you can add your own distribution files.
2. the ability to inject the distribution files from your repository into a local CPAN mirror.
Each method in CPAN::Mini::Inject returns a CPAN::Mini::Inject object which allows method chaining. For example:
my $mcpi=CPAN::Mini::Inject->new;
$mcpi->parsecfg
->update_mirror
->inject;
A "CPAN::Mini::Inject" ISA CPAN::Mini. Refer to the documentation for that module for details of the interface "CPAN::Mini::Inject" inherits from it.
Returns the current configuration hash.
print "$mcpi->{site}\n"; # ftp://ftp.cpan.org/pub/CPAN
"testremote" accepts an optional parameter to enable verbose mode.
Packages found in the distribution will be added to the module list For example both "CPAN::Mini::Inject" and "CPAN::Mini::Inject::Config" will be added to the modulelist file in the repository.
Packages will be looked for in the "provides" key of the META file if present, otherwise the files in the dist will be searched. See Dist::Metadata for more information.
(optional) The package name of the module to add. The distribution file will be searched for modules but you can specify the main one explicitly.
(required) The CPAN ID of the module's author. Since this isn't actually CPAN, the ID does not need to exist on CPAN. Typically, this ID uses "[A-Z]" and is three to ten letters. This is not enforced, but other CPAN tools may not like other sorts of names.
(optional) The module's version number. If you don't specify this. "add" will try to extract it from the distribution.
(required) The path to the distribution file.
$mcpani->add(
module => 'Module::Name',
authorid => 'SOMEAUTHOR',
version => 0.01,
file => './Module-Name-0.01.tar.gz'
);
The list is cumulative. There will be one entry for each time "add" was called.
This functionality is mostly provided for the included mcpani script to be able to verbosely print all the modules added.
Passing a value to "inject" enables verbose mode, which lists each module as it's injected.
CPAN::Mini
Shawn Sorichetti, "<ssoriche@cpan.org>"
Special thanks to David Bartle, for bringing this module up to date, and resolving the reported bugs.
Thanks to Jozef Kutej <jozef@kutej.net> for numerous patches.
Report issues to the GitHub queue at
https://github.com/briandfoy/cpan-mini-inject/issues
Copyright 2008-2009 Shawn Sorichetti, Andy Armstrong, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| 2025-04-12 | perl v5.40.1 |