{"push_id":752277259,"size":1,"distinct_size":1,"ref":"refs/heads/patch-10","head":"cac80f49de715aa88fdca3357a97157606fd42b4","before":"24850bca184ba103fad984da638fe7252071d1af","commits":[{"sha":"cac80f49de715aa88fdca3357a97157606fd42b4","author":{"email":"545605536038c5fc1fd68bbfa4d633a0a6400978@inf.org","name":"Phil Davis"},"message":"Provide compare_pkg_versions\n\nThis function parses and compares two strings to see which one seems to represent the greater \"version\". It splits the strings into pieces that are digits and pieces that are anything else. e.g.\r\n\"utility-24.9_5 pkg v4.5\"\r\nbecomes\r\n\"utility-\"\r\n24\r\n\".\"\r\n9\r\n\"_\"\r\n5\r\n\" pkg v\"\r\n4\r\n\".\"\r\n5\r\n\r\nA new version might be:\r\n\"utility-24.10_5 pkg v4.5\"\r\n\r\nEach component is compared.\r\nIf both corresponding components are \"integer chunks\" they are compared using \"<\" and \">\" - that means that 10 becomes greater than 9.\r\nIf either component is not \"integer\" then string comparison is done. This makes the ordinary string changes work as expected and also stuff like \"1.05\" and \"1.1\" - a change like this will be seen as an upgrade.\r\n\r\nNot that I have left the string comparison case-sensitive. If someone making their version string changes the \"fixed text\" they have put in the version string then anything is possible :) It is a bit difficult to guess all of that.\r\n\r\nAlso if people use alphabetic versioning that does not follow strcmp() sort order then there is always trouble - it works by luck with \"-BETA\" then \"-RELEASE\" because the English words happen to sort as expected.","distinct":true,"url":"https://api.github.com/repos/phil-davis/pfsense/commits/cac80f49de715aa88fdca3357a97157606fd42b4"}]}