Fix Makefile.PL's is_upgrading_needed() routine (RT #58771)
Brian Cassidy [Thu, 24 Jun 2010 12:43:10 +0000 (12:43 +0000)]
Changes
Makefile.PL
lib/Catalyst/Plugin/Session.pm

diff --git a/Changes b/Changes
index a9696f9..51c1d8e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl extension Catalyst::Plugin::Session
 
+0.30 TO BE RELEASED
+        - Fix Makefile.PL's is_upgrading_needed() routine (RT #58771)
+
 0.29 2009-11-04
         - Fix session being deleted when you have a new session after session
           expiry when calling session_is_valid method. Tests for this.
index 45773ea..e9482f6 100644 (file)
@@ -42,13 +42,15 @@ sub is_upgrading_needed {
     );
 
     foreach my $module (keys %state) {
-        if ( eval "require Catalyst::Plugin::Session::State::$module" and
-        ${"Catalyst::Plugin::Session::State::${module}::VERSION"} < $state{$module} ) {
-            warn <<WARN;
+        my $package = 'Catalyst::Plugin::Session::State::' . $module;
+
+        next if not eval "require $package;";
 
+        if( not eval { $package->VERSION( $state{ $module } ); } ) {
+            warn <<WARN;
 ********** NOTE **********
 
-Catalyst::Plugin::Session::State::$module must also be updated!
+$package must also be updated!
 
 The currently installed version is *not* compatible with this version of
 Catalyst::Plugin::Session!
index 0bd779c..d81026d 100644 (file)
@@ -13,7 +13,7 @@ use Carp;
 
 use namespace::clean -except => 'meta';
 
-our $VERSION = '0.29';
+our $VERSION = '0.30';
 $VERSION = eval $VERSION;
 
 my @session_data_accessors; # used in delete_session