extensionUtils: Adjust version check

With the new versioning scheme, the previously-minor version gets
shifted up to major, and unstable releases are marked by non-numeric
"versions" rather than uneven numbers. Reflect that in the extension
version check.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1456
This commit is contained in:
Florian Müllner 2020-10-05 15:24:01 +02:00
parent deb78b9ada
commit 6b1e2df589

View File

@ -193,13 +193,11 @@ function versionCheck(required, current) {
let currentArray = current.split('.'); let currentArray = current.split('.');
let major = currentArray[0]; let major = currentArray[0];
let minor = currentArray[1]; let minor = currentArray[1];
let point = currentArray[2];
for (let i = 0; i < required.length; i++) { for (let i = 0; i < required.length; i++) {
let requiredArray = required[i].split('.'); let requiredArray = required[i].split('.');
if (requiredArray[0] == major && if (requiredArray[0] === major &&
requiredArray[1] == minor && (requiredArray[1] === undefined && isFinite(minor) ||
((requiredArray[2] === undefined && parseInt(minor) % 2 == 0) || requiredArray[1] === minor))
requiredArray[2] == point))
return true; return true;
} }
return false; return false;