Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort firmware version by autoupdater/opkg specification #90

Open
Djfe opened this issue Jan 15, 2024 · 1 comment
Open

sort firmware version by autoupdater/opkg specification #90

Djfe opened this issue Jan 15, 2024 · 1 comment

Comments

@Djfe
Copy link

Djfe commented Jan 15, 2024

Expected Behavior

Firmware-Version is sorted newest to oldest

Current Behavior

sort order: numbers come before letters when they should come afterwards
2019 is displayed before v2019 even though v2019 is classified as newer by the autoupdater (same goes for v2023.2 for example)

root@ffac-test-7360v2:~# opkg compare-versions "2019" '>>' "v2019"
root@ffac-test-7360v2:~# echo $?
1
root@ffac-test-7360v2:~# opkg compare-versions "2019" '>>' "2018"
root@ffac-test-7360v2:~# echo $?
0
root@ffac-test-7360v2:~# opkg compare-versions "2019" '>>' "2023"
root@ffac-test-7360v2:~# echo $?
1

Steps to Reproduce

open https://map.aachen.freifunk.net/ and head to the statistics tab to view the firmware version column.

@Djfe
Copy link
Author

Djfe commented Feb 8, 2024

I just ran across another case:
someone build their own firmware and gave it GLUON_RELEASE v2023.2.x. Both opkg as well as meshviewer classify this as newer than v2023.2.1-1

root@ffac-test-7360v2:~# opkg compare-versions "v2023.2.1-1" '>>' "v2023.2.x"
root@ffac-test-7360v2:~# echo $?
1
``

So there are actually cases where the current code sorts correctly. I guess, it depends on where the letter is?
A letter at the beginning of a version number is considered older by meshviewer. While its considered newer when its in the middle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant