http://qs321.pair.com?node_id=402821

skazat has asked for the wisdom of the Perl Monks concerning the following question:

Charismatic Monks,

I've been recently toying with the CPAN shell and specifically bundles. I've come across a problem with one of the features of Bundles, namely, the idea that you can set what version of a CPAN bundle you'd like to have downloaded and installed. As I understand, in the =head1 CONTENTS part of your bundle, you list modules like so:

=head1 CONTENTS Foo::Bar Bar::Batz

If you'd like to set the specific version that you wanted to download, you'd specify the version after the name:

=head1 CONTENTS Foo::Bar 1.005 Bar::Batz 2.3

Easy enough, very clean. The problem is that this doesn't seem to work! and the CPAN shell will be more than happy to download the newest version of the module that's available. As a real world example, I have a Bundle that looks like this:

package Bundle::Foo; $VERSION = '0.01'; 1; __END__ =head1 NAME Bundle::Foo =head1 CONTENTS HTML::FromText 1.005 - uh huh. =cut

Even though 1.005 of HTML::FromText is selected, version 2.05 will always be installed.

Am I missing something obvious, or is there a "gotcha" somewhere that I'm not getting?

 

-justin simoni
!skazat!

Replies are listed 'Best First'.
Re: CPAN Shell, Bundles and downloading specific versions
by PodMaster (Abbot) on Oct 26, 2004 at 22:57 UTC
    CPANPLUS creates bundles that look like
    =head1 CONTENTS Acme::DeepThoughts 0.01 Acme::MJD 0.02 Algorithm::Diff 1.15
    although it will also just install the newest version. The reason is there is no way to reliably correlate module version numbers with distributions. 02packages.details.txt.gz has the data (accessible using Parse::CPAN::Packages), but once a package is deleted from CPAN, its not listed in 02packages.details.txt.gz anymore.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Ah:

      The reason is there is no way to reliably correlate module version numbers with distributions.

      That makes sense, but that give me an idea, if, instead of a module listed as one of the lines in the CONTENTS part of a bundle, you can just put the path to the file itself you

      need, ie:

      id/G/GD/GDR/HTML-FromText-1.005.tar.gz

      It seems that the CPAN shell gives back the warning:

      The Bundle Bundle::Foo contains explicitly a file id/G/GD/GDR/HTML-FromText-1.005.tar.gz.

      But, it does seem to work!

       

      -justin simoni
      !skazat!

Re: CPAN Shell, Bundles and downloading specific versions
by Joost (Canon) on Oct 26, 2004 at 22:49 UTC
    I'm not sure if this is also true for bundles, but the standard module dependencies scheme (in Makefile.PL or META.yaml) only allow a minimum version number for dependent modules: this would explain why you'd get a v2.05 while you're requesting v1.005 of a module.

    I'm not sure how you should work around the problem, maybe you could use only. I think you still need to download and install that module version using a custom script (CPANPLUS might be a handy module for that).

Re: CPAN Shell, Bundles and downloading specific versions
by markjugg (Curate) on Dec 30, 2005 at 15:33 UTC
    The Task concept was designed to replace Bundle files. If you implemented yours with Module::Build, then you could use the precise notation available in requires to give minimum and maximum versions. (I assume by making the minium and maximum version the same, you require an exact version).