helpers: future proof and allow also checking releases

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2023-06-16 13:26:43 +02:00
parent 9c6eabf028
commit e17312c99f

View File

@ -178,8 +178,8 @@ sub pvecfg_min_version {
return 0 if !$verstr;
if ($verstr =~ m/^(\d+)\.(\d+)[.-](\d+)/) {
return 1 if version_cmp($1, $major, $2, $minor, $3, $release) >= 0;
if ($verstr =~ m/^(\d+)\.(\d+)(?:[.-](\d+))/) {
return 1 if version_cmp($1, $major, $2, $minor, $3 // 0, $release) >= 0;
return 0;
}