Fix regex to extract version and oum

This commit is contained in:
Calvo 2023-02-24 15:12:18 +01:00
parent 76dbaf46d2
commit 9294253675
1 changed files with 3 additions and 3 deletions

View File

@ -33,7 +33,7 @@ use base 'Exporter';
our @ISA = qw(Exporter); our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.769"; my $pandora_version = "7.0NG.769+ALT";
my $pandora_build = "230224"; my $pandora_build = "230224";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
@ -118,12 +118,12 @@ sub check_lib_version {
$plugin_version = "0NG.0" if empty($plugin_version); $plugin_version = "0NG.0" if empty($plugin_version);
my ($main,$oum) = split /NG./, $plugin_version; my ($main,$oum) = $plugin_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/;
$main = 0 if empty($main) || !looks_like_number($main); $main = 0 if empty($main) || !looks_like_number($main);
$oum = 0 if empty($oum) || !looks_like_number($oum); $oum = 0 if empty($oum) || !looks_like_number($oum);
my ($libmain,$liboum) = split /NG./, $pandora_version; my ($libmain,$liboum) = $pandora_version =~ m/(\d*\.?\d+)NG\.(\d*\.?\d+)/;
if (($liboum < $oum) if (($liboum < $oum)
|| ($libmain != $main)) { || ($libmain != $main)) {