HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ns3133907 6.8.0-86-generic #87-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 18:03:36 UTC 2025 x86_64
User: cssnetorguk (1024)
PHP: 8.2.28
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/landscape/lib/__pycache__/versioning.cpython-312.pyc
�

�~�e�� �dZddlmZd�Zd�Zy)z-Helpers for dealing with software versioning.�)�
StrictVersionc�t�|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)�version1�version2s  �:/usr/lib/python3/dist-packages/landscape/lib/versioning.py�is_version_higherr
s5�����w�'�H����w�'�H���"�m�H�&=�=�=�c
���t|D�cgc]}t|jd����c}d��}|D�cgc]}t|�j	d���c}Scc}wcc}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.
    rT)�reverse)�sortedrr�str�encode)�versions�version�strict_versions�strict_versions    r	�
sort_versionsrse��
�?G�H�G��w�~�~�g�.�	/�H���O�.���	�N��"�"�7�+����	I��s
�!A�!A!N)�__doc__�distutils.versionrr
r�rr	�<module>rs��3�+�>�(r