Current File : //proc/self/root/usr/lib/python3/dist-packages/apt/__pycache__/package.cpython-312.pyc
�

�p�g4�����dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZm
Z
mZddlmZddlmZmZddlmZddlmZddlZdd	lmZddlZdd
lmZmZdZ d!d�Z!Gd
�de"�Z#Gd�de#�Z$Gd�d�Z%Gd�de&e%�Z'Gd�d�Z(Gd�de
eef�Z)Gd�d�Z*Gd�dee*�Z+Gd�d�Z,ed��Z-e.d k(re-�yy)"z"Functionality related to packages.�)�annotationsN)�Iterable�Iterator�Mapping�Sequence)�
BadStatusLine)�Any�
no_type_check)�	HTTPError)�urlopen)�gettext)�AcquireProgress�InstallProgress)�BaseDependency�
Dependency�Origin�Package�Record�Version�VersionListc��tjj|�rYtjj|�|k(r7t	|�5}tj|�j|k(cddd�Sy#1swYyxYw)z(Return ``True`` if the file is the same.NF)�os�path�exists�getsize�open�apt_pkg�Hashes�hashes)r�sizer�fobjs    �-/usr/lib/python3/dist-packages/apt/package.py�
_file_is_samer#6sa��	�w�w�~�~�d�������� 5�� =�
�$�Z�	9�4��>�>�$�'�.�.�&�8�	9�	9��	9��s�
"A:�:Bc��eZdZdZy)�
FetchErrorz(Raised when a file could not be fetched.N��__name__�
__module__�__qualname__�__doc__��r"r%r%>s��2r,r%c��eZdZdZy)�UntrustedErrorz/Raised when a file did not have a trusted hash.Nr&r+r,r"r.r.Bs��9r,r.c���eZdZdZGd�de�Zdd�Zdd�Zdd�Ze	dd��Z
e	dd��Ze	dd	��Ze	dd
��Z
e	dd��Ze	dd��Ze	dd
��Ze	dd��Ze	dd��Zy)rzA single dependency.c� �eZdZdZdd�Zdd�Zy)�BaseDependency.__dstraQCompare helper for compatibility with old third-party code.

        Old third-party code might still compare the relation with the
        previously used relations (<<,<=,==,!=,>=,>>,) instead of the curently
        used ones (<,<=,=,!=,>=,>,). This compare helper lets < match to <<,
        > match to >> and = match to ==.
        c�:�tj||�rytj|d�rtjd|�Stj|d�rtjd|�Stj|d�rtjd|�Sy)	NT�<z<<�>z>>�=z==F)�str�__eq__��self�others  r"r7zBaseDependency.__dstr.__eq__Rss���z�z�$��&�����D�#�&��z�z�$��.�.����D�#�&��z�z�$��.�.����D�#�&��z�z�$��.�.�r,c�&�|j|�S�N)r7r8s  r"�__ne__zBaseDependency.__dstr.__ne__^s���{�{�5�)�)�)r,N�r:�object�return�bool)r'r(r)r*r7r=r+r,r"�__dstrr1Is��	�
	�	*r,rBc� �||_||_yr<)�_version�_dep)r9�version�deps   r"�__init__zBaseDependency.__init__as����
���	r,c�8�|j�d|j��S�Nz: ��rawtype�rawstr�r9s r"�__str__zBaseDependency.__str__e����,�,��r�$�+�+��/�/r,c�z�dj|j|j|j|j�S)NzC<BaseDependency: name:{!r} relation:{!r} version:{!r} rawtype:{!r}>)�format�name�relationrFrLrNs r"�__repr__zBaseDependency.__repr__hs1��T�[�[��I�I��M�M��L�L��L�L�	
�	
r,c�B�|jjjS)zThe name of the target package.)rE�
target_pkgrSrNs r"rSzBaseDependency.nameps���y�y�#�#�(�(�(r,c�L�|j|jj�S)z�The relation (<, <=, =, !=, >=, >, '') in mathematical notation.

        The empty string will be returned in case of an unversioned dependency.
        )�_BaseDependency__dstrrE�	comp_typerNs r"rTzBaseDependency.relationus���{�{�4�9�9�.�.�/�/r,c�.�|jjS)avThe relation (<<, <=, =, !=, >=, >>, '') in Debian notation.

        The empty string will be returned in case of an unversioned dependency.
        For more details see the Debian Policy Manual on the syntax of
        relationship fields:
        https://www.debian.org/doc/debian-policy/ch-relationships.html#s-depsyntax  # noqa

        .. versionadded:: 1.0.0
        )rE�
comp_type_debrNs r"�relation_debzBaseDependency.relation_deb}s���y�y�&�&�&r,c�.�|jjS)z�The target version or an empty string.

        Note that the version is only an empty string in case of an unversioned
        dependency. In this case the relation is also an empty string.
        )rE�
target_verrNs r"rFzBaseDependency.version�s���y�y�#�#�#r,c��g}|jj�}|D]\}|j}|jjj
}|j
|�}t||�}|j|��^|S)zfA list of all Version objects which satisfy this dependency.

        .. versionadded:: 1.0.0
        )	rE�all_targets�
parent_pkgrD�package�_pcache�_rawpkg_to_pkgr�append)r9�tvers�_tvers�_tver�_pkg�cache�pkg�tvers        r"�target_versionszBaseDependency.target_versions�sy����(,�	�	�(=�(=�(?���	�E�$)�$4�$4�D��M�M�)�)�1�1�E��&�&�t�,�C��3��&�D��L�L���	��r,c�Z�|jD�cgc]}|js�|��c}Scc}w�ziA list of all installed Version objects which satisfy this dep.

        .. versionadded:: 1.0.0
        �rn�is_installed�r9rms  r"�installed_target_versionsz(BaseDependency.installed_target_versions��&��"&�!5�!5�K���9J�9J��K�K��K��(�(c��|jr(|j�d|j�d|j��S|jS)a�String represenation of the dependency.

        Returns the string representation of the dependency as it would be
        written in the debian/control file.  The string representation does not
        include the type of the dependency.

        Example for an unversioned dependency:
          python3

        Example for a versioned dependency:
          python3 >= 3.2

        .. versionadded:: 1.0.0
        � )rFrSr]rNs r"rMzBaseDependency.rawstr�s;�� �<�<��i�i�[��$�"3�"3�!4�A�d�l�l�^�D�D��9�9�r,c�.�|jjS)z�Type of the dependency.

        This should be one of 'Breaks', 'Conflicts', 'Depends', 'Enhances',
        'PreDepends', 'Recommends', 'Replaces', 'Suggests'.

        Additional types might be added in the future.
        �rE�dep_type_untranslatedrNs r"rLzBaseDependency.rawtype�s���y�y�.�.�.r,c�4�|jjdk(S)zWhether this is a PreDepends.�
PreDependsrzrNs r"�
pre_dependzBaseDependency.pre_depend�s���y�y�.�.�,�>�>r,N)rFrrGzapt_pkg.Dependencyr@�None�r@r6�r@z
list[Version]�r@rA)r'r(r)r*r6rYrHrOrU�propertyrSrTr]rFrnrtrMrLr~r+r,r"rrFs����*��*�0�0�
��)��)��0��0��
'��
'��$��$��
��
��L��L�����(�/��/��?��?r,rc���eZdZdZ								d
�fd�Zdd�Zdd�Zedd��Zedd��Z	edd��Z
ed
d��Zed
d	��Z�xZ
S)raMRepresent an Or-group of dependencies.

    Attributes defined here:
        or_dependencies - The possible choices
        rawstr - String represenation of the Or-group of dependencies
        rawtype - The type of the dependencies in the Or-group
        target_version - A list of Versions which satisfy this Or-group of deps
    c�@��t�|�|�||_||_yr<)�superrHrD�_rawtype)r9rF�	base_depsrL�	__class__s    �r"rHzDependency.__init__�s ���	����#���
���
r,c�8�|j�d|j��SrJrKrNs r"rOzDependency.__str__�rPr,c�8�ddjd�|D��zS)Nz<Dependency: [%s]>�, c3�2K�|]}t|����y�wr<)�repr��.0�bds  r"�	<genexpr>z&Dependency.__repr__.<locals>.<genexpr>�s����0I�b��b��0I�����joinrNs r"rUzDependency.__repr__�s��#�t�y�y�0I�D�0I�'I�J�Jr,c��|Sr<r+rNs r"�or_dependencieszDependency.or_dependencies�s���r,c�2�djd�|D��S)axString represenation of the Or-group of dependencies.

        Returns the string representation of the Or-group of dependencies as it
        would be written in the debian/control file.  The string representation
        does not include the type of the Or-group of dependencies.

        Example:
          python2 >= 2.7 | python3

        .. versionadded:: 1.0.0
        z | c3�4K�|]}|j���y�wr<)rMr�s  r"r�z$Dependency.rawstr.<locals>.<genexpr>�s����3��"�)�)�3�s�r�rNs r"rMzDependency.rawstr�s���z�z�3�d�3�3�3r,c��|jS)aType of the Or-group of dependency.

        This should be one of 'Breaks', 'Conflicts', 'Depends', 'Enhances',
        'PreDepends', 'Recommends', 'Replaces', 'Suggests'.

        Additional types might be added in the future.

        .. versionadded:: 1.0.0
        )r�rNs r"rLzDependency.rawtype�s���}�}�r,c�f�g}|D])}|jD]}||vs�|j|���+|S)zlA list of all Version objects which satisfy this Or-group of deps.

        .. versionadded:: 1.0.0
        )rnrf)r9rgr�rms    r"rnzDependency.target_versionssH�� "���	'�B��*�*�
'���u�$��L�L��&�
'�	'��r,c�Z�|jD�cgc]}|js�|��c}Scc}wrprqrss  r"rtz$Dependency.installed_target_versionsrurv)rFrr�zlist[BaseDependency]rLr6r@rr�)r@rr�)r'r(r)r*rHrOrUr�r�rMrLrnrt�
__classcell__)r�s@r"rr�s����� �� �+?� �JM� �	
� �0�K������4��4��
��
��
��
��L��Lr,rc� �eZdZdZdd�Zdd�Zy)ra�The origin of a version.

    Attributes defined here:
        archive   - The archive (eg. unstable)
        component - The component (eg. main)
        label     - The Label, as set in the Release file
        origin    - The Origin, as set in the Release file
        codename  - The Codename, as set in the Release file
        site      - The hostname of the site.
        trusted   - Boolean value whether this is trustworthy.
    c�v�|j|_|j|_|j|_|j|_|j|_|j
|_|j|_|jjj|�}|r|jrd|_yd|_y�NTF)�archive�	component�label�origin�codename�site�
not_automaticrd�_list�
find_index�
is_trusted�trusted)r9rl�packagefile�	indexfiles    r"rHzOrigin.__init__+s���"�*�*���$�.�.��� �&�&��
�!�(�(���#�,�,��
��$�$��	�(�6�6����K�K�%�%�0�0��=�	���-�-��D�L� �D�Lr,c
��d|j�d|j�d|j�d|j�d|j�d|j
�d�
S)Nz<Origin component:z	 archive:z origin:z label:z site:z isTrusted:r4)r�r�r�r�r�r�rNs r"rUzOrigin.__repr__:s8��

�N�N��L�L��K�K��J�J��I�I��L�L�

�
	
r,N)rlrr�zapt_pkg.PackageFiler@rr�)r'r(r)r*rHrUr+r,r"rrs��
�
!�
r,rc�b�eZdZdZd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
ddd
�Zdd�Zdd�Z
y	)ra"Record in a Packages file

    Represent a record as stored in a Packages file. You can use this like
    a dictionary mapping the field names of the record to their values::

        >>> record = Record("Package: python-apt\nVersion: 0.8.0\n\n")
        >>> record["Package"]
        'python-apt'
        >>> record["Version"]
        '0.8.0'

    For example, to get the tasks of a package from a cache, you could do::

        package.candidate.record["Tasks"].split()

    Of course, you can also use the :attr:`Version.tasks` property.

    c�8�tj|�|_yr<)r�
TagSection�_rec)r9�
record_strs  r"rHzRecord.__init__\s���&�&�z�2��	r,c�,�t|j�Sr<)�hashr�rNs r"�__hash__zRecord.__hash___s���D�I�I��r,c�,�t|j�Sr<)r6r�rNs r"rOzRecord.__str__b����4�9�9�~�r,c� �|j|Sr<�r��r9�keys  r"�__getitem__zRecord.__getitem__es���y�y��~�r,c��||jvSr<r�r�s  r"�__contains__zRecord.__contains__hs���d�i�i��r,c�H�t|jj��Sr<)�iterr��keysrNs r"�__iter__zRecord.__iter__ks���D�I�I�N�N�$�%�%r,c#�pK�|jj�D]}||j|f���y�w)z6An iterator over the (key, value) items of the record.N)r�r�r�s  r"�	iteritemszRecord.iteritemsns3�����9�9�>�>�#�	&�C��t�y�y��~�%�%�	&�s�46Nc�:�|jj||�S)zReturn record[key] if key in record, else *default*.

        The parameter *default* must be either a string or None.
        )r��get�r9r��defaults   r"r�z
Record.getss��
�y�y�}�}�S�'�*�*r,c��||jvS)z deprecated form of ``key in x``.r�r�s  r"�has_keyzRecord.has_keyzs���d�i�i��r,c�,�t|j�Sr<)�lenr�rNs r"�__len__zRecord.__len__~r�r,)r�r6r@r�r@�intr�)r�r6r@r6)r�r?r@rA�r@z
Iterator[str])r@zIterable[tuple[object, str]]r<)r�r6r�r?r@r?)r�r6r@rA)r'r(r)r*rHr�rOr�r�r�r�r�r�r�r+r,r"rrHs9���&3���� �&�&�
+� �r,rc��eZdZdZd2d�Zd3d�Zd4d�Zd5d�Zd5d�Zd5d�Z	d5d�Z
d6d	�Zd7d
�Zd8d�Z
d8d�Zed9d
��Zed:d��Zed;d��Zed7d��Zed8d��Zed7d��Zed8d��Zed;d��Zed;d��Zed8d��Zed<d��Zed8d��Zed8d��Zed8d��Zed8d��Zed8d��Zed8d��Z ed7d��Z!ed=d��Z"d>d �Z#ed?d!��Z$ed@d"��Z%ed@d#��Z&ed@d$��Z'ed@d%��Z(edAd&��Z)ed8d'��Z*ed8d(��Z+ed8d)��Z,ed8d*��Z-edBd+��Z.dCd,�Z/ed?d-��Z0ed<d.��Z1			dD							dEd0�Z2				dF									dGd1�Z3y/)Hrz�Representation of a package version.

    The Version class contains all information related to a
    specific package version.

    .. versionadded:: 0.7.9
    c�~�||_||_|jjjj	|�yr<)rc�_candrd�
_weakversions�add)r9rc�cands   r"rHzVersion.__init__�s.�������
������*�*�.�.�t�4r,c�~�	|jj}|jj}||kry||kDrytj|jj
|j�S#t$rE	tj|jj
|�cYS#t$rtcYcYSwxYwwxYw)a:Compares against another apt.Version object or a version string.

        This method behaves like Python 2's cmp builtin and returns an integer
        according to the outcome.  The return value is negative in case of
        self < other, zero if self == other and positive if self > other.

        The comparison includes the package name and architecture if other is
        an apt.Version object.  If other isn't an apt.Version object it'll be
        assumed that other is a version string (without package name/arch).

        .. versionchanged:: 1.0.0
        ����)
rc�fullnamer�version_comparer��ver_strrF�AttributeError�	TypeError�NotImplemented)r9r:�	self_name�
other_names    r"�_cmpzVersion._cmp�s���
	&����-�-�I����/�/�J��:�%���Z�'���*�*�4�:�:�+=�+=�u�}�}�M�M���	&�
&��.�.�t�z�z�/A�/A�5�I�I���
&�%�%�
&��		&�s9�1A.�A.�3A.�.	B<�8)B$�!B<�$B8�3B<�7B8�8B<c�*�|j|�dk(S�Nr�r�r8s  r"r7zVersion.__eq__�����y�y���1�$�$r,c�*�|j|�dk\Sr�r�r8s  r"�__ge__zVersion.__ge__�r�r,c�*�|j|�dkDSr�r�r8s  r"�__gt__zVersion.__gt__�����y�y���!�#�#r,c�*�|j|�dkSr�r�r8s  r"�__le__zVersion.__le__�r�r,c�*�|j|�dkSr�r�r8s  r"�__lt__zVersion.__lt__�r�r,c�V�	|j|�dk7S#t$r	tcYSwxYwr�)r�r�r�r8s  r"r=zVersion.__ne__�s0��	"��9�9�U�#�q�(�(���	"�!�!�	"�s��(�(c�.�|jjSr<)r�r�rNs r"r�zVersion.__hash__�s���z�z���r,c�L�|jj�d|j��S)Nr5�rcrSrFrNs r"rOzVersion.__str__�s"���,�,�#�#�$�A�d�l�l�^�4�4r,c�P�d|jj�d|j�d�S)Nz<Version: package:z	 version:r4r�rNs r"rUzVersion.__repr__�s(��#�D�L�L�$5�$5�#8�	�$�,�,�AQ�QR�S�Sr,c���|jjjj|jj
d�st
d��|jjjS)z=Internal helper that moves the Records to the right position.rzCould not lookup record)rcrd�_records�lookupr��	file_list�LookupErrorrNs r"r�zVersion._records�sS���|�|�#�#�,�,�3�3�D�J�J�4H�4H��4K�L��7�8�8��|�|�#�#�,�,�,r,c��|jj}|jjjj|jjd��r |jjjSy)z2Internal helper to get the translated description.rN)r��translated_descriptionrcrdr�r�r��pop)r9�	desc_iters  r"�_translated_recordszVersion._translated_records�s[���J�J�5�5�	��<�<���(�(�/�/�	�0C�0C�0G�0G��0J�K��<�<�'�'�0�0�0�r,c�@�t|jj�S)z1Return whether this version is a security update.)rAr��is_security_updaterNs r"rzVersion.is_security_update�s���D�J�J�1�1�2�2r,c�.�|jjS)z.Return the size of the package when installed.)r��installed_sizerNs r"rzVersion.installed_size�s���z�z�(�(�(r,c�.�|jjS)z$Return the homepage for the package.)r��homepagerNs r"rzVersion.homepage�s���}�}�%�%�%r,c�.�|jjS)zReturn the size of the package.)r�r rNs r"r zVersion.size�����z�z���r,c�.�|jjS)z/Return the architecture of the package version.)r��archrNs r"�architecturezVersion.architecture�rr,c�@�t|jj�S)z:Return whether the version of the package is downloadable.)rAr��downloadablerNs r"rzVersion.downloadable�s���D�J�J�+�+�,�,r,c��|jj}|duxr-|jj|jjk(S)zkReturn wether this version of the package is currently installed.

        .. versionadded:: 1.0.0
        N)rc�	installedr��id)r9�inst_vers  r"rrzVersion.is_installed�s:���<�<�)�)���t�#�J����(9�(9�T�Z�Z�]�]�(J�Jr,c�.�|jjS)zReturn the version as a string.)r�r�rNs r"rFzVersion.version����z�z�!�!�!r,c�:�|j}|�|jSdS)z0Return the short description (one line summary).N)r��
short_desc)r9�recordss  r"�summaryzVersion.summarys%���*�*��%,�%8�w�!�!�B�d�Br,c�.�|jjS)z"return the long description (raw).)r��	long_descrNs r"�raw_descriptionzVersion.raw_descriptions���}�}�&�&�&r,c�.�|jjS)z"Return the section of the package.)r��sectionrNs r"rzVersion.sectionrr,c���d}|j}|�|jnd}|s"td�|jjzS	t|t�s|jd�}t|jd��}t|�|D]�}|j�dk(r|jd�s|dz
}�-|jd	�r#|jd�s	d
|ddz}n;d|ddz}n2|jd
�r|jd�s|dk(r|dd}n|}n|}||z
}��|S#t$r.}td�|jj|fzcYd}~Sd}~wwxYw)z�Return the formatted long description.

        Return the formatted long description according to the Debian policy
        (Chapter 5.6.13).
        See http://www.debian.org/doc/debian-policy/ch-controlfields.html
        for more information.
        �Nz+Missing description for '%s'.Please report.�utf-8z<Invalid unicode in description for '%s' (%s). Please report.�
�.z

z  z
%s
�z%s
rxr�)r�r�_rcrS�
isinstancer6�decode�UnicodeDecodeErrorr��split�next�strip�endswith�
startswith)r9�descr�dsc�err�lines�raw_line�lines        r"�descriptionzVersion.descriptionso�����*�*��#*�#6�g���D����E�F����!�!��
�	)��c�3�'��j�j��)���S�Y�Y�t�_�%���U���	�H��~�~��3�&��}�}�T�*��F�N�D���"�"�4�(��}�}�T�*�#�h�q�r�l�2�D�!�H�Q�R�L�0�D��$�$�S�)��=�=��&�$�"�*�#�A�B�<�D�#�D����D�L�D�-	�.���?"�	)��Q�����"�"�C�(�)�
)��	)�s�!D(�(	E�1#E�E�Ec��	|jjxs|jjS#t$r|jjcYSwxYw)z&Return the name of the source package.)r��
source_pkgrc�	shortname�
IndexErrorrNs r"�source_namezVersion.source_nameOsE��	*��=�=�+�+�E�t�|�|�/E�/E�E���	*��<�<�)�)�)�	*���-0�A�Ac��	|jjxs|jjS#t$r|jjcYSwxYw)z)Return the version of the source package.)r��
source_verr�r�r5rNs r"�source_versionzVersion.source_versionWsE��	&��=�=�+�+�A�t�z�z�/A�/A�A���	&��:�:�%�%�%�	&�r7c�.�|jjS)z.Return the priority of the package, as string.)r��priority_strrNs r"�priorityzVersion.priority_s���z�z�&�&�&r,c��|jjjjj	|j
�S)z�Return the internal policy priority as a number.
        See apt_preferences(5) for more information about what it means.
        )rcrd�	_depcache�policy�get_priorityr�rNs r"�policy_priorityzVersion.policy_priorityds/��
�|�|�#�#�-�-�4�4�A�A�$�*�*�M�Mr,c�@�t|jj�S)z�Return a Record() object for this version.

        Return a Record() object for this version which provides access
        to the raw attributes of the candidate version
        )rr��recordrNs r"rDzVersion.recordks���d�m�m�*�*�+�+r,c	��g}|jj}|D]M}	||D]B}g}|D]}|jt||���|jt	|||���D�O|S#t
$rY�]wxYw)a(Return a list of Dependency objects for the given types.

        Multiple types can be specified. Possible types are:
        'Breaks', 'Conflicts', 'Depends', 'Enhances', 'PreDepends',
        'Recommends', 'Replaces', 'Suggests'

        Additional types might be added in the future.
        )r��depends_listrfrr�KeyError)r9�typesrF�depends�type_�dep_ver_listr��dep_ors        r"�get_dependencieszVersion.get_dependenciests������*�*�)�)���	�E�
�$+�E�N�L�L� "�I�".�G��!�(�(���f�)E�F�G� �'�'�
�4��E�(J�K�	L�	�����
��
�s�A
A-�-	A9�8A9c�Z�|jjD�cgc]}|d��	c}Scc}w)z2Return a list of names that this version provides.r)r��
provides_list)r9�ps  r"�provideszVersion.provides�s&��#�j�j�6�6�7���!��7�7��7s�(c�$�|jd�S)z4Return the list of enhances for the package version.�Enhances�rMrNs r"�enhanceszVersion.enhances�����$�$�Z�0�0r,c�&�|jdd�S)z/Return the dependencies of the package version.r}�DependsrTrNs r"�dependencieszVersion.dependencies�s���$�$�\�9�=�=r,c�$�|jd�S)z-Return the recommends of the package version.�
RecommendsrTrNs r"�
recommendszVersion.recommends�s���$�$�\�2�2r,c�$�|jd�S)z+Return the suggests of the package version.�SuggestsrTrNs r"�suggestszVersion.suggests�rVr,c��g}|jjD]*\}}|jt|j|���,|S)z1Return a list of origins for the package version.)r�r�rfrrc)r9�originsr��_unuseds    r"razVersion.origins�sC����$(�J�J�$8�$8�	>� �K���N�N�6�$�,�,��<�=�	>��r,c�.�|jjS)zZReturn the path to the file inside the archive.

        .. versionadded:: 0.7.10
        )r��filenamerNs r"rdzVersion.filename�����}�}�%�%�%r,c�.�|jjS)zKReturn the md5sum of the binary.

        .. versionadded:: 0.7.10
        )r��md5_hashrNs r"�md5zVersion.md5�rer,c�.�|jjS)zLReturn the sha1sum of the binary.

        .. versionadded:: 0.7.10
        )r��	sha1_hashrNs r"�sha1zVersion.sha1�s���}�}�&�&�&r,c�.�|jjS)zNReturn the sha256sum of the binary.

        .. versionadded:: 0.7.10
        )r��sha256_hashrNs r"�sha256zVersion.sha256�s���}�}�(�(�(r,c�N�t|jdj��S)z�Get the tasks of the package.

        A set of the names of the tasks this package belongs to.

        .. versionadded:: 0.8.0
        �Task)�setrDr&rNs r"�tasksz
Version.tasks�s!���4�;�;�v�&�,�,�.�/�/r,c#�K�|jjD]^\}}|jjjj|�}|s�8|j
|jj����`y�w)zVReturn an iterator over all available urls.

        .. versionadded:: 0.7.10
        N)	r�r�rcrdr�r��archive_urir�rd)r9r�rbr�s    r"�_urisz
Version._uris�sf����
%)�J�J�$8�$8�	D� �K�����,�,�2�2�=�=�k�J�I���+�+�D�M�M�,B�,B�C�C�	D�s�AA;�*A;c�4�t|j��S)z^Return a list of all available uris for the binary.

        .. versionadded:: 0.7.10
        )�listrurNs r"�uriszVersion.uris�s���D�J�J�L�!�!r,c�f�	tt|j���S#t$rYywxYw)zNReturn a single URI for the binary.

        .. versionadded:: 0.7.10
        N)r'r�ru�
StopIterationrNs r"�urizVersion.uri�s/��	���T�Z�Z�\�*�+�+���	��	�s�!$�	0�0Nc�*�|� tjjdd�}tjj|jj�}tjj||�}t||j|jj�r7tjd|z�tjj|�S|jj d\}}|j"j$j&j)|�}|sL|r|j*s>t-d|j"j.�d|j0�dt3|dd	��d
���|j4st7d��|jj}	|s|	j8st-d|z��tj:|xs(t<j>j@jC��}
tjD|
|j4|	|j||�
�}|
jG�|jH|jJk7r%tMd|jN�d|jP����tjj|�S)aCFetch the binary version of the package.

        The parameter *destdir* specifies the directory where the package will
        be fetched to.

        The parameter *progress* may refer to an apt_pkg.AcquireProgress()
        object. If not specified or None, apt.progress.text.AcquireProgress()
        is used.

        The keyword-only parameter *allow_unauthenticated* specifies whether
        to allow unauthenticated downloads. If not specified, it defaults to
        the configuration option `APT::Get::AllowUnauthenticated`.

        .. versionadded:: 0.7.10
        �APT::Get::AllowUnauthenticatedF�"Ignoring already existing file: %sr�Could not fetch rx� source package: Source �describez	<unknown>� is not trustedzNo URI for this binary.�8The item %r could not be fetched: No trusted hash found.��destfile�	The item � could not be fetched: ))r�config�find_brr�basenamer�rdr�r#r r�logging�debug�abspathr�r�rcrdr�r�r�r.rSrF�getattrr{�
ValueError�usable�Acquire�apt�progress�textr�AcquireFile�run�status�	STAT_DONEr%r��
error_text)r9�destdirr��allow_unauthenticated�baser��pfile�offset�indexr�acq�acqfiles            r"�fetch_binaryzVersion.fetch_binary�s���*!�(�$+�N�N�$9�$9�3�U�%�!��w�w����
�
� 6� 6�7���7�7�<�<���.����4�9�9�d�m�m�.B�.B�C��M�M�>��I�J��7�7�?�?�8�,�,��
�
�,�,�Q�/�
��v����$�$�*�*�5�5�e�<��%�%�E�4D�4D� ��L�L�%�%��L�L��E�:�{�;���
��x�x��6�7�7����%�%��%���� �M�PX�X��
��o�o�h�M�#�,�,�*;�*;�*K�*K�*M�N���%�%�����6�4�9�9�d�X�
��	���	��>�>�W�.�.�.���#�#�W�%7�%7�9��
�
�w�w���x�(�(r,c��|� tjjdd�}tj�}tj|xs(t
jjj��}d}|j}|jxs|jj}	|jxs|jj}
|j!|	�}|r2|
|j"k7r#|j!|	�}|r|
|j"k7r�#|st%d|z��t'�}|s]|j(j*sGt-d|jj.�d|j"�d|j(j0�d���|j2D�]}
t4j6j9|
j6�}t4j6j;||�}|
j<d	k(r|}t?||
j@|
jB�rtEjFd
|z���|s$|
jBjHst-d|z��|jKtjL||j(jO|
j6�|
jB|
j@||�����!|jQ�|�t%d|z��|jRD]@}|jT|jVk7s�tYd
|jZ�d|j\����|r�|jdztj^|j"�z}t4j6j;||�}tajbdd||g�t4j6je|�St4j6je|�S)a9Get the source code of a package.

        The parameter *destdir* specifies the directory where the source will
        be fetched to.

        The parameter *progress* may refer to an apt_pkg.AcquireProgress()
        object. If not specified or None, apt.progress.text.AcquireProgress()
        is used.

        The parameter *unpack* describes whether the source should be unpacked
        (``True``) or not (``False``). By default, it is unpacked.

        If *unpack* is ``True``, the path to the extracted directory is
        returned. Otherwise, the path to the .dsc file is returned.

        The keyword-only parameter *allow_unauthenticated* specifies whether
        to allow unauthenticated downloads. If not specified, it defaults to
        the configuration option `APT::Get::AllowUnauthenticated`.
        Nr}FzNo source for %rrrxr�r�r,r~r�r�r�r��-zdpkg-sourcez-x)3rr�r��
SourceRecordsr�r�r�r�rr�r3rcr4r9r�r�r�rFr�rwr�r�r.rSr��filesrrr�r��typer#r rr�r�r�rfr�rtr��itemsr�r�r%r�r��upstream_version�
subprocess�
check_callr�)r9r�r��unpackr��srcr�r,rDr6r:�
source_lookupr��filr�r��item�outdirs                  r"�fetch_sourcezVersion.fetch_source4s���4!�(�$+�N�N�$9�$9�3�U�%�!��#�#�%���o�o�h�M�#�,�,�*;�*;�*K�*K�*M�N���������'�'�A�4�<�<�+A�+A���*�*�@�d�j�j�.@�.@���
�
�;�/�
���#�+�+� =��J�J�{�3�M���#�+�+� =���/�$�6�7�7����%����)=�)=� ��<�<�$�$�d�l�l�C�I�I�4F�4F�H��
�
�9�9�	�C��7�7�#�#�C�H�H�-�D��w�w�|�|�G�T�2�H��x�x�5� ����X�s�x�x����<��
�
�B�X�M�N��)�S�Z�Z�->�->�$�-�/7�8���
�L�L��#�#���I�I�)�)�#�(�(�3��J�J��H�H��%�
�	
�	�0	���	��;��/�$�6�7�7��I�I�	�D��{�{�d�n�n�,� ��}�}�d�o�o�7���	���[�[�3�&��)A�)A�#�+�+�)N�N�F��W�W�\�\�'�6�2�F��!�!�=�$��V�"D�E��7�7�?�?�6�*�*��7�7�?�?�3�'�'r,)rcrr�zapt_pkg.Versionr@r)r:r	r@z	int | Anyr>)r:rr@rA)r:r?r@z
bool | Anyr�r�)r@zapt_pkg.PackageRecords)r@zapt_pkg.PackageRecords | Noner�)r@�
str | None)r@r)rHr6r@�list[Dependency]�r@z	list[str])r@r�)r@zlist[Origin])r@zset[str]r�)rNN)r�r6r��AcquireProgress | Noner��bool | Noner@r6)rNTN)
r�r6r�r�r�rAr�r�r@r6)4r'r(r)r*rHr�r7r�r�r�r�r=r�rOrUr�r�r�rrrr r
rrrrFrrrr1r6r:r=rBrDrMrQrUrYr\r_rardrhrkrnrrrurxr{r�r�r+r,r"rr�sV���5�
&�:%�%�$�%�$�"��5�T��-��-������3��3��)��)��&��&����������-��-��K��K��"��"��C��C�
�'��'��"��"��4��4�l�*��*��&��&��'��'��N��N��,��,��,�8��8��1��1��>��>��3��3��1��1������&��&��&��&��'��'��)��)��0��0�D��"��"������+/�-1�	@)��@)�)�@)� +�	@)�


�@)�H�+/��-1�^(��^(�)�^(��	^(�
 +�^(�

�
^(r,rc�d�eZdZdZd
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Z	dd	�Z
dd
�Zdd�Zd
dd�Z
y)ra�Provide a mapping & sequence interface to all versions of a package.

    This class can be used like a dictionary, where version strings are the
    keys. It can also be used as a sequence, where integers are the keys.

    You can also convert this to a dictionary or a list, using the usual way
    of dict(version_list) or list(version_list). This is useful if you need
    to access the version objects multiple times, because they do not have to
    be recreated this way.

    Examples ('package.versions' being a version list):
        '0.7.92' in package.versions # Check whether 0.7.92 is a valid version.
        package.versions[0] # Return first version or raise IndexError
        package.versions[0:2] # Return a new VersionList for objects 0-2
        package.versions['0.7.92'] # Return version 0.7.92 or raise KeyError
        package.versions.keys() # All keys, as strings.
        max(package.versions)
    Nc�v�||_|jj|_|r|j||_yyr<)�_packagerj�version_list�	_versions)r9rc�slice_s   r"rHzVersionList.__init__�s2����
� ���2�2����!�^�^�F�3�D�N�r,c�P�t|t�r|j|j|�S	t	|j|j
|�S#t$r=|j
D]+}|j|k(s�t	|j|�ccYSYnwxYwtd|z��)NzVersion: %r not found.)	r#�slicer�r�rr�r�r�rG�r9r��vers   r"r�zVersionList.__getitem__�s����d�E�"��>�>�$�-�-��6�6�	7��4�=�=�$�.�.��*>�?�?���	7��~�~�
7���;�;�$�&�"�4�=�=�#�6�6�
7�	7��
�/�4�8�9�9s�"A�'B�9B�B�Bc�8�ddjd�|D��zS)Nz[%s]r�c3�2K�|]}t|����y�wr<)r6)r�r�s  r"r�z&VersionList.__str__.<locals>.<genexpr>�s����"<��3�s�8�"<�r�r�rNs r"rOzVersionList.__str__�s������"<�t�"<�<�=�=r,c�(�d|j�zS)Nz<VersionList: %r>)r�rNs r"rUzVersionList.__repr__�s��"�T�Y�Y�[�0�0r,c�.���fd��jD�S)z*Return an iterator over all value objects.c3�J�K�|]}t�j|����y�wr<)rr�)r�r�r9s  �r"r�z'VersionList.__iter__.<locals>.<genexpr>�s�����F����
�
�s�+�F�s� #)r�rNs`r"r�zVersionList.__iter__�s���F�t�~�~�F�Fr,c��t|t�r|j}|jD]}|j|k(s�yyr�)r#rrFr�r�r�s   r"r�zVersionList.__contains__�s<���d�G�$��<�<�D��>�>�	�C��{�{�d�"��	�r,c�0�t|�t|�k(Sr<)rwr8s  r"r7zVersionList.__eq__�s���D�z�T�%�[�(�(r,c�,�t|j�Sr<)r�r�rNs r"r�zVersionList.__len__�s���4�>�>�"�"r,c�T�|jD�cgc]}|j��c}Scc}w)z*Return a list of all versions, as strings.)r�r�)r9r�s  r"r�zVersionList.keys�s��'+�~�~�6�����6�6��6s�%c�0�	||S#t$r|cYSwxYw)zReturn the key or the default.)r�r�s   r"r�zVersionList.get�s%��	���9����	��N�	�s���r<)rcrr�zslice | Noner@r)r�zint | slice | strr@r	r�)r@zIterator[Version])r�r?r@rA)r:r	r@rAr�r�)r�r6r��Version | Noner@r�)r'r(r)r*rHr�rOrUr�r�r7r�r�r�r+r,r"rr�s:���&4�
:�>�1�G��)�#�
7�r,rc�Z�eZdZdZd'd�Zd(d�Zd(d�Zd)d�Zed*d��Z	e	jd+d��Z	ed*d��Zed(d	��Zed(d
��Z
ed(d��Zed,d��Zed-d
��Zd(d�Zed-d��Zed-d��Zed-d��Zed-d��Zed-d��Zed-d��Zed-d��Zed-d��Zed-d��Zed-d��Zed-d��Zed.d��Z	d/					d0d�Zed1d��Zed-d��Z ed-d��Z!ed-d ��Z"d2d!�Z#d3d4d"�Z$	d5							d6d#�Z%d7d8d$�Z&d7d9d%�Z'd:d&�Z(y);rz�Representation of a package in a cache.

    This class provides methods and properties for working with a package. It
    lets you mark the package for installation, check if it is installed, and
    much more.
    c�.�||_||_d|_y)zInit the Package objectrN)rjrd�
_changelog)r9�pcache�pkgiters   r"rHzPackage.__init__�s����	������r,c��|jSr<�rSrNs r"rOzPackage.__str__�s���y�y�r,c��dj|jj|jj|jj�S)Nz.<Package: name:{!r} architecture={!r} id:{!r}>)rRrjrSr
rrNs r"rUzPackage.__repr__�s8��?�F�F��I�I�N�N��I�I�"�"��I�I�L�L�
�	
r,c�4�|j|jkSr<r�r8s  r"r�zPackage.__lt__�s���y�y�5�:�:�%�%r,c�~�|jjj|j�}|�t	||�Sy)z�Return the candidate version of the package.

        This property is writeable to allow you to set the candidate version
        of the package. Just assign a Version() object, and it will be set as
        the candidate version.
        N)rdr?�get_candidate_verrjr)r9r�s  r"�	candidatezPackage.candidates8���|�|�%�%�7�7��	�	�B�����4��&�&�r,c���|jj�|jjj|j|j
�|jj
�y)z)Set the candidate version of the package.N)rd�cache_pre_changer?�set_candidate_verrjr��cache_post_change)r9rFs  r"r�zPackage.candidate
sF��	
���%�%�'������0�0����G�M�M�J����&�&�(r,c�p�|jj� t||jj�Sy)z`Return the currently installed version of the package.

        .. versionadded:: 0.7.9
        N)rj�current_verrrNs r"rzPackage.installeds.���9�9� � �,��4����!6�!6�7�7�r,c�8�|jjd�S)a}Return the name of the package, possibly including architecture.

        If the package is not part of the system's preferred architecture,
        return the same as :attr:`fullname`, otherwise return the same
        as :attr:`shortname`

        .. versionchanged:: 0.7.100.3

        As part of multi-arch, this field now may include architecture
        information.
        T�rj�get_fullnamerNs r"rSzPackage.names���y�y�%�%�d�+�+r,c�8�|jjd�S)z�Return the name of the package, including architecture.

        Note that as for :meth:`architecture`, this returns the
        native architecture for Architecture: all packages.

        .. versionadded:: 0.7.100.3Fr�rNs r"r�zPackage.fullname-s���y�y�%�%�e�,�,r,c�.�|jjS)zZReturn the name of the package, without architecture.

        .. versionadded:: 0.7.100.3)rjrSrNs r"r4zPackage.shortname7s��
�y�y�~�~�r,c�.�|jjS)znReturn a uniq ID for the package.

        This can be used eg. to store additional information about the pkg.)rjrrNs r"rz
Package.id>s��
�y�y�|�|�r,c�.�|jjS)z>Return True if the package is an essential part of the system.)rj�	essentialrNs r"r�zPackage.essentialEs���y�y�"�"�"r,c�.�|jjS)aReturn the Architecture of the package.

        Note that for Architecture: all packages, this returns the
        native architecture, as they are internally treated like native
        packages. To get the concrete architecture, look at the
        :attr:`Version.architecture` attribute.

        .. versionchanged:: 0.7.100.3
            This is now the package's architecture in the multi-arch sense,
            previously it was the architecture of the candidate version
            and deprecated.
        )rjr
rNs r"r
zPackage.architectureJs���y�y�%�%�%r,c�`�|jjj|j�S)z5Return ``True`` if the package is marked for install.)rdr?�marked_installrjrNs r"r�zPackage.marked_install[�#���|�|�%�%�4�4�T�Y�Y�?�?r,c�`�|jjj|j�S)z5Return ``True`` if the package is marked for upgrade.)rdr?�marked_upgraderjrNs r"r�zPackage.marked_upgrade`r�r,c�`�|jjj|j�S)z4Return ``True`` if the package is marked for delete.)rdr?�
marked_deleterjrNs r"r�zPackage.marked_deletee�#���|�|�%�%�3�3�D�I�I�>�>r,c�`�|jjj|j�S)z2Return ``True`` if the package is marked for keep.)rdr?�marked_keeprjrNs r"r�zPackage.marked_keepjs#���|�|�%�%�1�1�$�)�)�<�<r,c�`�|jjj|j�S)zPackage is marked for downgrade)rdr?�marked_downgraderjrNs r"r�zPackage.marked_downgradeo�#���|�|�%�%�6�6�t�y�y�A�Ar,c�`�|jjj|j�S)z7Return ``True`` if the package is marked for reinstall.)rdr?�marked_reinstallrjrNs r"r�zPackage.marked_reinstalltr�r,c�2�|jjduS)z,Return ``True`` if the package is installed.N)rjr�rNs r"rrzPackage.is_installedys���y�y�$�$�D�0�0r,c�|�|jxr/|jjj|j�S)z-Return ``True`` if the package is upgradable.)rrrdr?�
is_upgradablerjrNs r"r�zPackage.is_upgradable~s.��� � �T�T�\�\�%;�%;�%I�%I�$�)�)�%T�Tr,c��|jxs|jxr/|jjj	|j
�S)z�Return ``True`` if the package is no longer required.

        If the package has been installed automatically as a dependency of
        another package, and if no packages depend on it anymore, the package
        is no longer required.
        )rrr�rdr?�
is_garbagerjrNs r"�is_auto_removablezPackage.is_auto_removable�s>��
���4��!4�!4�;��l�l�$�$�/�/��	�	�:�	;r,c�`�|jjj|j�S)z@Return whether the package is marked as automatically installed.)rdr?�is_auto_installedrjrNs r"r�zPackage.is_auto_installed�s#���|�|�%�%�7�7��	�	�B�Br,c�`�|jjj|j�S)z6Return ``True`` if the package update is being phased.)rdr?�phasing_appliedrjrNs r"rzPackage.phasing_applied�s#���|�|�%�%�5�5�d�i�i�@�@r,c�*�|j|jfD][}d|z}	t|d�5}|j�j	d�j�j
d�cddd�cSgS#1swYnxYw�m#t$rY�xwxYw)z�Return a list of files installed by the package.

        Return a list of unicode names of the files which have
        been installed by this package
        z/var/lib/dpkg/info/%s.list�rbrrN)rSr�r�readr$r(r&�OSError)r9rSrr�s    r"�installed_fileszPackage.installed_files�s����I�I�t�}�}�,�	�D�/�$�6�D�
��$��%�P��$�>�>�+�2�2�7�;�A�A�C�I�I�$�O�P�P�	��	�P�P��P���
��
�s(�B�<A9�*	B�9B	�>B�	B�BNc�^
�|jdk7r|jS|jstd�S|��|jjdjdk(rd}nW|jjdjdk(rd}n.td�}t|t�r|S|jd	�S|jj}d
}|jj}|jj}	tj�}|j|�r�|js�|jj|jk(r|j}|j}nNtj|j|�dkDr|j}|j}|j|�r��	|j#dd�}	t%|	�dkDr|	d}~	|d}
|j'd
�rd
|dz}
|j#dd�}t%|�dkDrdj)|dd�}~|||
||d�z}t+j,�}		t+j.d�|r'|j1�r	t+j.|�yt3|�}
d}dt5j6|�z}	|r'|j1�r	t+j.|�y|
j9�}|sn�|jd	�}t5j:||�}|rzt=|j>dd�}|rd|vr|j#dd�d}|jAd�}|rd|vr|j#dd�d}|rtj||�dkrn||z
}��t%|�dk(r,td�}t|t�s|jd	�}||_	t+j.|�|jS#t $rY��QwxYw#tB$r�|jjdjdk(rtd�||fz}ntd�}t|t�r|cYt+j.|�S|jd	�cYt+j.|�StDtFf$r]td�}t|t�r|cYt+j.|�S|jd	�cYt+j.|�SwxYw#t+j.|�wxYw)a�
        Download the changelog of the package and return it as unicode
        string.

        The parameter *uri* refers to the uri of the changelog file. It may
        contain multiple named variables which will be substitued. These
        variables are (src_section, prefix, src_pkg, src_ver). An example is
        the Ubuntu changelog::

            "http://changelogs.ubuntu.com/changelogs/pool" \
                "/%(src_section)s/%(prefix)s/%(src_pkg)s" \
                "/%(src_pkg)s_%(src_ver)s/changelog"

        The parameter *cancel_lock* refers to an instance of threading.Event,
        which if set, prevents the download.
        rz$The list of changes is not availableNr�Debianzshttp://packages.debian.org/changelogs/pool/%(src_section)s/%(prefix)s/%(src_pkg)s/%(src_pkg)s_%(src_ver)s/changelog�Ubuntuzuhttp://changelogs.ubuntu.com/changelogs/pool/%(src_section)s/%(prefix)s/%(src_pkg)s/%(src_pkg)s_%(src_ver)s/changelogr�main�/r��lib��:)�src_section�prefix�src_pkg�src_verr!z^%s \((.*)\)(.*)$rFz�The list of changes is not available yet.

Please use http://launchpad.net/ubuntu/+source/%s/%s/+changelog
until the changes become available or try again later.zOFailed to download the list of changes. 
Please check your Internet connection.)$r�r�r"rar�r#r6r$r6rr:rr�r�rFr��SystemErrorr&r�r*r��socket�getdefaulttimeout�setdefaulttimeout�is_setr�re�escape�readline�matchr�r�grouprrr)r9r{�cancel_lock�resrrrr�src_records�
section_splitr�
src_ver_split�timeout�changelog_file�	changelog�regexp�line_rawr0rr�
changelog_vers                     r"�
get_changelogzPackage.get_changelog�s��(�?�?�b� ��?�?�"��~�~��;�<�<��;��~�~�%�%�a�(�/�/�8�;�9��
���'�'��*�1�1�X�=�9���>�?���c�3�'��J��:�:�g�.�.��.�.�,�,�����.�.�(�(���.�.�/�/��	2�
"�/�/�1�K��$�$�W�-�"�*�*���>�>�0�0�K�4G�4G�G�)�1�1�G�)�1�1�G���*�*�;�+>�+>��H�1�L�)�1�1�G�)�1�1�G��$�$�W�-� �
�
�c�1�-�
��}���!�'��*�K���������e�$��W�Q�Z�'�F� �
�
�c�1�-�
��}���!��g�g�m�A�B�/�0�G���&����	
�
���*�*�,��N	.�K
/��(�(��+��;�#5�#5�#7��N
�$�$�W�-�K")�����	�.�"�)�)�G�2D�E���"�{�'9�'9�';�!�|
�$�$�W�-�y .�6�6�8�H�#��$�?�?�7�3�D��H�H�V�T�2�E��%,�D�N�N�I�t�$L�	�$��	�)9�(1����Q�(?��(B�I�(-���A��
�(�S�M�-A�,9�,?�,?��Q�,G��,J�M�&� '� 7� 7�
�y� Q�UV� V�!���%�I�=�B�y�>�Q�&� !�"H� I�I�%�i��5�$-�$4�$4�W�$=�	�"+���8
�$�$�W�-������u�	��	��~�
/��>�>�)�)�!�,�3�3�x�?��!��!�'�*�+�C��B�C�C��c�3�'��J�
�$�$�W�-��:�:�g�.�.�
�$�$�W�-��]�+�
/��6����c�3�'��J�
�$�$�W�-��:�:�g�.�.��$�$�W�-�
/��
�$�$�W�-�sh�:O;�'P�
8P�C=P�;	P�P�AT�(T�?T�T�'+T�T�)T�:T�T�T�T,c��t|�S)zcReturn a VersionList() object for all available versions.

        .. versionadded:: 0.7.9
        )rrNs r"�versionszPackage.versionsgs���4� � r,c�`�|jjj|j�S)z5Return True if the to-be-installed package is broken.)rdr?�is_inst_brokenrjrNs r"r+zPackage.is_inst_brokenor�r,c�`�|jjj|j�S)z/Return True if the installed package is broken.)rdr?�
is_now_brokenrjrNs r"r-zPackage.is_now_brokentr�r,c�P�|jjtjk(S)z8Checks whether the package is is the config-files state.)rj�
current_stater�CURSTATE_CONFIG_FILESrNs r"�has_config_fileszPackage.has_config_filesys���y�y�&�&�'�*G�*G�G�Gr,c���|jj�|jjj|j�|jj�y)zMark a package for keep.N)rdr�r?�	mark_keeprjr�rNs r"r3zPackage.mark_keep�s>�����%�%�'������(�(����3����&�&�(r,c�*�|jj�|jjj|j|�|r�|jjj
dkDr�t
j|jj�}|j|j�|j|j�|j|j�|j�|jj�y)a+Mark a package for deletion.

        If *auto_fix* is ``True``, the resolver will be run, trying to fix
        broken packages.  This is the default.

        If *purge* is ``True``, remove the configuration files of the package
        as well.  The default is to keep the configuration.
        rN)
rdr�r?�mark_deleterj�broken_countr�ProblemResolver�clear�protect�remove�resolver�)r9�auto_fix�purge�fixs    r"r5zPackage.mark_delete�s���	
���%�%�'������*�*�4�9�9�e�<�����.�.�;�;�a�?��)�)�$�,�,�*@�*@�A�C��I�I�d�i�i� ��K�K��	�	�"��J�J�t�y�y�!��K�K�M����&�&�(r,c��|jj�|jjj|j||�|r�|jjj
dkDrpt
j|jj�}|j|j�|j|j�|jd�|jj�y)a0Mark a package for install.

        If *autoFix* is ``True``, the resolver will be run, trying to fix
        broken packages.  This is the default.

        If *autoInst* is ``True``, the dependencies of the packages will be
        installed automatically.  This is the default.

        If *fromUser* is ``True``, this package will not be marked as
        automatically installed. This is the default. Set it to False if you
        want to be able to automatically remove the package at a later stage
        when no other package depends on it.
        rTN)rdr�r?�mark_installrjr6rr7r8r9r;r�)r9r<�	auto_inst�	from_user�fixers     r"r@zPackage.mark_install�s��� 	
���%�%�'������+�+�D�I�I�y�)�L�����.�.�;�;�a�?��+�+�D�L�L�,B�,B�C�E��K�K��	�	�"��M�M�$�)�)�$��M�M�$�����&�&�(r,c���|jr0|j}|j|��|j|�ytj
j
d|jjz�y)zMark a package for upgrade.)rBz4MarkUpgrade() called on a non-upgradeable pkg: '%s'
N)	r�r�r@�	mark_auto�sys�stderr�writerjrS)r9rB�autos   r"�mark_upgradezPackage.mark_upgrade�sZ������)�)�D����	��2��N�N�4� �
�J�J���K��)�)�.�.�!�
r,c�d�|jjj|j|�y)aMark a package as automatically installed.

        Call this function to mark a package as automatically installed. If the
        optional parameter *auto* is set to ``False``, the package will not be
        marked as automatically installed anymore. The default is ``True``.
        N)rdr?rErj)r9rIs  r"rEzPackage.mark_auto�s"��	
�����(�(����D�9r,c�P�|jjj||�y)aCommit the changes.

        The parameter *fprogress* refers to a apt_pkg.AcquireProgress() object,
        like apt.progress.text.AcquireProgress().

        The parameter *iprogress* refers to an InstallProgress() object, as
        found in apt.progress.base.
        N)rdr?�commit)r9�	fprogress�	iprogresss   r"rMzPackage.commit�s��	
�����%�%�i��;r,)r�z	apt.Cacher�zapt_pkg.Packager@rr�)r:rr@rA)r@r�)rFrr@rr�r�r�)NN)r{r�rzthreading.Event | Noner@r6)r@r)r@r�TF)r<rAr=rAr@r)TTT)r<rArArArBrAr@r)T)rBrAr@r)rIrAr@r)rNrrOrr@r))r'r(r)r*rHrOrUr�r�r��setterrrSr�r4rr�r
r�r�r�r�r�r�rrr�r�r�rrr'r)r+r-r1r3r5r@rJrErMr+r,r"rr�s������
�&��
��
����)��)������,��,��-��-����������#��#�
&�"�@��@��@��@��?��?��=��=��B��B��B��B��1��1��U��U��	;��	;��C��C��A��A�����"MQ�y��y�3I�y�	�y�v�!��!��@��@��?��?��H��H�)�)�*PT�)��)�04�)�HL�)�	
�)�4�:�	<r,rc�p	�td�ddl}tj�tj
jj�}t	j|�}|d}td|jz�td|jz�td|jjz�td|jjz�td	|jjz�td
|jjz�td|jjz�td|jj z�td
|jj"z�td|j$z�td|jj&z�td|jj(z�td|jj*z�td|jj,z�td|jj.z�td|jj0z�td|jj2z�|jj0D]-}tdj5d�|j6D����/td|jj8z�td|jj:z�td|jj<�t|dj?��dD]�}td|�|D]6}|j@s�|jCdd�dk(s�&|jE|��8td|jFjHz�td |jFjJz���t�dD]�}td!|z�t	j|�}|jM�D]-}|jCdd�dk(s�	||jO|��/td|jFjHz�td#|jFjRz���y#tP$rtd"|z�Y��wxYw)$z
Self-test.zSelf-test for the Package modulrNz	apt-utilsz	Name: %s zID: %s zPriority (Candidate): %s zPriority (Installed): %s zInstalled: %s zCandidate: %s zCandidateDownloadable: %szCandidateOrigins: %szSourcePkg: %s zSection: %s zSummary: %szDescription (formatted) :
%szDescription (unformatted):
%szInstalledSize: %s zPackageSize: %s zDependencies: %szRecommends: %s�,c	3�K�|]:}|j�d|j�d|j�d|j�d����<y�w)z (z) (�)N)rSrFrTr~)r��os  r"r�z_test.<locals>.<genexpr>�sA�������6�6�(�"�Q�Y�Y�K�s�1�:�:�,�c�!�,�,��q�I��s�AAzarch: %szhomepage: %szrec: �2vcardrPz8Running install on random upgradable pkgs with AutoFix: r�zBroken: %s zInstCount: %s z.Randomly remove some packages with AutoFix: %szError trying to remove: %s z
DelCount: %s )*�print�randomr�initr�r�r��
OpProgress�CacherSrr�r=rrFrrar6rrr1rrr rYr\r�r�r
rrDr'r��randintr@r?r6�
inst_countr�r5r�	del_count)rYr�rkrlrG�irSs       r"�_testra�s���
�
+�,���L�L�N��|�|� � �+�+�-�H��I�I�h��E�
��
�C�	�+����
 �!�	�)�c�f�f�
��	�
%��
�
�(>�(>�
>�?�	�
%��
�
�(>�(>�
>�?�	�
�S�]�]�2�2�
2�3�	�
�S�]�]�2�2�
2�3�	�
%��
�
�(B�(B�
B�C�	�
 �3�=�=�#8�#8�
8�9�	�
�S�]�]�6�6�
6�7�	�.�3�;�;�
&�'�	�-�#�-�-�/�/�
/�0�	�
)�C�M�M�,E�,E�
E�F�	�
*�S�]�]�-J�-J�
J�K�	�
����!=�!=�
=�>�	�
�s�}�}�1�1�
1�2�	�
�s�}�}�9�9�
9�:�	�
�S�]�]�5�5�
5�6��}�}�)�)�
��
��H�H���,�,��
�	
�
�
�*�s�}�}�1�1�
1�2�	�.�3�=�=�1�1�
1�2�	�'�3�=�=�'�'�(�	�%��/�
'�
'�
)�*�
�=��
�H�!�L��	(�C�� � ��>�>�!�Q�'�1�,��$�$�Q�'�	(�	�m�e�o�o�:�:�:�;�
�����!;�!;�;�<�=�
�G�
�
;��
�>��B�C��	�	�(�#���J�J�L�	@�D��~�~�a��#�q�(�@��$�K�+�+�A�.�	@�	�m�e�o�o�:�:�:�;�
�o���� 9� 9�9�:�
;��#�@��7�$�>�?�@�s�>R�R5�4R5�__main__)rr6r r�rzapt_pkg.HashStringListr@rA)/r*�
__future__rr�rrrr�rF�	threading�collections.abcrrrr�http.clientr�typingr	r
�urllib.errorr�urllib.requestrrr
r"�apt.progress.textr��apt.progress.baserr�__all__r#�	Exceptionr%r.rrwrrrrrrrar'r+r,r"�<module>rns���*)�"��	�	�
��
��A�A�%�%�"�"�� ��>����3��3�:�Z�:�H?�H?�VJL��n�%�JL�Z'
�'
�T7�W�S�#�X�
�7�tP(�P(�fM�(�7�#�M�`n<�n<�b�;;��;;�~�z��	�G�r,
¿Qué es la limpieza dental de perros? - Clínica veterinaria


Es la eliminación del sarro y la placa adherida a la superficie de los dientes mediante un equipo de ultrasonidos que garantiza la integridad de las piezas dentales a la vez que elimina en profundidad cualquier resto de suciedad.

A continuación se procede al pulido de los dientes mediante una fresa especial que elimina la placa bacteriana y devuelve a los dientes el aspecto sano que deben tener.

Una vez terminado todo el proceso, se mantiene al perro en observación hasta que se despierta de la anestesia, bajo la atenta supervisión de un veterinario.

¿Cada cuánto tiempo tengo que hacerle una limpieza dental a mi perro?

A partir de cierta edad, los perros pueden necesitar una limpieza dental anual o bianual. Depende de cada caso. En líneas generales, puede decirse que los perros de razas pequeñas suelen acumular más sarro y suelen necesitar una atención mayor en cuanto a higiene dental.


Riesgos de una mala higiene


Los riesgos más evidentes de una mala higiene dental en los perros son los siguientes:

  • Cuando la acumulación de sarro no se trata, se puede producir una inflamación y retracción de las encías que puede descalzar el diente y provocar caídas.
  • Mal aliento (halitosis).
  • Sarro perros
  • Puede ir a más
  • Las bacterias de la placa pueden trasladarse a través del torrente circulatorio a órganos vitales como el corazón ocasionando problemas de endocarditis en las válvulas. Las bacterias pueden incluso acantonarse en huesos (La osteomielitis es la infección ósea, tanto cortical como medular) provocando mucho dolor y una artritis séptica).

¿Cómo se forma el sarro?

El sarro es la calcificación de la placa dental. Los restos de alimentos, junto con las bacterias presentes en la boca, van a formar la placa bacteriana o placa dental. Si la placa no se retira, al mezclarse con la saliva y los minerales presentes en ella, reaccionará formando una costra. La placa se calcifica y se forma el sarro.

El sarro, cuando se forma, es de color blanquecino pero a medida que pasa el tiempo se va poniendo amarillo y luego marrón.

Síntomas de una pobre higiene dental
La señal más obvia de una mala salud dental canina es el mal aliento.

Sin embargo, a veces no es tan fácil de detectar
Y hay perros que no se dejan abrir la boca por su dueño. Por ejemplo…

Recientemente nos trajeron a la clínica a un perro que parpadeaba de un ojo y decía su dueño que le picaba un lado de la cara. Tenía molestias y dificultad para comer, lo que había llevado a sus dueños a comprarle comida blanda (que suele ser un poco más cara y llevar más contenido en grasa) durante medio año. Después de una exploración oftalmológica, nos dimos cuenta de que el ojo tenía una úlcera en la córnea probablemente de rascarse . Además, el canto lateral del ojo estaba inflamado. Tenía lo que en humanos llamamos flemón pero como era un perro de pelo largo, no se le notaba a simple vista. Al abrirle la boca nos llamó la atención el ver una muela llena de sarro. Le realizamos una radiografía y encontramos una fístula que llegaba hasta la parte inferior del ojo.

Le tuvimos que extraer la muela. Tras esto, el ojo se curó completamente con unos colirios y una lentilla protectora de úlcera. Afortunadamente, la úlcera no profundizó y no perforó el ojo. Ahora el perro come perfectamente a pesar de haber perdido una muela.

¿Cómo mantener la higiene dental de tu perro?
Hay varias maneras de prevenir problemas derivados de la salud dental de tu perro.

Limpiezas de dientes en casa
Es recomendable limpiar los dientes de tu perro semanal o diariamente si se puede. Existe una gran variedad de productos que se pueden utilizar:

Pastas de dientes.
Cepillos de dientes o dedales para el dedo índice, que hacen más fácil la limpieza.
Colutorios para echar en agua de bebida o directamente sobre el diente en líquido o en spray.

En la Clínica Tus Veterinarios enseñamos a nuestros clientes a tomar el hábito de limpiar los dientes de sus perros desde que son cachorros. Esto responde a nuestro compromiso con la prevención de enfermedades caninas.

Hoy en día tenemos muchos clientes que limpian los dientes todos los días a su mascota, y como resultado, se ahorran el dinero de hacer limpiezas dentales profesionales y consiguen una mejor salud de su perro.


Limpiezas dentales profesionales de perros y gatos

Recomendamos hacer una limpieza dental especializada anualmente. La realizamos con un aparato de ultrasonidos que utiliza agua para quitar el sarro. Después, procedemos a pulir los dientes con un cepillo de alta velocidad y una pasta especial. Hacemos esto para proteger el esmalte.

La frecuencia de limpiezas dentales necesaria varía mucho entre razas. En general, las razas grandes tienen buena calidad de esmalte, por lo que no necesitan hacerlo tan a menudo e incluso pueden pasarse la vida sin requerir una limpieza. Sin embargo, razas pequeñas como el Yorkshire o el Maltés, deben hacérselas todos los años desde cachorros si se quiere conservar sus piezas dentales.

Otro factor fundamental es la calidad del pienso. Algunas marcas han diseñado croquetas que limpian la superficie del diente y de la muela al masticarse.

Ultrasonido para perros

¿Se necesita anestesia para las limpiezas dentales de perros y gatos?

La limpieza dental en perros no es una técnica que pueda practicarse sin anestesia general , aunque hay veces que los propietarios no quieren anestesiar y si tiene poco sarro y el perro es muy bueno se puede intentar…… , pero no se va a poder pulir ni acceder a todas la zona de la boca …. Además los limpiadores dentales van a irrigar agua y hay riesgo de aspiración a vías respiratorias si no se realiza una anestesia correcta con intubación traqueal . En resumen , sin anestesia no se va hacer una correcta limpieza dental.

Tampoco sirve la sedación ya que necesitamos que el animal esté totalmente quieto, y el veterinario tenga un acceso completo a todas sus piezas dentales y encías.

Alimentos para la limpieza dental

Hay que tener cierto cuidado a la hora de comprar determinados alimentos porque no todos son saludables. Algunos tienen demasiado contenido graso, que en exceso puede causar problemas cardiovasculares y obesidad.

Los mejores alimentos para los dientes son aquellos que están elaborados por empresas farmacéuticas y llevan componentes químicos con tratamientos específicos para el diente del perro. Esto implica no solo limpieza a través de la acción mecánica de morder sino también un tratamiento antibacteriano para prevenir el sarro.

Conclusión

Si eres como la mayoría de dueños, por falta de tiempo , es probable que no estés prestando la suficiente atención a la limpieza dental de tu perro. Por eso te animamos a que comiences a limpiar los dientes de tu perro y consideres atender a su higiene bucal con frecuencia.

Estas simples medidas pueden conllevar a que tu perro tenga una vida más larga y mucho más saludable.

Si te resulta imposible introducir un cepillo de dientes a tu perro en la boca, pásate con él por clínica Tus Veterinarios y te explicamos cómo hacerlo.

Necesitas hacer una limpieza dental profesional a tu mascota?
Llámanos al 622575274 o contacta con nosotros

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Hola!