I think that this method would be the right one. But I don't get it to run. Let's assume I'm in an offline environment and I have a tar.gz file I want to update my local offline CPAN with.

The tar.gz file could be a change of a module which is NOT available on any remote CPAN mirror. I want to update my local CPAN with the new version of this file changed by myself or got from somewhere else than CPAN. Or it could even be that I want to add a self written package, e.g. My::Package to my local CPAN.

What shall I specify for the remote mirror? I think that $path of $minicpan->mirror_file($path) refers to the remote mirror. Furthermore I have here the problem that I'm in an offline environment in the computer I'm using. So minicpan is unable to contact the remote mirror. My remote mirror has to be also local, so that it can be reached offline.

my $minicpan = CPAN::Mini->new(local => "C:/Strawberry/cpan", remote => "???");

UPDATE1:

I see there is an offline option. I'll try with that now. At least the following code is compiling.

use CPAN::Mini; my $minicpan = CPAN::Mini->new(local => "C:/Strawberry/cpan", offline => 1, remote => "file:://C:/Temp"); $minicpan->mirror_file("My-Package-0.01.tar.gz");

But that code just copies My-Package-0.01.tar.gz to C:/Strawberry/cpan directory. But no other files were updated. But that's clear because on C:/Temp I just put the tar.gz file and no more other files. I think I have to make a real cpan mirror containing my self changed files. And then the mirror_file method should work for me. But then I have the same problem as before. I manually have to change all CPAN specific files like CHECKSUMS, ...

UPDATE2:

I think I know now better what I want. I already have an offline cpan created via CPAN::Mini which just contains files from an official cpan mirror. And now I want to have a second offline cpan archive which contains modules written by myself and bug fixes of cpan modules which are not yet on an official cpan mirror. But what is the best way to build this second cpan offline archive consisting of my own modules if don't want to create all cpan specific files by myself?

UPDATE3:

I investigated a little bit more. I found a module CPAN::Mini::Inject. It seems that this is the functionality I want. I'm off for two weeks now with no access to computers. I'll try then. I'm now unsure whether I should have two cpan offline archives, one for the official modules of cpan and one for my private modules in the My namespace. Or if it would be better to have everything together in one offline cpan. What is your opinion?


In reply to Re^2: Update module in offline cpan by Dirk80
in thread Update module in offline cpan by Dirk80

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.