Ticket #10314 (closed: fixed)
File release system does not sort numerical values & versions correctly
|Reported by:||fingolfin||Owned by:||hinojosa|
With "file release system", I am referring in the following to both the end user visible "File"s pages, such as https://sourceforge.net/projects/scummvm/files and also to the admin FRS pages such as https://sourceforge.net/project/admin/explorer.php?group_id=37116 and more recently http://sourceforge.net/downloads/scummvm/scummvm/
The file release system does not know how to sort numerical values correctly, and as a consequence, doesn't sort usual version strings correctly either.
Example: Given three directories in the FRS with names "1.0", "1.5" and "1.10", the FRS would sort them as "1.0", "1.10", "1.5", which is the sequence one gets by doing a simple dump string comparison.
Similarly, if sorting files with names "a100, a73, a5", it will sort them as "a100, a5, a73", while to a human being the natural sorting sequence would be "a5, a73, a100"
This could be rectified by using a string comparison method for sorting which is aware of numerical values embedded into the (human readable) strings. This is known as "Natural Order String Comparison", and implementation of functions which do this are readily available in many languages. This code has more examples, links to implementations and code: http://sourcefrog.net/projects/natsort/
Adopting natural sorting like this would avoid many irritations (like, users incorrectly downloading an outdated version) and would IMHO bring SourceForge.net up to par with what I'd consider industry standard these days :-) (not sorting numerical values in strings correctly is to 90s... :)