Skip to content
Permalink
Browse files

Item13555: Use VERSION for comparisons

And stringify it, if it's a version object.
  • Loading branch information...
gac410 committed Jul 24, 2015
1 parent 2e06afa commit 53de7d6e838b0015bed7693dcc8dceeeecfad15b
Showing with 9 additions and 2 deletions.
  1. +9 −2 UpdatesPlugin/lib/Foswiki/Plugins/UpdatesPlugin/Core.pm
@@ -170,6 +170,8 @@ sub getAvailable {

# Refresh the cache
foreach my $ext (@$data) {

#print STDERR Data::Dumper::Dumper( \$ext );
my $text = JSON::to_json($ext);
$found{ $ext->{topic} } = 1;
if (
@@ -247,9 +249,14 @@ sub getInstalled {
eval "require $mod";
unless ($@) {

my $release = eval "\$Foswiki::Contrib::${mn}::RELEASE"
my $release = eval "\$Foswiki::Contrib::${mn}::VERSION"
|| '0';

# Convert version objects back to a simple string
if ( $release && ref($release) eq 'version' ) {
$release = $release->stringify();
}

#print STDERR "found extension $mn, release = $release\n" if $this->{debug};

$data->{$mn} = $release;
@@ -264,7 +271,7 @@ sub getInstalled {
if defined $this->{excludePattern}
&& $plugin->{name} =~ /$this->{excludePattern}/;

my $release = eval "\$$plugin->{module}::RELEASE" || '%$RELEASE';
my $release = eval "\$$plugin->{module}::VERSION" || '%$VERSION';

#print STDERR "found plugin $plugin->{name}, release = $release\n" if $this->{debug};

0 comments on commit 53de7d6

Please sign in to comment.
You can’t perform that action at this time.