%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/aptsources/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/aptsources/__pycache__/distinfo.cpython-312.pyc

�

\�eo<�
���ddlZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZddlZddlm
Zdededeefd	�ZGd
�d�ZGd�d
�ZGd�d�ZGd�d�Zdedeefd�ZGd�d�Zedk(�rqedd�Zej4ej6�ej8D�];Zej4dej<z�ej4dej>z�ej4dej@z�ej4dejBz�ejDik7r3ej4deejDjG��z�ejHD];Z%ej4de%j<�de%j>�de%jL����=ejND]!Z(ej4d e(j>z��#��>yy)!�N)�Iterator)�PIPE�Popen)�cast)�gettext�template�csv_path�returnc	#���	K�t�}tj|�5}|D]k}d|vr#|j|dj	d��d|vrd|dvrnA|j|d�t
|�j�Ed{����m	ddd�y|D]}d|vs�|j|d��	ddd�t|�5}tttj|���}ddd�D]�}|d|vr�d��|djd	d�|d<tj|�5}|D]�}d|vsd|dvr�d
|vr,|d�	t�	fd�|d
j	d�D��r�?t
|�jdi|��j�D]}|j!d
�r�|�����	ddd���tj|�5}|D]}d|vs�d|dvs�n|D]/}d|vrd|dvr�t
|�j�Ed{����1	ddd�y7���#1swY���xYw#1swY��TxYw#1swY��_xYw7�:#1swYyxYw�w)
a~Expand the given template.

    A template file consists of a header, followed by paragraphs
    of templated suites, followed by a footer. A templated suite
    is any paragraph where the Suite field contains {.

    This function expands all templated suites using the information
    found in the CSV file supplied by distro-info-data.

    It yields lines of template info.
    zX-Exclude-Suitesz, �Suite�{N�series��versionz LTSz	X-Versionc3���K�|]d}|jd�xrtj|dd��dkxs/|jd�xrtj|dd��dkD���fy�w)�le�Nr�ge)�
startswith�apt_pkg�version_compare)�.0�field�vers  ��5/usr/lib/python3/dist-packages/aptsources/distinfo.py�	<genexpr>z#_expand_template.<locals>.<genexpr>Ys������
�"�"�,�,�T�2�L� '� 7� 7��a�b�	�3� G�!� K��
"�,�,�T�2�L� '� 7� 7��a�b�	�3� G�!� K�
�
�s�A*A-�)�setr�TagFile�update�split�add�str�
splitlines�open�reversed�list�csv�
DictReader�replace�any�formatr)
rr	�known_suites�tmpl�section�
csv_object�releases�rel�liners
         @r�_expand_templater4%s�������5�L�
����	"�3�d��	�G�!�W�,��#�#�G�,>�$?�$E�$E�d�$K�L��'�!��'�'�*�*��� � ���!1�2��7�|�.�.�0�0�0�	�
�3�3��	3�G��'�!�� � ���!1�2�	3�3�&
�h��>�:��D����
�!;�<�=��>�����x�=�L�(�����Y��/�/���;��I��
�_�_�X�
&�	�$��
���'�)�S���8H�-H���'�)��i�.�C��
�&-�[�%9�%?�%?��%E�
�
�!�/�C��L�/�/�6�#�6�A�A�C��D����{�3� ��J��)
�	�	��@
����	"�1�d��	�G��'�!�c�W�W�-=�&=��	��	1�G��'�!�c�W�W�-=�&=���7�|�.�.�0�0�0�
	1�
1�1�[
1��3�3��&>�>��	�	��N
1��1�1�s�� I4�A*H?�
H<�H?�	I4�	H?�(H?�?I4�(I�:AI4�BI�	I4�(
I(�3I(�;0I(�+I&�,I(�3	I4�<H?�?I	�I4�I�I4�I#	�I4�&I(�(I1�-I4c�4�eZdZdd�Zdedefd�Zdedefd�Zy)	�Templater
Nc���d|_d|_g|_d|_d|_d|_d|_g|_g|_d|_	i|_
d|_d|_d|_
y�NFT)�name�child�parents�
match_name�description�base_uri�type�
components�children�	match_uri�
mirror_set�distribution�	available�official��selfs r�__init__zTemplate.__init__|sf�� $��	���
�')���&*���'+���$(��
� $��	�+-���(*��
�%)���-/���(,��������
��compc�,�|d�|jD�vS)z6Check if the distribution provides the given componentc3�4K�|]}|j���y�w�N)r9)r�cs  rrz)Template.has_component.<locals>.<genexpr>�s����8�1����8�s�)r@)rHrKs  r�
has_componentzTemplate.has_component�s���8����8�8�8rJ�urlc�|�t|�\}}}||jvr|j|j||�Sy)z6Check if a given url of a repository is a valid mirrorF)�	split_urlrC�has_repository)rHrQ�proto�hostname�dirs     r�	is_mirrorzTemplate.is_mirror�s=��(��~���x���t���&��?�?�8�,�;�;�E�3�G�G�rJ)r
N)�__name__�
__module__�__qualname__rIr#�boolrPrXrrJrr6r6{s-��� 9�#�9�$�9��S��T�rJr6c
��eZdZ			ddededzdedzdedzfd�Zdedzfd�Zd	eddfd
�Zdedzfd�Zdeddfd�Zdeddfd
�Z	dedzfd�Z
y)�	ComponentNr9�desc�	long_desc�parent_componentc�<�||_||_||_||_yrN)r9r=�description_longra)rHr9r_r`ras     rrIzComponent.__init__�s#����	���� )��� 0��rJr
c��|jSrN�rarGs r�get_parent_componentzComponent.get_parent_component�����$�$�$rJ�parentc��||_yrNre)rHrhs  r�set_parent_componentzComponent.set_parent_component�s
�� &��rJc�d�|j�|jS|j�|jSyrN)rcr=rGs r�get_descriptionzComponent.get_description�s5��� � �,��(�(�(�
�
�
�
)��#�#�#�rJc��||_yrN)r=�rHr_s  r�set_descriptionzComponent.set_description�s
����rJc��||_yrN�rcrns  r�set_description_longzComponent.set_description_long�s
�� $��rJc��|jSrNrqrGs r�get_description_longzComponent.get_description_long�rgrJ)NNN)rYrZr[r#rIrfrjrlrorrrtrrJrr^r^�s��� � $�'+�
1��
1��D�j�
1���:�	
1�
��*�
1�%�c�D�j�%�'�3�'�4�'���t��� �C� �D� �%��%��%�%�c�D�j�%rJr^c
��eZdZdZ	ddededededzfd�Zdededdfd	�Zdeded
fd�Zdedede	fd�Z
deefd
�Zdedzfd�Zdeddfd�Z
y)�Mirrorz&Storage for mirror related informationNrUrVrW�locationc�R�||_g|_|j||�||_yrN)rV�repositories�add_repositoryrw)rHrUrVrWrws     rrIzMirror.__init__�s*��!��
�.0������E�3�'� ��
rJr
c�N�|jjt||��yrN)ry�append�
Repository�rHrUrWs   rrzzMirror.add_repository�s����� � ��E�3�!7�8rJr}c�`�|jD�cgc]}|j|k(s�|��c}Scc}wrN)ryrU)rHrU�rs   r�get_repositories_for_protoz!Mirror.get_repositories_for_proto�s'���,�,�A�a����5�0@��A�A��As�+�+c�l�|�y|jD]"}|j|k(s�||jvs�"yyr8)ryrUrW)rHrUrWr�s    rrTzMirror.has_repository�s=���;���"�"�	�A��w�w�%��C�1�5�5�L��	�rJc�r�|jD�cgc]}|j|j���c}Scc}wrN)ry�get_urlrV)rHr�s  r�
get_repo_urlszMirror.get_repo_urls�s)��26�2C�2C�D�Q��	�	�$�-�-�(�D�D��Ds�"4c��|jSrN�rwrGs r�get_locationzMirror.get_location�s���}�}�rJc��||_yrNr�)rHrws  r�set_locationzMirror.set_location�s	�� ��
rJrN)rYrZr[�__doc__r#rIrzr'r�r\rTr�r�r�rrJrrvrv�s���0�KO�!��!�$'�!�.1�!�=@�4�Z�!�9�C�9�c�9�d�9�B��B��\�8J�B��C��c��d��E�t�C�y�E��c�D�j��!�S�!�T�!rJrvc�F�eZdZdededdfd�Zdeeeffd�Zdedefd�Zy)	r}rUrWr
Nc� �||_||_yrN�rUrWr~s   rrIzRepository.__init__�s����
���rJc�2�|j|jfSrNr�rGs r�get_infozRepository.get_info�s���z�z�4�8�8�#�#rJrVc�>�|j�d|�d|j��S)Nz://�/r�)rHrVs  rr�zRepository.get_url�s!���*�*��S��
�!�D�H�H�:�6�6rJ)rYrZr[r#rI�tupler�r�rrJrr}r}�sC���c������$�%��S��/�$�7��7��7rJr}rQc��tjd|d��}t|�dkr |jd�t|�dkr� |S)zCsplit a given URL into the protocoll, the hostname and the dir partz:*\/+�)�maxsplitrN)�rer!�lenr|)rQr!s  rrSrS�s=���H�H�X�s�Q�/�E�

�e�*�q�.�
���T���e�*�q�.��LrJc�B�eZdZ		d	dedzdefd�Zdededzddfd�Zy)
�DistInfoN�dist�base_dirc��d|_g|_tjj	d�|_d}t
jd�}t
jd�}|s4	tgd�dt��j�dj�}||_i}|�d|�d�}d
|j%��d�}	t't(d�}
t't*d�}t-||	�D�]�}|j/dd�}
t1|
�dkr�%|
dj�}|
dj�}|dk(rt3|�|_�a|dk(r||_�n|dk(rE|j7|
|�t't*d�}t)�}
||
_||
_d|z|
_��|dk(r||
_��|dk(r`d|
_|jD]H}|j8|k(s�|
j@jC|�|jDjC|
��J��*|dk(rtjF|�|
_$��K|dk(rtjF|�|
_%��l|dk(r	||
_&��z|dk(r|
jNs	||
_'���|d|j
zk(r	||
_'���|dk(r|
jPs	||
_(���|d|j
zk(r	||
_(���|dk(s|d |j
zk(�r.tRjTjW|�xr|xs=tRjTjYtRjTj[||��}||vr�i}	t]|�5}t_ta|jb|D�cgc]}|j���c}��}ddd�D]`}|jid"�r|jkd#|�}�'tm|�\}}}||vr||jo||��Ptq||||�||<�b|||<|||
_9��*|d$k(rt3|�|
_:��A|d%k(rE|r6|
jw|j8�s|
jxjC|�t+|�}���|d&k(r|j{t3|�����|d'k(r|j}t3|�����|d(k(s���|j|����|j7|
|�t't(d�}
t't*d�}y#t$rB}|jtjk7rtj d	|z�d
}Yd}~���d}~wwxYwcc}w#1swY���xYw#td$rtgd!|���g}Y���wxYw))NrzAPT::Architecturez^#LOC:(.+)$zS^(#LOC:.+)|(((http)|(ftp)|(rsync)|(file)|(mirror)|(https))://[A-Za-z0-9/\.:\-_@]+)$)�lsb_releasez-iz-sT)�universal_newlines�stdoutrz&lsb_release failed, using defaults: %s�Debianr�z.infoz/usr/share/distro-info/z.csv�:�r��ChangelogURI�MetaReleaseURIrz^%s$�	MatchName�ParentSuite�	Available�Official�RepositoryType�BaseURIz
BaseURI-%s�MatchURIzMatchURI-%s�MirrorsFilezMirrorsFile-%sz$WARNING: Failed to read mirror file z#LOC:z\1�Descriptionr^�CompDescription�CompDescriptionLong�ParentComponent)@�metarelease_uri�	templatesr�config�find�archr��compilerr�communicate�strip�OSError�errno�ENOENT�logging�warningr��lowerrr6r^r4r!r��_�changelogs_uri�finish_templater9rDr<r:r;r|rA�string_to_boolrErFr?r>rB�os�path�isabs�abspath�joinr%r'�filter�match�	Exception�printr�subrSrzrvrCr=rPr@rorrrj)rHr�r�rw�	match_loc�match_mirror_line�exc�map_mirror_sets�
dist_fname�	csv_fnamer�	componentr3�tokensr�value�nannyrC�value_f�x�mirror_datarUrVrWs                        rrIzDistInfo.__init__�s��
 "���)+����N�N�'�'�(;�<��	����J�J�~�.�	��J�J�
&�
���

 ��3�+/�#��
!�[�]�1�&��U�W����	��� �z��4�&��.�
�-�d�j�j�l�^�4�@�	���$�'����D�)�	�$�Z��;�T	6�D��Z�Z��Q�'�F��6�{�Q����1�I�O�O�%�E��1�I�O�O�%�E���&�&'��h��#��*�*�',��$��'�!��$�$�X�y�9� ��D�1�	�#�:�� %��
�(,��%�&,�u�n��#��+�%�&+��#��-�'�!%���!�^�^�8�E��z�z�U�*� �(�(�/�/��6����-�-�h�7�	8�
�+�%�%,�%;�%;�E�%B��"��*�$�$+�$:�$:�5�$A��!��*�*� %��
��)�#�H�,=�,=�$)��!��,����2�2�$)��!��*�$�X�-?�-?�%*��"��-�$�)�)�3�3�%*��"��-�'�5�4D�t�y�y�4P�+P��G�G�M�M�%�(���F��w�w���r�w�w�|�|�H�e�'D�E��
��/�46�J�
)�!�%�[��G�*.� &�$5�$;�$;�8?�$@�1�Q�W�W�Y�$@�!"�+�K��!,�
���?�?�7�3�'0�}�}�U�D�'A�H�$�1:�4��.���#�#�z�1�&�x�0�?�?��s�K�39� %�x��h�4�J�x�0�
�.8�O�E�*�&5�e�&<��#��-�'�'(��x��$��+�%��X�%;�%;�I�N�N�%K��'�'�.�.�y�9�%�e�,�	��+�+��)�)�!�E�(�3��/�/��.�.�q��x�8��+�+��.�.�u�5�iT	6�j	
���X�y�1���$�'����D�)�	��M�
 ��9�9����,��O�O�$L�s�$R�S����
 ��J%A�	���%�)�� D�U�G�L�M�&(��)�sT�"3T�U!�U�0U�U�U!�	U�
7U�U�U�U	�U!�!U>�=U>rr�r
c��|sy|j�<|jr0|jD]!}|js�|j|_n|jik(r<|jr0|jD]!}|js�|j|_n|r8|j	|j
�s|jj|�d}|jD]}|j|_�|jj|�y)zfinish the current tempalteN)
rBr:r;rCrPr9r@r|rFr�)rHrr��ts    rr�zDistInfo.finish_templatezs��������%�(�.�.��%�%�
���;�;�)*���H�&��
����"�$�����%�%�
���;�;�*+�,�,�H�'��
��X�3�3�I�N�N�C����&�&�y�1��I��!�!�	+�A� !�
�
�H��	+������h�'rJ)N�/usr/share/python-apt/templates)rYrZr[r#rIr6r^r�rrJrr�r��sI�� �9�B*��D�j�B*��B*�H(��(�Y��=M�(�RV�(rJr��__main__�Ubuntur�z

Suite: %szDesc: %szBaseURI: %szMatchURI: %szMirrors: %s� z -z  %s))r(r�r�r�r��collections.abcr�
subprocessrr�typingrrrr�r#r4r6r^rvr}r'rSr�rY�d�infor�r�rr9r=r>rBrC�keysr@rKrcrAr:rrJr�<module>r�s���0���	�	�$�"��� �S1�s�S1�c�S1�h�s�m�S1�l��<"%�"%�J !� !�F	7�	7��3��4��9��Z(�Z(�z�z����<�=�A��G�L�L��!�!�"��K�K�
5������]�X�]�]�2�3�����Z�(�"6�"6�6�7�����]�X�%6�%6�6�7�����^�h�&8�&8�8�9����"�$��G�L�L���h�.A�.A�.F�.F�.H�)I�I�J��'�'�	W�D��G�L�L�1�T�Y�Y�K�r�$�*:�*:�);�2�d�>S�>S�=T�U�V�	W��&�&�	5�E��G�L�L��%�"3�"3�3�4�	5�
5�rJ

Zerion Mini Shell 1.0