pine64 / pine64_updater

Application for updating PINE64 devices, such as Pinecil
Other
174 stars 11 forks source link

v1.2 incorrectly reports a new version is available #7

Closed athisun closed 3 years ago

athisun commented 3 years ago

v1.2 incorrectly reports that a new version is available because the info.json hosted at http://pinecil.pine64.org/updater/info.json is outdated, reporting v1.1 as the latest version.

image

Ideally this line would be updated to convert the version string into a float, then make a greater-than comparison to the current version, instead of an inequality check.

https://github.com/pine64/pinecil-firmware-updater/blob/b3762d06609a9384ee9179dd63c786c988382109/mainwindow.cpp#L123

https://doc.qt.io/qt-5/qjsonvalue.html#toDouble

if (json["latest_version"].ToDouble() > 1.2) { 

Note that this method only works for major-minor versioning. Semantic versioning would require splitting the string by '.' and comparing each version component.

gamelaster commented 3 years ago

Thank you for reporting, I forget to change version on server.

And this idea with double conversion is very good, I will add it in next version. Thanks :)