Search code examples
perlcpan

Install CPAN modules from a local mirror without CPAN::Mini


In some computers in my company, only IE have access to Internet. So I would like to know if I can have a local copy of some CPAN modules in a local mirror. I heard of the CPAN::Mini module that can synchronize the local mirror with a public one.

How can I manually download the modules I want in my mirror with IE and configure cpan to look locally for the modules?

EDIT

I cannot use CPAN::Mini or other similar tools because only IE has access to internet. I need to replicate my mirror through IE first.


Solution

  • If you just want a partial mirror of CPAN, you can do this easily with OrePAN2.

    orepan2-inject --simple Module::Name /path/to/darkpan/
    

    This will also generate on 02packages file for you, which CPAN clients can read.

    orepan2-inject --simple Carton darkpan
    Wrote 1 from Carton
    [INFO] Could not find useful meta from 'darkpan/authors/id/D/DU/DUMMY/Carton-    v1.0.12.tar.gz'
    [INFO] Scanning for provided modules...
    /tmp/foo ∙ tree darkpan/
    darkpan/
    ├── authors
    │   └── id
    │       └── D
    │           └── DU
    │               └── DUMMY
    │                   └── Carton-v1.0.12.tar.gz
    ├── modules
    │   └── 02packages.details.txt.gz
    └── orepan2-cache.json