Read SDK version from new semver field

The sdk_version field should stay the ordinary plain number (the major version number of the semver field) so that older Cura versions don't break. Newly built packages will get built with both sdk_version_semver and the normal sdk_version, so that the packages can be read with any Cura version from 3.6 onwards.

Contributes to issue CURA-5940.
This commit is contained in:
Ghostkeeper 2018-11-15 15:13:36 +01:00
parent 163f102dda
commit 78e6494430
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -511,7 +511,8 @@ class Toolbox(QObject, Extension):
# version, we also need to check if the current one has a lower SDK version. If so, this package should also
# be upgradable.
elif remote_version == local_version:
can_upgrade = local_package.get("sdk_version", 0) < remote_package.get("sdk_version", 0)
# First read sdk_version_semver. If that doesn't exist, read just sdk_version (old version system).
can_upgrade = local_package.get("sdk_version_semver", local_package.get("sdk_version", 0)) < remote_package.get("sdk_version_semver", remote_package.get("sdk_version", 0))
return can_upgrade