Skip to content

Commit

Permalink
Item13555: Use VERSION for comparisons
Browse files Browse the repository at this point in the history
And stringify it, if it's a version object.
  • Loading branch information
gac410 committed Jul 24, 2015
1 parent 2e06afa commit 53de7d6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions UpdatesPlugin/lib/Foswiki/Plugins/UpdatesPlugin/Core.pm
Expand Up @@ -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 (
Expand Down Expand Up @@ -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;
Expand All @@ -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};

Expand Down

0 comments on commit 53de7d6

Please sign in to comment.