~e dZddlmZdZdZy)z-Helpers for dealing with software versioning.) StrictVersionct|jd}|jd}t|t|k\S)a6Check if a version is higher than another. This takes two software versions in the usual b"x.y" form and split them on the decimal character, converting both parts to ints, e.g. b"3.2" becomes (3, 2). It then does a comparison of the two tuples, and returns C{True} if C{version1} is greater than or equal to C{version2}. @param version1: The first version to compare as C{bytes}. @param version2: The second version to compare as C{bytes}. @return: C{True} if the first version is greater than or equal to the second. ascii)decoder)version1version2s :/usr/lib/python3/dist-packages/landscape/lib/versioning.pyis_version_higherr s5w'Hw'H  "mH&= ==c t|Dcgc]}t|jdc}d}|Dcgc]}t|j dc}Scc}wcc}w)zSort a list of software versions in from the highest to the lowest. @param version: a C{list} of C{bytes} describing a version. rT)reverse)sortedrrstrencode)versionsversionstrict_versionsstrict_versions r sort_versionsrse ?GHGw~~g. /HO .   N""7+  I s !A!A!N)__doc__distutils.versionrr rr r rs3+>( r