mirror of
https://github.com/envmodules/modules.git
synced 2026-06-03 00:33:18 +08:00
Dictionary sort of Tcl enables to determine that a version 1.10 is greater that a version 1.8, for instance. This useful kind of sort was in use in modules-tcl previously but not for every sort. For instance load command was correctly able to find the greatest version of a module whereas avail and whatis commands did not sort existing versions accordingly. This patch applies the dictionary sort everywhere to ensure the exact same sort is applied everywhere. Dictionary sort appears to be the most appropriate kind of sort to work with software versions. So the sort_order argument of listModules procedure is removed to always get the same sort applied. Also a stringDictionaryCompare procedure is added in order to compare two strings with dictionary-sort (useful to know what string is greater than the other). In addition, modules.91-sort testsuite is introduced to guaranty that avail, whatis and load commands behave appropriately regarding sort.