CPAN::Mini::Inject::Config(3pm)

CPAN::Mini::Inject::Config3pm

Config for cpan::mini::inject

Usage

        my $config = CPAN::Mini::Inject::Config->new;

Overview

Configuration

This is the default class dealing with the default CPAN::Mini::Inject config. The simplest config is a key-value file:

        local: t/local/CPAN
        remote : http://localhost:11027
        repository: t/local/MYCPAN
        dirmode: 0775
        passive: yes

This module digests that and returns it as a hash reference. Any module that wants to use a different sort of config structure needs to return the same hash:

        {
        local      => 't/local/CPAN',
        remote     => 'http://localhost:11027',
        repository => 't/local/MYCPAN',
        dirmode    => '0775',
        passive    => 'yes',
        }
•

dirmode

Set the permissions of created directories to the specified mode. The default value is based on umask if supported.

•

force

passthrough to CPAN::Mini.

•

local

(required) location to store local CPAN::Mini mirror

•

log_level

passthrough to CPAN::Mini

•

module_filters

passthrough to CPAN::Mini

•

passive

Enable passive FTP.

•

remote

(required) CPAN site(s) to mirror from. Multiple sites can be listed space separated.

•

repository

Location to store modules to add to the local CPAN::Mini mirror.

•

skip_cleanup

passthrough to CPAN::Mini

•

skip_perl

passthrough to CPAN::Mini

•

trace

passthrough to CPAN::Mini

Methods

"new"
config_file( [FILE] )
load_config()

loadcfg accepts a CPAN::Mini::Inject config file or if not defined will search the following four places in order:

•

file pointed to by the environment variable "MCPANI_CONFIG"

•

$HOME/.mcpani/config

•

/usr/local/etc/mcpani

•

/etc/mcpani

loadcfg sets the instance variable cfgfile to the file found or undef if none is found.

 print "$mcpi->{cfgfile}\n"; # /etc/mcpani
parse_config()

parsecfg reads the config file stored in the instance variable cfgfile and creates a hash in config with each setting.

  $mcpi->{config}{remote} # CPAN sites to mirror from.

parsecfg expects the config file in the following format:

 local: /www/CPAN
 remote: http://cpan.metacpan.org/
 repository: /work/mymodules
 passive: yes
 dirmode: 0755

If either local or remote are not defined parsecfg croaks.

get( DIRECTIVE )

Return the value for the named configuration directive.

"set( DIRECTIVE, VALUE )"

Sets the value for the named configuration directive.

Source availability

The main repository is on GitHub:

        https://github.com/briandfoy/cpan-mini-inject

There are also backup repositories on several other services:

        https://bitbucket.org/briandfoy/cpan-mini-inject
        https://codeberg.org/briandfoy/cpan-mini-inject
        https://gitlab.com/briandfoy/cpan-mini-inject

Releases

6 releases since Debian 8 (Jessie); the text changed 4 times.

  1. 8
  2. 9
  3. 10–11
  4. 12
  5. 13

Author

Shawn Sorichetti "<[email protected]>"

From libcpan-mini-inject-perl 1.012-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.