OK, your certainty was enough to make me go back and reduce things to figure this out. Since I'm new to cpanp, that was helpful. Because it seemed like the cleanest and best approach, I focused on cpanp "custom sources". Here's what I think I can say with some certainty (test follows):

  1. Custom sources determines "newer" version based on lexicographical compare, not version objects.
  2. cpanp _will_ find the latest install, provided your version numbers follow lexicographical ordering scheme (which I'm assuming is the older perl scheme). Thus it _does not_ need author/version as I'd said (I think the MiniCPAN method _does_ need this, but did not go back and test). Note that the newer perl versioning scheme (with the "v" on the front) doesn't work this way (example code below). So my guess is that cpanp does not use "version" objects. Thus for cpanp v0.10 < v0.9, which is _not_ true for version objects.
  3. cpanp _does not find_ any custom source preqs, regardless of how you specify the version in Build.PL. My guess is it is not even looking for these (although I haven't looked at the cpanp code yet).
  4. Custom sources requires one to do "/cs --list" prior to any command using an index, or it doesn't find the index (you get a URI index error). This is clearly a bug. My guess is that "/cs --list" may be populating an internal list. This _may_ be the reason I thought it was necessary to do some of the previous weirdness (write file then update). All one needs to do is, "/cs --list", "/cs --update 1" to update the custom sources (but note "/cs --list" _is_ necessary).

Here's a demo of perl version objects:

$ perl -e 'use version; $v1 = new version("v0.10"); $v2 = new version("v0.9"); print $v1 > $v2, "\n"'
1

Note it printed 1, so v0.10 > v0.9, which is not lexicographical, but the version object order (so we don't have to pad to v0.09 for example).

Next here's a demo showing that while it does install the latest module (provided you follow version lexicographical order), it will not find your prerequisite in custom sources. Note that I tried about 10 different slight permutation on the "requires" string in Build.PL, as described int the docs, from ultra simple, to prepending "v", etc. I couldn't get anything to work (i.e. cpanp never found any of these types). So I'm guessing that it doesn't even look (but I'm new to cpanp so take it with a grain of salt).

# Make empty custom sources dir

    $ mkdir customsrc

# Make dummy module

    $ module-starter --module=My::Module::Test --author="Jane Smith" --email=jane.smith@example.com --builder=Module::Install
    $ module-starter --module=My::Other::Module::Test --author="Jane Smith" --email=jane.smith@example.com --builder=Module::Install
    $ cd My-Module-Test

# Add version to generated lib/My/Module/Test.pm =>  "use version; our $VERSION = qv ('0.1');"
# Add "requires line" to Build.PL => "requires { 'My-Other-Module' => 'v0.1' },"
# Note, I tried many permutations of this, as well as
#   changing the version spec in My-Other-Module.
#   None of these 10 or so tries worked.

    $ perl Build.PL
    $ sudo Build dist
    $ cp My-Module-Test-v0.1.tar.gz ../customsrc
    $ sudo cpanp

    \CPANPLUS::Shell::Default -- CPAN exploration and module installation (v0.84)
    ...

    CPAN_Terminal> /cs --add file:////<path-to-your-local-dir>/customsrc

    Added remote source 'file:///Applications/MAMP/svn/qws-perl-libs/customsrc'

    Remote source contains:

       My-Module-Test-v0.1.tar.gz

    CPAN_Terminal> install My-Module-Test

# installs OK, but doesn't find My-Other-Module
    ...Warning: prerequisite My-Other-Module v0.1 not found.

I feel like the custom sources is very close to what I need, and seems a bit less flaky then I previously thought (well, now I am closer to knowing what the real bugs/problems are).

I still need to figure out how to make it look for the custom source prerequisites.


In reply to Re^2: CPANPLUS broken custom sources by zerohero
in thread CPANPLUS broken custom sources by zerohero

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.