I've been working with CPAN::Mini::Inject and having some trouble. I finally figured it out, so I thought I'd write a meditation on it.

CPAN::Mini::Inject has two problems that I'd be happy to fix if the author agrees.

  1. If you're installing modules in your mini-cpan with a made-up user name, CPAN::Mini::Inject doesn't have a mechanism for including that author information. This can lead to some weird behavior.
  2. If you've got Module::Signature installed, CPAN will try to verify a signature on the CHECKSUMS files. CPAN::Mini::Inject doesn't have a mechanism to let you sign that CHECKSUMS file.

Until either I or the author provide the functionality to solve these problems, I found these work arounds.

  1. Manually add your made-up user information to authors/01mailrc.txt.gz. CPAN::Mini::Inject will overwrite this file when it discovers that it's been updated on the real CPAN, so you may have to do this step often. Luckily it's easy to automate.

  2. The module responsible for creating the CHECKSUMS file is CPAN::Checksums, and if you set $CPAN::Checksums::SIGNING_KEY to a valid key, it will create signed CHECKSUMS files.

    For this to work, you need to have a working signing key, and anyone who's going to install the modules off your mini-cpan needs to trust that key.

    To make mcpani use that, you can edit mcpani. The $CPAN::Checksums::SIGNING_KEY variable expects a value it can pass straight on to gpg. This signing key must be in the secret key ring of the user you're logged in as when you run mcpani. If my signing key's id is B150D12F, then I might edit mcpani to contain the following:

    .. use CPAN::Checksums; $CPAN::Checksums::SIGNING_KEY = "B150D12F"; ..

    Now when I run mcpani --inject, if any of my personal modules have changed, it will prompt me for the password to my signing key and sign the CHECKSUMS file. It only prompts for the password if it has to create a new CHECKSUMS file, so you can still run "mcpani --mirror" from cron.

Here's how I was thinking of adding these functions to mcpani and CPAN::Mini::Inject.

  1. Create a configuration variable for mcpani that contains a list of CPAN user data. Any users in that list that aren't found in 01mailrc.txt.gz would be added to that file.
  2. Create another configuration variable for mcpani that contains a gpg key. If that value is set, mcpani sets CPAN::Checksums::SIGNING_KEY to that value.

Hope that helps someone...
--Pileofrogs


In reply to CPAN::Mini::Inject Discoveries by pileofrogs

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.