Server IP : 15.235.198.142 / Your IP : 216.73.216.190 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/landscape/lib/__pycache__/ |
Upload File : |
� �~�e � � � d Z ddlmZ d� Zd� Zy)z-Helpers for dealing with software versioning.� )� StrictVersionc �t � | j d� } |j d� }t | � t |� k\ S )a6 Check 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 )�version1�version2s �:/usr/lib/python3/dist-packages/landscape/lib/versioning.py�is_version_higherr s5 � � ���w�'�H����w�'�H���"�m�H�&=�=�=� c �� � t | D �cg c] }t |j d� � �� c}d�� }|D �cg c] }t |� j d� �� c}S c c}w c c}w )z�Sort a list of software versions in from the highest to the lowest. @param version: a C{list} of C{bytes} describing a version. r T)�reverse)�sortedr r �str�encode)�versions�version�strict_versions�strict_versions r � sort_versionsr se � � �?G�H�G��w�~�~�g�.� /�H���O� .��� �N��"�"�7�+�� �� I��s �!A�!A!N)�__doc__�distutils.versionr r r � r r �<module>r s �� 3� +�>�(r