HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1991111/cwd/lib/python3/dist-packages/reportbug/__pycache__/
Upload File :
Current File : //proc/1991111/cwd/lib/python3/dist-packages/reportbug/__pycache__/checkversions.cpython-311.pyc
�

�&=d�!���ddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZdZ
d	Zd
�Zd�Zdd
�Zdd�Z			dd�ZdS)�N�)�utils)�open_url)�	NoNetwork)�Deb822)�debian_supportz4https://qa.debian.org/madison.php?package=%s&text=onz$http://ftp-master.debian.org/new.822c�8�|r|sdStj||��S)a�
    Compare package version strings

    This is a wrapper around `debian_support.version_compare()` that
    returns 0 if one if the versions is empty.

    Parameters
    ----------
    current : str
        version assumed to be currently installed
    upstream : str
        version assumed to be available upstream

    Returns
    -------
    int
        1 if upstream is newer than current, -1 if current is
        newer than upstream, and 0 if the same.
    r)r�version_compare)�current�upstreams  �9/usr/lib/python3/dist-packages/reportbug/checkversions.py�compare_versionsr)s+��(��(���q��)�(�G�<�<�<�c�2�t||��dkr|S|S)ad
    Pick the later version of two version strings

    This is a helper function originally used in
    :func:`get_incoming_version()`, but currently not used.

    Parameters
    ----------
    a : str
        first package version
    b : str
        second package version

    Returns
    -------
    str
        the later (higher) version string
    r)r)�a�bs  r
�
later_versionrBs#��&��1����!�!����Hr�i386c��tj��}t|z}|r|dd�|��zz
}|d|zz
}	t	|||��}nL#t
$ricYStjj$r(}td|tj���icYd}~Sd}~wwxYw|siS|�dd���
��}i}	|�d	��D]Z}
	|
�d
��\}}}
}n#t$rY�*wxYw|dkr�5tj�|
|
��}||	|<�[|	S)a>
    Get package versions available.

    If `dists` is not given, get versions from all dists known to the
    version lookup service at https://qa.debian.org/madison.php

    Parameters
    ----------
    package : str
        package name
    timeout : int
        connection timeout in seconds
    dists : (str, ...), optional
        tuple of dist names ('stable', 'testing' etc.) to check
    http_proxy : str, optional
        http proxy url
    arch : str, optional
        architecture name

    Returns
    -------
    {str: str, ...}
        dictionary with found dists as keys and versions as values,
        e.g.,:

            {
                "oldstable": "46.1",
                "stable": "1:26.1+1-3.2+deb10u1",
                "testing": "1:26.1+1-4",
                "unstable": "1:26.3+1-1"
            }
    z&s=�,z&a=source,all,�Warning:��fileN� ��
�|�source)r�get_arch�RMADISON_URL�joinrr�urllib�error�	HTTPError�print�sys�stderr�replace�strip�split�
ValueError�CODENAME2SUITE�get)�package�timeout�dists�
http_proxy�arch�url�page�x�content�versions�line�p�v�dr�dists                r
�get_versions_availabler=Zs���B�>���D�
��
 �C��'��u�s�x�x����&�&����d�"�"�C����Z��1�1���������	�	�	��<�!����
�j�!�#�*�-�-�-�-��	�	�	�	�	�	������������	��l�l�3��#�#�)�)�+�+�G��H��
�
�d�#�#����	����C���J�A�q�!�Q�Q���	�	�	��H�	����
��=�=���#�'�'��1�-�-��������Os6�A�B�$B�7B�B�B�(D�
D�Dc��|�d}	tt||��}nL#t$ricYStjj$r(}t
d|tj���icYd}~Sd}~wwxYw|siSi}tj
|��D]O}|d|krA|ddz|dzd	z}	t|d
�����||	<�P|S)aj
    Get package versions available in the NEW queue

    If `dists` is not given, get versions from unstable (NEW queue).

    This is a helper function for :func:`check_available()`.

    Parameters
    ----------
    package : str
        package name
    timeout : int
        connection timeout in seconds
    dists : (str, ...), optional
        tuple of dist names ('stable', 'testing' etc.) to check
    http_proxy : str, optional
        http proxy url
    arch : str, optional
        unused

    Returns
    -------
    {str: str, ...}
        dictionary with found dists as keys and versions as values
    N)zunstable (new queue)rr�Source�Distributionz (�Queue�)�Version)
r�NEWQUEUE_URLrr"r#r$r%r&r'r�iter_paragraphs�maxr*)
r.r/r0r1r2r4r5r7�para�ks
          r
�get_newqueue_availablerI�s��4
�}�)�����j�'�:�:���������	�	�	��<�!����
�j�!�#�*�-�-�-�-��	�	�	�	�	�	������������	��H��&�t�,�,�7�7����>�W�$�$��^�$�t�+�d�7�m�;�c�A�A��d�9�o�3�3�5�5�6�6�H�Q�K���Os��A&�A&�A!�A&�!A&Tc��i}t|||||��}	|�|	��|r@tj|��}
|
�|}
t	|
||||��}	|�|	��i}d}|D]5}
t|||
��}|dkr||
||
<�*|dkr|dz
}�6|o|t
|��k}||fS)a�
    Check a package version against other available versions

    The package archive contains many different versions of most
    packages. This function determines whether a given package version
    is newer than all versions available in the archive, and (if not)
    which available versions are newer.

    Parameters
    ----------
    package : str
        package name
    version : str
        package version
    timeout : int
        connection timeout in seconds
    dists : (str, ...), optional
        tuple of dist names ('stable', 'testing' etc.) to check
    check_incoming : bool
        unused/ignored
    check_newqueue : bool
        True if the NEW queue should be checked for new versions
    http_proxy : str, optional
        http proxy url
    arch : str, optional
        architecture name

    Returns
    -------
    (dict, bool)
        Tuple with a dictionary and a bool. The dictionary contains the
        versions found to be newer than the given version. E.g.,
                {"unstable": "42.1", "testing": "42.0"}

        The bool indicates whether the checked (installed)
        version is strictly newer than all available versions.
    Nrr)r=�updater�get_source_namerIr�len)r.�versionr/r0�check_incoming�check_newqueuer1r2�avail�stuff�
srcpackage�new�newerr<�
comparison�too_news                r
�check_availablerX�s���P
�E�"�7�G�U�J��M�M�E�	�L�L��������*�7�3�3�
��� �J�&�z�7�E�:�t�T�T��
���U����
�C�
�E�����%�g�u�T�{�;�;�
���>�>��d��C��I�I�
�!�^�^��Q�J�E���,��#�e�*�*�,�G���<�r)NNr)NTTNr)r&�urllib.errorr"rr�urlutilsr�reportbug.exceptionsr�
debian.deb822r�debianrr rDrrr=rIrX�rr
�<module>r_s	��0�
�
�
�����������������������
!� � � � � �!�!�!�!�!�!�E��5��=�=�=�2
�
�
�0P�P�P�P�f/�/�/�/�d6:�8<�*0�C�C�C�C�C�Cr