Multiple cases:

Case Simple:

Distribution containing:

Some/Class/Frob.pm (which contains package Some::Class::Frob)

and nothing else.
and
Distribution containing:

Some/Class/Nicate.pm (which contains package Some::Class::Nicate)
and nothing else.

Well this is the simplist, each Frob.pm and Nicate.pm contain a VERSION for each of their dists and a HASH::SHA1 value for each. No issues.

Case Typical:

Distribution containing:

Some/Class/Frob.pm (which contains package Some::Class::Frob)

and nothing else.
and

Distribution containing:

Some/Class/Nicate.pm (which contains package Some::Class::Nicate)
Some/Class/Nicate/nsp1.pm (which contains package Some::Class::Nicate::nsp1)
Some/Class/Nicate/nsp2.pm (which contains package Some::Class::Nicate::nsp2)
Some/Class/Nicate/nsp2/nsp21.pm (which contains package Some::Class::Nicate::nsp2::nsp21)
Some/Class/Nicate/nsp2/nsp22.pm (which contains package Some::Class::Nicate::nsp2::nsp21)

Frob.pm contains VERSION for its distribution and a HASH::SHA1 value for itself.

Nicate.pm contains a VERSION for its distribution and a HASH::SHA1 value for itself.

nsp1.pm contains a VERSION which is a sub fetching the version of Nicate.pm and contains a HASH::SHA1 value for itself.

similar for nsp2.pm, nsp21.pm, nsp22.pm.

Case Harder - not simple module to file to package mapping.

Distribution containing:

Some/Class/Frob.pm (which contains package Some::Class::Frob)
Some/Class/Frob/nsp1.pm (which contains package Some::Class::Frob::nsp1)
Some/Class/Frob/nsp2.pm (which contains package Some::Class::Frob::nsp2)

Distribution containing:

Some/Class/Nicate.pm (which contains package Some::Class::Nicate)
Some/Class/Nicate/nsp1.pm (which contains package Some::Class::Nicate::nsp1)
Some/Class/Nicate/nsp2.pm (which contains package Some::Class::Nicate::nsp2 and contains package Some::Class::Frob::nsp1)

Ugh, so dist Some-Class-Nicate has a file that contains multiple packages, one of which populates its module package space (i.e. module name mapped to file on file system contains package same as module name) and it contains package Some::Class::Frob::nsp1.

So what do you want for versioning? ::VERSION is what is defined within a package or forced into a package name space.

I contend that you would NOT place a ::VERSION in the package namespace for Some::Class::Frob::nsp1 as defined in Some::Class::Nicate::nsp2. You would have a ::VERSION in Some::Class::Nicate::nsp2 which is a sub fetching the version from the top-level module of dist for Some::Class::Nicate and you would have a HASH::SHA1 for the Some/Class/Nicate/nsp2.pm. Module requirement would be for Some::Class::Nicate::nsp2::VERSION (a sub). That would be the case even if the only change was in Some::Class::Frob::nsp1 as found in Some::Class::Nicate::nsp2 because the only way to get the change is to require Some::Class::Nicate::nsp2. You can not partially require a module. (Well I lie, you can with BEGIN & co).

Hopefully that addresses what you were asking.


In reply to Re^2: <pkg>::VERSION, git, hashes, shipit, Class::MOP, Moose, perl core support - what NOW makes sense. by otto
in thread <pkg>::VERSION, git, hashes, shipit, Class::MOP, Moose, perl core support - what NOW makes sense. by otto

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.