HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/self/root/usr/share/apt-listchanges/__pycache__/
Upload File :
Current File : //proc/self/root/usr/share/apt-listchanges/__pycache__/DebianFiles.cpython-311.pyc
�

Dc``O@��B�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZd�ZGd�d��ZGd�d��ZGd	�d
��ZGd�d��ZGd
�d��ZGd�d��ZGd�d��ZddgZdS)�N)�_)�reducec�b�dddddd�}|�|���d��S)N����)�critical�	emergency�high�medium�low�c)�get�lower)�u�urgency_maps  �)/usr/share/apt-listchanges/DebianFiles.py�_numeric_urgencyr-s;��"#�"#�"#�"#�"#�	&�&�K��?�?�1�7�7�9�9�b�)�)�)�c�N�eZdZejd��Zgd�Zd�Zd�Zd�Z	d�Z
dS)�
ControlStanzaz^\S+ \((?P<version>.*)\).*)�Package�Source�Version�Architecture�Statusc	�8�d}|�d��D]�}|sdS|ddvr(|r%t||t||��dz|z���9|�dd��\}}||jvr$t|||������d}��dS)N�
r)� �	�:r)�split�setattr�getattr�fields_to_read�lstrip)�self�s�field�line�values     r�__init__zControlStanza.__init__;s������G�G�D�M�M�	!�	!�D��
�����A�w�+�%�%��M��D�%���u�)=�)=��)D�t�)K�L�L�L��#�z�z�#�q�1�1���u��D�/�/�/��D�%������8�8�8�8� �E�E�	!�	!rc�`�t|d|j���d��dS)Nrr r)r%rr#�r(s r�sourcezControlStanza.sourceLs)���t�X�t�|�4�4�:�:�3�?�?��B�Brc�j�t|d��o#|j�d��ddkS)Nrr r�	installed)�hasattrrr#r/s rr2zControlStanza.installedOs1���t�X�&�&�S�4�;�+<�+<�S�+A�+A�!�+D��+S�Src���|j}t|d��rM|j�|j��}|r,|�d��}|�|��s|S|S)a�
        This function returns the version of the package. One would like it to
        be the "binary" version, though we have the tough case of source
        package whose binary packages versioning scheme is different from the
        source one (see OOo, linux-source, ...).

        This code does the following, if the Source field is set with a
        specified version, then we use the binary version if and only if the
        source version is a prefix. We must do that because of binNMUs.
        r�version)rr3�source_version_re�matchr�group�
startswith)r(�vr7�svs    rr5zControlStanza.versionRsl��
�L���4��"�"�	��*�0�0���=�=�E��
��[�[��+�+���|�|�B�'�'���I��rN)�__name__�
__module__�__qualname__�re�compiler6r&r-r0r2r5�rrrr7st������"��
�#@�A�A��Q�Q�Q�N�!�!�!�"C�C�C�T�T�T�����rrc�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)�
ControlParserc�"�g|_i|_dS�N)�stanzas�indexr/s rr-zControlParser.__init__hs�������
�
�
rc�j�i|j|<|jD] }||j|t||��<�!dSrE)rGrFr%)r(r*�stanzas   r�	makeindexzControlParser.makeindexlsG����
�5���l�	?�	?�F�8>�D�J�u��g�f�e�4�4�5�5�	?�	?rc�`�	t|dd���5}|xjd�|����d��D��z
c_ddd��dS#1swxYwYdS#t$r5}tt
d��|t|��d�z��|�d}~wwxYw)N�utf-8�replace)�encoding�errorsc�0�g|]}|�t|����SrA)r��.0�xs  r�
<listcomp>z*ControlParser.readfile.<locals>.<listcomp>ts&�� W� W� W�a�UV� W��q�!1�!1� W� W� Wr�

�'Error processing '%(what)s': %(errmsg)s��what�errmsg)�openrF�readr#�	Exception�RuntimeErrorr�str)r(�file�f�exs    r�readfilezControlParser.readfileqs!��	K��d�W�Y�?�?�?�
X�1���� W� W�1�6�6�8�8�>�>�&�;Q�;Q� W� W� W�W���
X�
X�
X�
X�
X�
X�
X�
X�
X�
X�
X�
X����
X�
X�
X�
X�
X�
X���	K�	K�	K��q�!J�K�K�)-��R��� A� A� B�C�C�HJ�
K�����	K���s;�A.�AA!�A.�!A%�%A.�(A%�)A.�.
B-�80B(�(B-c�N�	dd|gtjz}tj|��}|j�t|�dd������dS#t$r5}ttd��|t|��d�z��|�d}~wwxYw)Nzdpkg-debz-frLrMrVrW)rr&�
subprocess�check_outputrF�append�decoder\r]rr^)r(�deb�command�outputras     r�readdebzControlParser.readdebys���	J�!�4��-�
�0L�L�G��,�W�5�5�F��L���
�f�m�m�G�Y�.O�.O� P� P�Q�Q�Q�Q�Q���	J�	J�	J��q�!J�K�K�),��B��� @� @� A�B�B�GI�
J�����	J���s�A!A%�%
B$�/0B�B$c���||jvr$||j|vr|j||SdS|jD]*}t||��rt||��|kr|cS�+dSrE)rGrFr3r%)r(r*r,rIs    r�findzControlParser.find�s~���D�J�����
�5�)�)�)��z�%�(��/�/��t��,�
"�
"���6�5�)�)�"�g�f�e�.D�.D��.M�.M�!�M�M�M���trN)r<r=r>r-rJrbrkrmrArrrCrCgse���������?�?�?�
K�K�K�J�J�J�
�
�
�
�
rrCc��eZdZd
d�Zd�Zd�Zed���Zed���Zed���Z	ed���Z
ed	���Zed
���Zd�Z
e
ZdS)�ChangelogEntryFc��|���|_||_t|��|_d|_d|_||_dS)N�)�strip�_header�_versionr�_trailer�_content�_binnmu)r(�headerr5�urgency�binnmus     rr-zChangelogEntry.__init__�sA���|�|�~�~�����
� 0�� 9� 9�����
���
�����rc�8�|���|_dSrE)�rstripru)r(�trailers  r�set_trailerzChangelogEntry.set_trailer�s�����(�(��
�
�
rc�r�|jr|xj|z
c_dS|���s	||_dSdSrE)rv�isspace)r(�contents  r�add_contentzChangelogEntry.add_content�sG���=�	$��M�M�W�$�M�M�M�M����"�"�	$�#�D�M�M�M�	$�	$rc��|jSrE)rtr/s rr5zChangelogEntry.version��
���}�rc��|jSrE�rr/s r�numeric_urgencyzChangelogEntry.numeric_urgency�����$�$rc��|jSrE)rwr/s rrzzChangelogEntry.binnmu��
���|�rc��|jSrE)rsr/s rrxzChangelogEntry.header�r�rc��|jSrE)rur/s rr}zChangelogEntry.trailer�r�rc�4�|j���SrE)rvr|r/s rr�zChangelogEntry.content�s���}�#�#�%�%�%rc��|jdz|jzdz|jz}|jr	|jr|S|���S)NrU)rxr�r}rr)r(�results  r�__str__zChangelogEntry.__str__�sG����v�%���4�v�=���L���;�	�4�<�	��M��|�|�~�~�rN)F)r<r=r>r-r~r��propertyr5r�rzrxr}r�r��__repr__rArrroro�s�����������)�)�)�$�$�$�����X���%�%��X�%�����X������X������X���&�&��X�&����
�H�H�Hrroc��eZdZd�Zed���Zed���Zed���Zed���Zed���Z	d�Z
d�Zd	S)
�Changesc�X�||_g|_g|_td��|_dS)Nr)�_package�_entries�_binnmusr)r(�packages  rr-zChanges.__init__�s-����
���
���
� 0�� 7� 7����rc��|jSrE)r�r/s rr�zChanges.package�r�rc��|jSrEr�r/s rr�zChanges.numeric_urgency�r�rc��|jSrE)r�r/s r�entrieszChanges.entries�r�rc��|jSrE)r�r/s r�binnmuszChanges.binnmus�r�rc�t�|jr0d�tt|j����dzSdS)NrUrq)r��join�mapr^r/s r�changeszChanges.changes�s5���=�	A��;�;�s�3��
�6�6�7�7�&�@�@��rrc��|jr|j�|��dS|j�|��t	|j|j��|_dSrE)rzr�rfr��minrr��r(�entrys  r�
save_entryzChanges.save_entry�s]���<�	V��M� � ��'�'�'�'�'��M� � ��'�'�'�$'��(=�u�?T�$U�$U�D�!�!�!rc�j�|j���|j���dSrE)r��reverser�r/s rr�zChanges.reverse�s0���
�������
�������rN)r<r=r>r-r�r�r�r�r�r�r�r�rArrr�r��s�������8�8�8�����X���%�%��X�%�����X������X������X��
V�V�V� � � � � rr�c��eZdZejd��Zejd��Zejdej��Zejd��Z	dZ
d�Zd�Zd�Z
d	S)
�ChangelogParserz8^\S+ \((?P<version>.*)\) .*;.*urgency=(?P<urgency>\w+).*zV^(\S+ \(?\d.*\)|Old Changelog:|Changes|ChangeLog begins|Mon|Tue|Wed|Thu|Fri|Sat|Sun).*z(;;\s*)?Local\s+variables.*z^\s--\s.*<.*@.*>.*$zbinary-only=yesc��||_dSrE)�_changes)r(r�s  rr-zChangelogParser.__init__�s
����
�
�
rc�$�d}d}d}|rt|��nd}|���D�]�}|�dd��}|�d��r�/|�c|�d��s|dkrH|s0|j�|��r|�|���~|�|����|s|j�|��nd}|r�d}|�	d	��}	|rtj|	|��d
krn�|�|��|�!|t|jj��krd}n�t!||	|�	d��|j|v��}��N|j�|��r/|snad}|�|��t!|dd
d��}���|j�|��rn|�|�|�����|�|��|S)z�Parse changelog or news from the given file descriptor.
        If since_version is specified, only save entries later
        than the specified version.
        If latest is specified, only the latest N versions.FNrLrM�#r rTr5rryrqr)�int�	readlinesrgr9�_changelog_trailerr7r~r��_changelog_headerr8�apt_pkg�version_compare�_save_entry�lenr�r�ro�_binnmu_marker�_changelog_header_ancient�_changelog_header_emacs)
r(�fd�
since_version�latest�ancientr��is_debian_changelogr+r7r5s
          r�parsezChangelogParser.parse�sf��
����#�� &�0��V����D���L�L�N�N�)	�)	�D��;�;�w�	�2�2�D����s�#�#�
��� �d�o�o�c�&:�&:� �d�d�l�l��,�4�#:�#@�#@��#F�#F�,��%�%�d�+�+�+�+��%�%�d�+�+�+�+�CJ�S��.�4�4�T�:�:�:�t����*.�'�#�k�k�)�4�4�G�$���)@��AN�*P�*P�ST�*U�*U����$�$�U�+�+�+��)�f��D�M�<Q�8R�8R�.R�.R� $����*�4��%�+�+�i�:P�:P�+/�+>�$�+F�H�H�E�E��3�9�9�$�?�?��.����"�G��$�$�U�+�+�+�*�4��U�E�B�B�E�E��1�7�7��=�=���E��&��%�%�d�+�+�+�+���������"�"rc�B�|�|j�|��dSdSrE)r�r�r�s  rr�zChangelogParser._save_entry*s,�����M�$�$�U�+�+�+�+�+��rN)r<r=r>r?r@r�r��
IGNORECASEr�r�r�r-r�r�rArrr�r��s�������"��
�#^�_�_�� *��
�,E�!F�!F��(�b�j�)G���W�W��#���$:�;�;��&�N� � � �7#�7#�7#�r,�,�,�,�,rr�c�&�eZdZd�Zd�Zd�Zd�ZdS)�ChangelogsReaderc�L�||_||_||_||_||_dSrE)�_source_pkg_name�_rootdir�_since_version�_latest�_reverse)r(�source_pkg_name�rootdirr�r�r�s      rr-zChangelogsReader.__init__/s+�� /�����
�+��������
�
�
rc�����t�j�����fd�}t||d��}|rt||d��p|}|sdS�jr�����S)Nc�z��|p8��tj��j|�����SrE)�_read_changelog�os�pathr�r�)�acc�fnamer�r(s  ��r�<lambda>z2ChangelogsReader.read_changelogs.<locals>.<lambda>9s8����)E�t�/C�/C�����T�]�E�:�:�G�0E�0E�rF)r�r�rr�r�)r(�	filenames�binnmus_filenames�
find_firstr�r�s`    @r�read_changelogsz ChangelogsReader.read_changelogs6s������$�/�0�0��E�E�E�E�E�
��
�I�u�5�5���	L��J�(9�5�A�A�K�V�F��	��4��=�	��O�O�����rc���|�|��}|sdS|5t|���||j|j��cddd��S#1swxYwYdS)NF)�_open_changelog_filer�r�r�r�)r(�filenamer�r�s    rr�z ChangelogsReader._read_changelogHs���
�
&�
&�x�
0�
0���	��5�
�	Y�	Y�"�7�+�+�1�1�"�d�6I�4�<�X�X�	Y�	Y�	Y�	Y�	Y�	Y�	Y�	Y�	Y�	Y�	Y�	Y����	Y�	Y�	Y�	Y�	Y�	Ys�.A�A�Ac���tj|��}|D]�}	tj�|��r%t	jt
d��|z��n=|�d��rtj	|��cSt|d��cSnB#t$r5}|jtj
kr|jtjkr�Yd}~��d}~wwxYwdS)Nz(Ignoring `%s' (seems to be a directory!)z.gz�rb)�globr�r��isdir�ALCLog�errorr�endswith�gzip�GzipFilerZ�IOError�errno�ENOENT�ELOOP)r(r�r��es    rr�z%ChangelogsReader._open_changelog_filePs����I�h�'�'�	�!�	�	�H�

��7�=�=��*�*�0��L��#M�!N�!N�QY�!Y�Z�Z�Z�Z��&�&�u�-�-�0��=��2�2�2�2�2���$�/�/�/�/�/�����
�
�
��7�e�l�*�*�q�w�%�+�/E�/E�����������
�����ts�A,B�	B�
C�'+C�CN)r<r=r>r-r�r�r�rArrr�r�.sS������ � � ����$Y�Y�Y�����rr�c�,�eZdZd�Zd�Zd�Zd�Zd�ZdS)rc��||_t��}|�|j��|jd}|j|_|���|_|���|_|j	|_
dS)Nr)r�rCrkrFr�binaryr0r5rr�arch)r(r��parser�pkgdatas    rr-zPackage.__init__bsk����	��������t�y�!�!�!��.��#�������~�~�'�'������(�(����(��	�	�	rc��|�d��}|�d��}|�d|jz��}|�d��}g}	|dks|dkr|	�|��|dks|dkr?|	�|��|	�|��|	�|��|�|	��}
	t	|j|
|||��}|�|d��}|�||z|��}
tj|
d	��n#tj|
d	��wxYw||
fS)
aiExtract changelog and binnmu entries, news or both from the package.

        Unpacks changelog or news files from the binary package, and parses them.
        If since_version is specified, only return entries later than the specified version.
        If latest is specified, only the latest N versions.
        Returns a tuple of sequences of Changes objects.zNEWS.Debianzchangelog.Debianzchangelog.Debian.�	changelog�both�news�
changelogsNr)	�_changelog_variationsr��extend�_extract_contentsr�r0r��shutil�rmtree)r(�whichr�r�r��news_filenames�changelog_filenames�changelog_filenames_binnmu�changelog_filenames_nativer��tempdir�readerr�r�s              r�extract_changeszPackage.extract_changesns|���3�3�M�B�B��"�8�8�9K�L�L��%)�%?�%?�@S�VZ�V_�@_�%`�%`�"�%)�%?�%?��%L�%L�"��	��F�?�?�e�v�o�o����^�,�,�,��F�?�?�e�|�3�3����0�1�1�1����7�8�8�8����7�8�8�8��(�(��3�3��		&�%�d�k�7�M�6�SZ�[�[�F��)�)�.�$�?�?�D��.�.�/B�E_�/_�-G�I�I�I�
�M�'�1�%�%�%�%��F�M�'�1�%�%�%�%�����i� � s
�!AD>�>Ec	�Z�tjd���}tj�||jdz��}t
|d��}	ddd|j�d|j��g}tj	td	��d
t|��iz��tj
||tjdd�
��t|jd|||���|gd��	|���t'j|d��S#tj$re}tjtd��|j|jr|j�dd��nt|��d�z��Yd}~nSd}~wt2$rC}tjtd��|jt|��d�z��Yd}~nd}~wwxYw|���t'j|d��n.#|���t'j|d��wxYwdS)a�Run apt-get changelog and parse the downloaded changelog.

        Retrieve changelog using the "apt-get changelog" command, and parse it.
        If since_version is specified, only return entries later than the specified version.
        If latest is specified, only the latest N versions.
        Returns a single sequence of Changes objects or None on downloading or parsing failure.�apt-listchanges��prefixz
.changelog�wzapt-getz-qqr��=z%Calling %(cmd)s to retrieve changelog�cmd�xT)�stdout�stderr�timeout�checkrqNrz]Unable to retrieve changelog for package %(pkg)s; 'apt-get changelog' failed with: %(errmsg)srLrM)�pkgrYz_Unable to retrieve changelog for package %(pkg)s; could not run 'apt-get changelog': %(errmsg)s)�tempfile�mkdtempr�r�r�r�rZrr��debugrr^rd�run�PIPEr�r0r��closer�r��CalledProcessErrorr�rrgr\)	r(r�r�r�r�changelog_file�changelog_fdriras	         r�extract_changes_via_aptzPackage.extract_changes_via_apt�s����"�*;�<�<�<������g�t�{�\�/I�J�J���N�C�0�0��	&� �%������d�l�l�6[�\�G��L��B�C�C�u�c�RY�l�l�F[�[�\�\�\��N�7�<�
��Y\�dh�i�i�i�i�$�D�K��]�F�$+�-�-�-<�_�n�=M�t�-T�-T�
U�
��� � � ��M�'�1�%�%�%�%��%�,�	i�	i�	i��L��K�L�L�%)�[�PR�PY�(f��	�(8�(8��)�(L�(L�(L�_b�ce�_f�_f�h�h�h�
i�
i�
i�
i�
i�
i�
i�
i�����
�	2�	2�	2��L��L�M�M�%)�[�(+�B���1�1�1�
2�
2�
2�
2�
2�
2�
2�
2�����	2����
��� � � ��M�'�1�%�%�%�%��
��� � � ��M�'�1�%�%�%�%�����tsD�A+D�:,G=�G� AF�;G=�
G�
9G�G=�G�G=�=+H(c	��tjd���}dtj|j���dtj|���dd�d�|D�����d�}t
j|��}t
j|��r>t
j	|��tjkrtj
|d��t�|S)	Nrrzdpkg-deb --fsys-tarfile z | tar xf - --wildcards -C r c�6�g|]}tj|����SrA)�shlex�quoterQs  rrTz-Package._extract_contents.<locals>.<listcomp>�s ��8�8�8��e�k�!�n�n�8�8�8rz 2>/dev/nullr)rrrrr�r�r��system�WIFSIGNALED�WTERMSIG�signal�SIGINTr�r��KeyboardInterrupt)r(r�r�extract_command�statuss     rr�zPackage._extract_contents�s����"�*;�<�<�<���
�K��	�"�"�"�"�E�K��$8�$8�$8�$8��H�H�8�8�i�8�8�8�9�9�9�9�
����?�+�+��
�>�&�!�!�	$�b�k�&�&9�&9�V�]�&J�&J��M�'�1�%�%�%�#�#��rc�(��ddg}�fd�|D��S)Nz./usr/share/doc/*/%s.gzz./usr/share/doc/*/%sc���g|]}|�z��SrArA)rRrSr�s  �rrTz1Package._changelog_variations.<locals>.<listcomp>�s���.�.�.���H��.�.�.rrA)r(r��formatss ` rr�zPackage._changelog_variations�s*���,�)�+��.�.�.�.�g�.�.�.�.rN)r<r=r>r-rrr�r�rArrrrasa������
)�
)�
)�!!�!!�!!�F'�'�'�T���&/�/�/�/�/rr)r?r�rr�r�r�r�rr!rdr�r��ALChacksr�	functoolsrrrrCror�r�r�r�__all__rArr�<module>r,s���4
�	�	�	�	�	�	�	�����������������
�
�
�
�����
�
�
�
���������
�
�
�
�������������
*�*�*�-�-�-�-�-�-�-�-�`%�%�%�%�%�%�%�%�N/�/�/�/�/�/�/�/�b& �& �& �& �& �& �& �& �PE,�E,�E,�E,�E,�E,�E,�E,�N1�1�1�1�1�1�1�1�fp/�p/�p/�p/�p/�p/�p/�p/�f
�Y�
(���r