in reply to CPAN::Mini::Inject Discoveries

I was going to use CPAN::Mini::Inject for a current project, but decided that for our needs we would use a hacked version of the mkpackages script that comes with CPAN::Site (I submitted the more general changes I made to the author) - the mkpackages script walks through your local CPAN repository and builds the 02packages.details.txt.gz file, and extracts README's from the *.tar.gz files and creates the *.readme files in your local repository. This script does not fill in author info - it creates an empty 01mailrc.txt.gz if one doesn't exist.

In my hacked mkpackages script I use the CPAN::Checksums module to create the CHECKSUMS files - I wanted a script that I could point at our local CPAN repository and have it build the entire 02packages.details.txt.gz file and all the CHECKSUMS files based on whatever is in our local repository at that time.

In order to add specific version of CPAN modules to our local repository I wrote a separate fetch_and_inject.pl script that takes a CPAN file name, or list of names, e.g. S/SS/SSORICHE/CPAN-Mini-Inject-0.18.tar.gz and goes and fetches that specific file from a public CPAN repository, and puts it in our local repository, creating the authorid subdirectories if needed.

Replies are listed 'Best First'.
Re^2: CPAN::Mini::Inject Discoveries
by stuff (Initiate) on Feb 10, 2010 at 17:08 UTC

    Hi, I guess this post is quite old, but hope that someone could really help me. I have been searching the internet and unfortunately I haven't found too much data about creating a local cpan. The minicpan that I need to create will consist only of local modules. I don't need to mirror the modules from the live cpan. So I skipped that step and proceeded with the following ones, including the ones you specified above regarding the CHECKSUMS. The web interface kind of works. If I try to click on one of the modules right after the web interface loads, I get the following error:

    Internal Server Error Can't call method "distribution" on an undefined value at /usr/lib/perl5/site_perl/5.8.8/CPAN/Mini/Webserver/Templates.pm line 417.

    I have found the line where the error is generated, but I don't get what is wrong.

    Could anyone give me a piece of advice?

    Thank you.

      I think there have been numerous advances (albeit scattered, not documented in a single place) in creating a local CPAN over the past few years. The perl-qa mailing list (http://lists.perl.org/list/perl-qa.html) might be a good place to ask these days, but that's just a guess.