Add v to front of version string in version->parse to force conversion of decimal to dotted decimal versions, and change from ge to > to prevent reapplying current version

This commit is contained in:
SteveGilvarry 2015-12-03 10:23:19 +11:00
parent f4d0581eb5
commit 5390605797
1 changed files with 1 additions and 1 deletions

View File

@ -1044,7 +1044,7 @@ if ( $version )
foreach my $patch ( @files ) { foreach my $patch ( @files ) {
my ( $v ) = $patch =~ /^zm_update\-([\d\.]+)\.sql$/; my ( $v ) = $patch =~ /^zm_update\-([\d\.]+)\.sql$/;
#PP make sure we use version compare #PP make sure we use version compare
if ( version->parse($v) ge version->parse($version) ) { if ( version->parse('v' . $v) > version->parse('v' . $version) ) {
print( "Upgrading DB to $v from $version\n" ); print( "Upgrading DB to $v from $version\n" );
patchDB( $dbh, $v ); patchDB( $dbh, $v );
if ( $dbh->errstr() ) { if ( $dbh->errstr() ) {