Wednesday, July 13, 2011

Perl Module Versions in dotcloud

I just realized that I was running an older version in my dotcloud service. There was an update due to a security issue so it was kind of important.

I found that I needed to update (or put) a version number in the Makefile.PL. Here is an example of mine.

Before:
use strict;
use warnings;
use ExtUtils::MakeMaker;

WriteMakefile(
    NAME                => 'leecarmichael',
    AUTHOR              => q{Lee Carmichael },
    VERSION_FROM        => 'lib/leecarmichael.pm',
    ABSTRACT            => 'Home Site',
    ($ExtUtils::MakeMaker::VERSION >= 6.3002
      ? ('LICENSE'=> 'perl')
      : ()),
    PL_FILES            => {},
    PREREQ_PM => {
        'Test::More' => 0,
        'YAML'       => 0,
        'XML::RSS'   => 0,
        'URI'        => 0,
        'Date::Parse' => 0,
        'Digest::MD5' => 0,
        'Plack'       => 0,
        'Plack::Request' => 0,
        'Template'       => 0,
        'Dancer'         => 1.3040,
        'Dancer::Plugin::MobileDevice' => 0,
        'Dancer::Plugin::Email'        => 0,
        'Dancer::Plugin::FlashMessage' => 0,
        'Dancer::Plugin::Database'     => 0,
        'Dancer::Plugin::XML::RSS'     => 0,
        'Dancer::Session::Storable'    => 0,
        'DBI'        => 0,
        'DBD::mysql' => 0
    },
    dist                => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
    clean               => { FILES => 'leecarmichael-*' },
);

My updated one has version of Dancer changed to:
'Dancer' => 1.3060,

I like this approach to module version management. If you want to force the system to move to everything new you'd need to delete your service and recreate then push. If you want to force just a single CPAN module up to the most recent you update the version number.

It probably will require me to create a script to compare versions between the service and local dev/qa machines. Better put that on the TODO list :)

__END__

1 comment:

  1. Thanks for sharing the useful information which is very valuable and good points were mentioned in this article and for further information visit us at
    Oracle Fusion Financials Training

    ReplyDelete