403Webshell
Server IP : 217.160.0.244  /  Your IP : 216.73.217.138
Web Server : Apache
System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64
User : u100174116 ( 6746176)
PHP Version : 8.5.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/aptsources/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/aptsources/__pycache__/sourceslist.cpython-313.pyc
�

8.�g�����SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
JrJrJ
r
 SSKJrJrJrJrJr SSKrSSKJr SSKJrJr \"S5r/SQrS	\S
\S\4SjrS
\\S\\4Sjr "SS\!5r""SS\!5r#"SS\!\\5r$S\S\4Sjr%S+Sjr&"SS5r'"SS5r("SS5r)\\)\'4r*\\)\'\(4r+"SS5r,"S S!5r-"S"S#5r.\/S$:Xa�\R`"5 \-"5r1\1H&r2\Rf"S%\2R95-5 M( \"S&S'5r4\Rf"S(\4-5 \Rf"\"S)S'55 \Rf"\"S&S*55 gg),�N)�Callable�Iterable�Iterator)�Any�Generic�Optional�TypeVar�Union�)�_deb822)�DistInfo�Template�T)�	is_mirror�Deb822SourceEntry�SourceEntry�NullMatcher�SourcesList�SourceEntryMatcher�
master_uri�compare_uri�returnc��URS5nURS5nX:XagURS5SnURS5SnSU;aX"RS5S-SU:Xagg![a gf=f)z�check if the given add_url is idential or a mirror of orig_uri e.g.:
master_uri = archive.ubuntu.com
compare_uri = de.archive.ubuntu.com
-> True
z/ Tz//rF�.N)�rstrip�split�
IndexError�index)rr�compare_srv�
master_srvs    �8/usr/lib/python3/dist-packages/aptsources/sourceslist.pyrr;s����$�$�T�*�K��"�"�4�(�J�� ���!�'�'��-�a�0���%�%�d�+�A�.�
��k��k�*;�*;�C�*@�1�*D�*F�G�:�U��������s�(A4�4
B�B�sc�*�[[U55$)asimple and efficient way to return uniq collection

This is not intended for use with a SourceList. It is provided
for internal use only. It does not have a leading underscore to
not break any old code that uses it; but it should not be used
in new code (and is not listed in __all__).)�list�set)r"s r!�uniqr&Xs����A��<��c�p�\rSrSrS\S\4SjrSS\SS\S-S	\S-4S
jjrSSS\S-S	S4Sjr	S
r
g)�SingleValueProperty�b�key�docc��XlX lg�N�r+�__doc__��selfr+r,s   r!�__init__�SingleValueProperty.__init__c������r'N�objr�objtyperc�X�UcU$URRURS5$r.)�section�getr+�r2r6r7s   r!�__get__�SingleValueProperty.__get__gs'���;��K��{�{���t�x�x��.�.r'�valuec�j�UcURUR	gX!RUR'gr.)r9r+�r2r6r>s   r!�__set__�SingleValueProperty.__set__ns'���=����D�H�H�%�$)�K�K����!r'�r0r+r.)�__name__�
__module__�__qualname__�__firstlineno__�strr3r�typer<rA�__static_attributes__�r'r!r)r)bsf���C��c��
JN�/��/�0�/�;?�$�;�/�	�t��/�*�.�*�s�T�z�*�d�*r'r)c�p�\rSrSrS\S\4SjrSS\SS\S-S	\\4S
jjr	SSS\\S	S4Sjr
S
rg)�MultiValueProperty�ur+r,c��XlX lgr.r/r1s   r!r3�MultiValueProperty.__init__vr5r'Nr6rr7rc�~�UcU$[RURRURS55$)N�)r�mysplitr9r:r+r;s   r!r<�MultiValueProperty.__get__zs2���;��K��"�"�3�;�;�?�?�4�8�8�R�#@�A�Ar'�valuesc�T�SRU5URUR'g)N� )�joinr9r+)r2r6rUs   r!rA�MultiValueProperty.__set__�s�� #���� 0����D�H�H�r'rCr.)rDrErFrGrHr3rrIr$r<rArJrKr'r!rMrMusj���C��c��
JN�B��/�0�B�;?�$�;�B�	
�c��B�1�.�1��S�	�1�d�1r'rMc�`�\rSrSrS\4SjrS
S\SS\S-S\4S	jjrSSS
\SS4Sjr	Sr
g)�ExplodedEntryProperty��parentc��Xlgr.�r]�r2r]s  r!r3�ExplodedEntryProperty.__init__�s���r'Nr6�ExplodedDeb822SourceEntryr7rc�V�UcU$URRUR5$r.)r]r<r;s   r!r<�ExplodedEntryProperty.__get__�s'���;��K��{�{�"�"�3�:�:�.�.r'r>c�p�UR5 URRURU5 gr.)�	split_outr]rAr@s   r!rA�ExplodedEntryProperty.__set__�s#���
�
�������C�J�J��.r'r_r.)rDrErFrGrr3rrIr<rArJrKr'r!r[r[�sW���q��RV�/��7�8�/�CG�$�;�/�	
�/�/�6�/�q�/�T�/r'r[�propc��U$r.rK)rhs r!�DeprecatedPropertyrj�s���Kr'c��g)z3Behaves like an expired weakref.ref, returning NoneNrKrKr'r!�
_null_weakrefrl�s��r'c�z�\rSrSrS'S\R
\-S-S\S\S4SjjrS\	S	\	4S
jr
\"SS5r\"S
S5r
\"\"S
S55r\"SS5r\"\"SS55r\"SS5r\"\"SS55r\"SS5r\S	\4Sj5r\R0S\S	S4Sj5r\S	\S-4Sj5r\R0S\S-S	S4Sj5r\S	\4Sj5r\R0S\S	S4Sj5r\S	\4Sj5r\S	\4Sj5rS	\4SjrS	\4S jrS!\S	S4S"jrSS#S	\4S$jr S(S%jr!S&r"g))r�Nr9�filer$rc��Uc[R"S5UlO7[U[5(a[R"U5UlOXl[	UR5UlX lSUlSUl[RS"5UlU(a[R"U5Ul
g[Ul
g)NrRFrb)r�Sectionr9�
isinstancerH�_linero�template�	may_merge�weakref�WeakSet�	_children�ref�_listrl)r2r9ror$s    r!r3�Deb822SourceEntry.__init__�s����?�"�?�?�2�.�D�L�
���
%�
%�"�?�?�7�3�D�L�"�L�����&��
��	�)-��
���� ���)D�E�G����;B�;�;�t�;L�D�J�&�D�Jr'�otherrc��URUR:H=(a� URUR:H=(a� UR=(aw URRS5URRS5:H=(a9 URUR:H=(a UR
UR
:H$�z+equal operator for two sources.list entries�/��disabledrI�urir�dist�comps�r2r|s  r!�__eq__�Deb822SourceEntry.__eq__�s���
�M�M�U�^�^�+�
*��	�	�U�Z�Z�'�
*����
*�������$��	�	�(8�(8��(=�=�
*��	�	�U�Z�Z�'�	
*�
�
�
�e�k�k�)�
	
r'�
ArchitectureszThe list of architectures�TypeszThe list of types�URIszURIs in the source�SuiteszSuites in the source�
ComponentszComponents in the sourcec�.�URR$)�1Legacy attribute describing the paragraph header.�r9�header�r2s r!�comment�Deb822SourceEntry.comment�s���|�|�"�"�"r'r�c�$�XRlg)r�Nr�)r2r�s  r!r�r��s��&���r'c�j�[R"URS5$![a gf=f)z%Return the value of the Trusted field�TrustedN)�apt_pkg�string_to_boolr9�KeyErrorr�s r!�trusted�Deb822SourceEntry.trusted�s3��	��)�)�$�,�,�y�*A�B�B���	��	�s�"%�
2�2r>c�x�UcURS	gU(aSOSURS'g![a gf=f)Nr��yes�no�r9r��r2r>s  r!r�r��s@���=�
��L�L��+�05�e�$�D�L�L��#���
��
�s�
,�
9�9c�l�[R"URRSS55(+$)zCheck if Enabled: no is set.�Enabledr�)r�r�r9r:r�s r!r��Deb822SourceEntry.disabled�s)���)�)�$�,�,�*:�*:�9�e�*L�M�M�Mr'c�n�U(aSURS'gURS	g![a gf=f)Nr�r�r�r�s  r!r�r��s6���&*�D�L�L��#�
��L�L��+���
��
�s�
'�
4�4c�$�UR(+$)z7A section is invalid if it doesn't have proper entries.)r9r�s r!�invalid�Deb822SourceEntry.invalid�s���<�<��r'c��UR$)z The entire (original) paragraph.)rsr�s r!�line�Deb822SourceEntry.line�s���z�z�r'c�>�UR5R5$r.�rH�stripr�s r!�__str__�Deb822SourceEntry.__str__s���x�x�z���!�!r'c�,�[UR5$)z(Section as a string, newline terminated.)rHr9r�s r!rH�Deb822SourceEntry.strs���4�<�<� � r'�enabledc��U(+Ulg)z.Deprecated (for deb822) accessor for .disabledN�r��r2r�s  r!�set_enabled�Deb822SourceEntry.set_enabled���#���
r'�AnySourceEntryc
���UR(d/URc"[SUR55(dgURUR:wag[U[5(dgURUR:wa.[SURUR455(dg[[URR5[URR5-5HXnUR5S;aMURRUS5nURRUS5nX4:wdMX g [[UR 5[UR 5:g[UR"5[UR"5:g[UR$5[UR$5:g[UR&5[UR&5:g[UR(5[UR(5:g/5S:�agUR H*nXPR ;dMU=R U/-
slM, UR"H*nX`R";dMU=R"U/-
slM, UR$H*nXpR$;dMU=R$U/-
slM, UR&H*nX�R&;dMU=R&U/-
slM, UR(H*n	X�R(;dMU=R(U	/-
slM, g)z-Merge the two entries if they are compatible.Nc3�8# �UHoRv� M g7fr.)rt)�.0�childs  r!�	<genexpr>�*Deb822SourceEntry.merge.<locals>.<genexpr>s���C�N�5���N�s�Fc3�,# �UH
nSU;v� M g7f)zAdded by software-propertiesNrK)r��cs  r!r�r�s���5
�9V�A�*�a�/�9V�s�)�types�uris�suites�
components�
architecturesz	signed-byrT)rurt�allrxrorrrr��anyr%r$r9�tags�lowerr:�sumr�r�r�r�r�)
r2r|�tag�in_self�in_other�typr��suite�	component�archs
          r!�merge�Deb822SourceEntry.merges�������
�
�%��C�D�N�N�C�C�C���9�9��
�
�"���%�!2�3�3���<�<�5�=�=�(��5
�:>�,�,��
�
�9V�5
�2
�2
���t�D�L�L�-�-�.��e�m�m�6H�6H�1I�I�J�C��y�y�{�����l�l�&�&�s�D�1�G��}�}�(�(��d�3�H��"��K� 
���
�
�O�s�5�;�;�'7�7���	�	�N�c�%�*�*�o�5�����$��E�L�L�(9�9���
�
�O�s�5�;�;�'7�7���*�*�+�s�5�3F�3F�/G�G��
��	
���;�;�C��*�*�$��
�
�s�e�#�
���:�:�C��)�)�#��	�	�c�U�"�	���\�\�E��K�K�'�����w�&��"����I��
�
�*��
�
�y�k�)�
�%��'�'�D��-�-�-��"�"�t�f�,�"�(�r'c�L�URH�nURH�nURHnnURH[nURUR
UR4X4U4:XdM.URU:Xde[R"U5Ul
M] Mp M� M� g)z_If we end up being split, check if any of our children need to be reparented to the new parent.N)rxr�r�r��_type�_uri�_suiter]rvry�_parent)r2�tor�r�r�r�s      r!�_reparent_children�$Deb822SourceEntry._reparent_childrenPs|���^�^�E��x�x���7�7�C�!#����!�K�K����U�\�\�B�s�QV�FW�W�#(�<�<�4�#7�7�#7�,3�K�K��O�E�M�"+�#� �$r')rxrsrzr�rorur9rtr.)r�rrN)#rDrErFrGrrqrHrr3rr�rMr�r�rjr)rIr�r�r�r�r��propertyr��setter�boolr�r�r�r�r�r�r�r�rJrKr'r!rr�s��
)-�	'����3�&��-�'��'��}�%�	'�0

�C�

�C�

�'��8S�T�M��w�(;�<�E��1�'�;N�O�P�D��f�&:�;�D�
�0��9M�N�
O�C�
��*@�
A�F��1�(�<R�S�T�D��|�-G�H�E�
�#��#��#�
�^�^�&�s�&�t�&��&���������
�^�^�?�T�D�[�?�T�?��?��N�$�N��N��_�_��d��t����� �� �� ���c����"��"�!�S�!�$�4�$�D�$�B�+�B��B�H<r'rc��\rSrSrSr/SQrS\S\S\S\4Sjr\	S	\4S
j5r
\	S	\4Sj5r\RS\S	S4S
j5r\	S	\
\4Sj5r\	S	\
\4Sj5r\	S	\
\4Sj5r\	S	\4Sj5r\RS\S	S4Sj5r\	S	\4Sj5r\RS\S	S4Sj5rSSjrSSjrS	\4Sjr\"\R.5r\"\R05r\"\R25r\\"\R65r\"\R85r\"\R:5rS\S	S4Sjr\	S	\4Sj5rSr g)rbi[zXThis represents a bit of a deb822 paragraph corresponding to a legacy sources.list entry)r�r�r�r�rt�__weakref__r]r�r�r�c��[R"U5UlX lX0lX@lURUlURRU5 gr.)	rvryr�r�r�r�rtrx�add)r2r]r�r�r�s     r!r3�"ExplodedDeb822SourceEntry.__init__as@���{�{�6�*����
��	�������
������T�"r'rc�\�URbUR5=nbU$[S5e)Nz#The parent entry is no longer valid)r��
ValueErrorr`s  r!r]� ExplodedDeb822SourceEntry.parentis.���<�<�#��,�,�.�(��5��
��>�?�?r'c�:�UR5 UR$r.)�'_ExplodedDeb822SourceEntry__check_validr�r�s r!r��ExplodedDeb822SourceEntry.urips�������y�y�r'Nc���UR5 URRVs/sHo"UR:waUOUPM snURlXlgs snfr.)rfr]r�r�)r2r��us   r!r�r�usK������BF�+�+�BR�BR�S�BR�Q�d�i�i��A�S�8�BR�S������	��Ts�Ac��UR/$r.�rIr�s r!r��ExplodedDeb822SourceEntry.types{����	�	�{�r'c��UR/$r.�r�r�s r!r�� ExplodedDeb822SourceEntry.suitesr�r'c��UR/$r.�r�r�s r!r��ExplodedDeb822SourceEntry.uris�s�����z�r'c�:�UR5 UR$r.)r�r�r�s r!rI�ExplodedDeb822SourceEntry.type�s�������z�z�r'c���UR5 U/URlXlUR	5 URU:XdeURRUR/:Xdegr.)rfr]r�r�r�)r2r�s  r!rIr��s[������ �E������
������z�z�S� � � ��{�{� � �T�Z�Z�L�0�0�0r'c�:�UR5 UR$r.)r�r�r�s r!r��ExplodedDeb822SourceEntry.dist�s�������{�{�r'c���UR5 U/URlXlUR	5 URU:XdeURRUR/:Xdegr.)rfr]r�r�r�)r2r�s  r!r�r��s[������#�W������������{�{�e�#�#�#��{�{�!�!�d�k�k�]�2�2�2r'c�r�URR5c[S5eURRHjnURRHMnURR
H0nXU4URURUR4:XdM.   g MO Ml [SU35e)N�The parent entry is dead�Could not find parent of )	r]rzr�r�r�r�r�r�r�)r2rIr�r�s    r!�
__check_valid�'ExplodedDeb822SourceEntry.__check_valid�s����;�;����&��7�8�8��K�K�%�%�D��{�{�'�'��!�[�[�/�/�E��5�)�d�j�j�$�)�)�T�[�[�-Q�Q��0�(�&�
�4�T�F�;�<�<r'c	���URnURURUR4UR/UR
/UR/4:XagUR5nUc[S5eURRU5nURU5 Sn[UR5GHn[UR5H�n[UR5H�n[[R"UR 5UR"US9n	U/U	lU/U	lU/U	lSU	lUR'U	5 URR)X95 XgU4URUR
UR4:XdM�[*R,"U	5UlSnM� M� GM U(d[SU35eg![an[SUS35UeSnAff=f)Nr�z Parent entry for partial deb822 z no longer validF)r9ror$Tr�)r]r�r�r�r�r�r�rzr�r$r�remove�reversedrrrqr9rorur��insertrvryr�)
r2r]�sources_listr�e�
reparentedrIr�r��news
          r!rf�#ExplodedDeb822SourceEntry.split_out�s��������L�L�&�+�+�v�}�}�5�
�Z�Z�L�
�Y�Y�K�
�[�[�M�:
�
�

��|�|�~�����7�8�8�	� �%�%�+�+�F�3�E�	���F�#��
��V�\�\�*�D�����,��%�f�m�m�4�E�+� '������ ?�#�[�[�)��C�
"&��C�I� #�u�C�H�"'��C�J�$(�C�M��-�-�c�2� �%�%�,�,�U�8��5�)�d�j�j�$�)�)�T�[�[�-Q�Q�'.�{�{�3�'7���%)�
�5�-�+�$��8���?�@�@���5�	��2�4�&�8H�I���
��	�s�8G�
G7�"G2�2G7c�n�SURSURSURSUR3$)Nz<child rWz of )r�r�r�r�r�s r!�__repr__�"ExplodedDeb822SourceEntry.__repr__�s1�������A�d�i�i�[��$�+�+��d�4�<�<�.�Q�Qr'r�c��U(+Ulg)zSet the source to enabled.Nr�r�s  r!r��%ExplodedDeb822SourceEntry.set_enabled�r�r'c�.�URR$)zReturn the file.)r]ror�s r!ro�ExplodedDeb822SourceEntry.file�s���{�{���r')r�r�r�r�r�rt�rN)!rDrErFrGr0�	__slots__rrHr3r�r]r�r�r$r�r�r�rIr�r�rfrr[r�r�r�r�r�r�r�r�rorJrKr'r!rbrb[s#��b�R�I�#�0�#�s�#��#�S�#��@�)�@��@���S����	�Z�Z��s��t����
��t�C�y�������S�	������d�3�i������c����
�[�[�1��1��1��1���c����
�[�[�3�#�3�$�3��3�=�)A�VR�#�R�*�*;�*I�*I�J�M�!�"3�"9�"9�:�E�#�$5�$=�$=�>�G�$�T�*�+<�+E�+E�F�H�#�$5�$=�$=�>�G�#�$5�$=�$=�>�G�$�4�$�D�$�� �c� �� r'rbc�>�\rSrSrSrSS\S\S-4SjjrS\S\4S	jr\	S\S\
\4S
j5rS\SS4SjrS\
SS4S
jrS\4SjrS\4Sjr\S\
\R
4Sj5r\S\
\R
4Sj5r\S\
\R
4Sj5rSrg)ri�zsingle sources.list entryNr�roc�^�SUlSUlSUl/UlSUlSUlSUl/UlSUlXl	Uc[RRS5nURS5(a[S5eX lUR!U5 SUl/Ulg)NFrR�Dir::Etc::sourcelist�.sourcesz6Classic SourceEntry cannot be written to .sources file)r�r�rIr�r�r�r�r�r�r�r��config�	find_file�endswithr�ro�parsert�children)r2r�ros   r!r3�SourceEntry.__init__�s��������
���	�(*���$(��������	� "��
�����	��<��>�>�+�+�,B�C�D��=�=��$�$��U�V�V��	��
�
�4��)-��
�+-��
r'r|rc�p�URUR:H=(a� URUR:H=(aw URRS5URRS5:H=(a9 URUR:H=(a UR
UR
:H$r~r�r�s  r!r��SourceEntry.__eq__s���
�M�M�U�^�^�+�
*��	�	�U�Z�Z�'�
*�������$��	�	�(8�(8��(=�=�
*��	�	�U�Z�Z�'�
*��
�
�e�k�k�)�	
r'c��UR5n/nSnSnSn[[U55H�nXS:Xa-U(aSnSnURU5 XnM-SnX U-
nM8XS:XaSnX U-
nMKU(a0XR	5(dSnURU5 XnM�XR	5(aU(dSnM�X U-
nM� [U5S:�aURU5 U$)zta split() implementation that understands the sources.list
format better and takes [] into account (for e.g. cdroms)rRF�[T�]r)r��range�len�append�isspace)r��pieces�tmp�p_found�space_found�is      r!rS�SourceEntry.mysplit
s����z�z�|�����������s�4�y�!�A��w�#�~��"'�K�"�G��M�M�#�&��'�C�"�G���7�N�C���C�����A�w����T�W�_�_�%6�%6�#���
�
�c�"��g������"�"�7�"���A�w���-"�0�s�8�a�<��M�M�#���
r'c�T�XlUR5nUS:XdUS:XaSUlgUSS:Xa>SUlUSSR5R	5nUSS;aSUlgUSSnURS5nUS:�aXS-SUlUSUnURU5n[U5S:aSUlgUSR5Ul	URS	;aSUlgUSR5SS
:Xa�URS5RS5R	5nUH`nUR	SS5upgUS
:XaUR	S5UlM6US:Xa[R"U5UlMYSUlMb USR5Ul[UR 5S:aSUlUSR5Ul[U5S:�aUSSUlg/Ulg![a SUlM�f=f)zPparse a given sources.list (textual) line and break it up
into the field we haverR�#TNrr)�rpm�rpm-src�deb�deb-src�)r1r2r/r0r!z[]�=r��,r��)r�r�r�r�r�findr�rSr$rI�popr�r�r�r��	Exceptionr�r�r�)r2r�r'r+�options�optionr+r>s        r!r�SourceEntry.parse3s����	��z�z�|���2�:�����D�L����7�c�>� �D�M��!�"�X�^�^�%�+�+�-�F��!�9� D�D�#�����A�B�x���I�I�c�N���q�5��A���=�D�L����8�D����d�#���v�;��?��D�L���1�I�O�O�%��	��9�9�@�@��D�L���!�9�?�?��Q��3�&��j�j��m�)�)�$�/�5�5�7�G�!��
,�!'���c�1�!5�J�C��f�}�-2�[�[��-=��*��	�)�'.�'=�'=�e�'D���'+���"��!�9�?�?�$����t�x�x�=�1���D�L��1�I�O�O�%��	��v�;��?�����D�J��D�J��+!�(�#'�D�L�(�s�H�H'�&H'�	new_valuec���U(+UlU(a/URR5RS5UlgURR5SS:waSUR-Ulgg)z!set a line to enabled or disabledr.rN)r�r��lstripr�)r2r=s  r!r��SourceEntry.set_enabledss[��%�
��
���	�	�(�(�*�1�1�#�6�D�I��y�y��� ��#�s�*��$�)�)�O��	�+r'c�>�UR5R5$)zdebug helperr�r�s r!r��SourceEntry.__str__~s���x�x�z���!�!r'c��UR(aUR$SnUR(aSnXR-
nUR(aOUR
bBUSR
SRUR5UR
(aSOS5-
nO[UR
bUSUR
(aSOS--
nO2UR(a!USSRUR5--
nUS	URS	UR3-
n[UR5S
:�a!US	S	RUR5--
nURS:waUSUR--
nUS-
nU$)
z!return the current line as stringrRz# z [arch={} trusted={}]r5r�r�z
 [trusted=%s]z
 [arch=%s]rWrz #�
)
r�r�r�rIr�r��formatrXr�r�r$r�r�)r2r�s  r!rH�SourceEntry.str�s9���<�<��9�9�����=�=��D��	�	������$�,�,�":��+�2�2�����+�+�,�����4��
�D��\�\�
%��O����u�$�G�G�D�
�
�
��L�3�8�8�D�,>�,>�#?�?�?�D��!�D�H�H�:�Q�t�y�y�k�*�*���t�z�z�?�Q���C�#�(�(�4�:�:�.�.�.�D��<�<�2���D�4�<�<�'�'�D������r'c��UR/$)z'deb822 compatible accessor for the typer�r�s r!r��SourceEntry.types�����	�	�{�r'c��UR/$)z&deb822 compatible accessor for the urir�r�s r!r��SourceEntry.uris�s�����z�r'c��UR/$)z(deb822 compatible accessor for the suiter�r�s r!r��SourceEntry.suites�rIr')
r�rr�r�r�r�ror�r�rtr�rIr�r.)rDrErFrGr0rHr3rr��staticmethodr$rSrr�r�r�r��builtinsr�r�r�rJrKr'r!rr�s��#�.�S�.��d�
�.�(
�C�
�C�
��#�c�#�d�3�i�#��#�J>�#�>�$�>�@	,�T�	,�d�	,�"��"��S��6��t�H�L�L�)������d�8�<�<�(�������X�\�\�*���r'rc�*�\rSrSrSrS\S\4SjrSrg)ri�za Matcher that does nothingr"rc��g)NTrK)r2r"s  r!�match�NullMatcher.match�s��r'rKN)	rDrErFrGr0�AnyExplodedSourceEntryr�rRrJrKr'r!rr�s��%��-��$�r'rc��\rSrSrSrS*SS.S\S\S\4SjjjrS+SjrS	\	\
4SjrS
\\
/\4S\S	\	\
4SjrSSS
/S
4S\S\S\S\\S\S\S\S
-S\\S\
S
-S	\
4SjjrS\
S	S
4SjrS\S	S
4SjrS,S\S
-S	\4S jjrS\S	S
4S!jrS"\
S	\4S#jrS+S$jrS+S%jrS&\\
S	\\\
\\\\
444S'jrS	\\
4S(jrS)r g
)-ri�z6represents the full sources.list + sources.list.d fileF)�deb822�withMatcher�matcherPathrVc��/UlU U(a[U5UlO[5UlX0lUR5 gr.)r$r�matcherrrV�refresh)r2rWrXrVs    r!r3�SourcesList.__init__�s4��+-��	���-�k�:�D�L�&�=�D�L������r'rNc��/Ul[RRS5nUS:wa5[R
R
U5(aURU5 [RRS5nUS:wa�[R
R
U5(a�[[R"U55HpnUR(aURS5(dURS5(dMBUR[R
RX!55 Mr URH1nUR(aMURR!U5 M3 g)z update the list of known entriesrz	/dev/null�Dir::Etc::sourcepartsrz.listN)r$r�rr�os�path�exists�load�find_dir�sorted�listdirrVrrXr�rZrR)r2ro�partsdir�sources    r!r[�SourcesList.refresh�s�����	��~�~�'�'�(>�?���;��2�7�7�>�>�$�#7�#7��I�I�d�O��>�>�*�*�+B�C���{�"�r�w�w�~�~�h�'?�'?��r�z�z�(�3�4���K�K�D�M�M�*�$=�$=�$�-�-��C�C��I�I�b�g�g�l�l�8�:�;�	5��i�i�F��>�>�>����"�"�6�*� r'c#�8# �URShv�N gN7f)z?simple iterator to go over self.list, returns SourceEntry
typesN�r$r�s r!�__iter__�SourcesList.__iter__�s����9�9���s����
predicates�attrsc/�l^^# �TRSS5nUR5H�mU(aATR(a0URS5TRRS5:waMK[	UU4SjT55(dMh[	U4SjU55(dM�Tv� M� g7f)Nr�rc3�H># �UHn[TU5TU:Hv� M g7fr.)�getattr)r�r+rnrgs  ��r!r��%SourcesList.__find.<locals>.<genexpr>�s!����G��#�7�6�3�'�5��:�5��s�"c3�2># �UHo"T5v� M g7fr.rK)r��	predicatergs  �r!r�rr�s����P�3=�i�	�&�!�!�:�s�)r8�
exploded_listr�rr�)r2rmrnr�rgs  ` @r!�__find�SourcesList.__find�s������i�i��t�$���(�(�*�F��v�z�z�c�j�j��o����9J�9J�3�9O�&O���G��G�G�G�C�P�3=�P�M�M���
+�s�BB4�B4�+	B4rR���rIr�r��
orig_compsr��posror�r]c
	�z^�UR5nURS5n
U
(aUSSR5n[T5mUSSnUR	U4SjU
SUUUS9nUHCn
UH:nX�R
;dMX�R
U5	[U5S:XdM6U
s s $ ME UR	U4SjSUUUS	9nUH�n
U
RU
:XaC[U
R
5[U5:wa[U
R
U-5U
lU
s $U
R(dMiU
(aMr[U
R
5[U5:XdM�SU
lU
s $ Uc[RRS
5nURS5(a�[SXpS9nU	(a][U	S
U	5n	[!U	[5(deU	R"R$HnU	R"UUR"U'M! U/UlU/UlU/UlX�lT(a[-T5UlX_R"lX�lO�U
(aSOSUT(aSSR3T5-OSUU/nUR5U5 U(aUR7SU-5 SR3SU55S-n[9U5nUbXlUR<R?U5 US:aUR,R7U5 U$UR,RAXo5 U$)z�
Add a new source to the sources.list.
The method will search for existing matching repos and will try to
reuse them as far as possible
r.rNc�4>�[UR5T:H$r.�r%r��r"r�s �r!�<lambda>�!SourcesList.add.<locals>.<lambda>
����c�!�/�/�*�m�;r'F)r�r�rIr�r�rc�4>�[UR5T:H$r.r}r~s �r!rr�r�r')r�rIr�r�rr)ror$r]rRz	[arch=%s]r5rWc3�6# �UHo(dMUv� M g7fr.rK)r��parts  r!r��"SourcesList.add.<locals>.<genexpr>Ps���;�U�T�d�D�D�U�s�
�	rD)!r��
startswithr?r%�_SourcesList__findr�rr$r�r&r�rrrrrqrrr9r�r�r�r�r$r�r�rX�extendr%rrorZrRr)r2rIr�r�ryr�rzror�r]r�r��sourcesrg�new_comp�	new_entry�k�partsr�s        `          r!r��SourcesList.add�s����$�z�z�|���?�?�3�'������8�?�?�$�D��M�*�
��1�
���+�+�;������
�
���F�!���|�|�+��k�k�(�3�4��5�z�Q��%�
�
"���+�+�;������
���F����(�*��v�|�|�$��E�
�2�#'����u�(<�#=�F�L��
��������v�|�|�$��E�
�2�&+�F�O�!�M���<��>�>�+�+�,B�C�D��=�=��$�$�)�$�T�E�I�� ���6�:��!�&�*;�<�<�<�<����,�,�A�+1�>�>�!�+<�I�%�%�a�(�-�#�f�I�O�!�U�I�N� $�v�I��#�O��*.�}�*=�	�'�'.���$�!)�� ��R��;H��s�x�x�
�6�6�b����E�
�L�L�������S�7�]�+��8�8�;�U�;�;�d�B�D�#�D�)�I���!%�������9�%���7��I�I���Y�'���
�I�I���S�,��r'�source_entryc��[U[5(aUR5 URnURRU5 g)z0remove the specified entry from the sources.listN)rrrbrfr]r$r)r2r�s  r!r�SourcesList.remove]s9���l�$=�>�>��"�"�$�'�.�.�L��	�	����&r'�
backup_extc��[RRS5n[RRX!-5(a=[RRU5(a[R"X!-U5 [RRS5n[R"SU-5HDn[RRX!-5(dM+[R"X!-U5 MF g)z8restore sources.list files based on the backup extensionrr^z%s/*N)
r�rrr_r`ra�shutil�copyrc�glob)r2r�rorfs    r!�restore_backup�SourcesList.restore_backupds����~�~�'�'�(>�?��
�7�7�>�>�$�+�,�,�������1E�1E��K�K��)�4�0��>�>�*�*�+B�C���I�I�f�x�/�0�D��w�w�~�~�d�/�0�0����D�-�t�4�1r'c�T�[5nUc[R"S5nURHtnURU;dM[
RRUR5(dME[R"URURU35 Mv U$)zxmake a backup of the current source files, if no backup extension
is given, the current date/time is used (and returned)z%y%m%d.%H%M)
r%�time�strftimer$ror_r`rar�r�)r2r��already_backupedrgs    r!�backup�SourcesList.backuposx��+.�%�������}�5�J��i�i�F��{�{�"2�2�r�w�w�~�~�f�k�k�7R�7R����F�K�K�F�K�K�=���)E�F� ��r'c
���[U5nURS5(aA[R"U5H&nURR[
X1US95 M( O/UH)n[XA5nURRU5 M+ SSS5 g!,(df   g=f![a'n[R"SUSUS35 SnAgSnAff=f)z(re)load the current sourcesrrjNzcould not open file 'z': rD)�openrr�Filer$r%rrr9�logging�warning)r2ro�fr9r�rg�excs       r!rb�SourcesList.loadzs���
	F��d��q��=�=��,�,�#*�<�<��?���	�	�(�(�):�7�t�)T�U�$3�!"��!,�T�!8���	�	�(�(��0�!"������	F��O�O�3�D�6��S�E��D�E�E��	F�s5�B.�BB�B.�
B+�'B.�+B.�.
C�8C�C�entryc��[U[5(a%URRUR5$URRU5$r.)rrrbr$rr])r2r�s  r!r�SourcesList.index�s:���e�6�7�7��9�9�?�?�5�<�<�0�0��y�y���u�%�%r'c���SnU(a�SnSnUS-[UR5:a�URUn[U[5(aqUS-nU[UR5:aSUR	URU5(aURU	SnOUS-
nU[UR5:aMSUS-
nUS-[UR5:aM�U(aM�gg)z=Merge consecutive entries that have been split back together.TrFrN)r$r$rrrr�)r2�mergedr+r��js     r!r��SourcesList.merge�s�������A��F��a�%�#�d�i�i�.�(��	�	�!����e�%6�7�7��A��A��c�$�)�)�n�,� �;�;�t�y�y��|�4�4� $�	�	�!��%)�F���F�A��c�$�)�)�n�,��Q����a�%�#�d�i�i�.�(��fr'c��0n[UR5S:XaH[RR	S5nSn[US5nUR
U5 SSS5 gUR5 URH�nURU;a#[URS5XR'O2[U[5(aXRR
S5 XRR
UR55 M� UR5HnUR5 M g!,(df   g=f!UR5HnUR5 M f=f)zsave the current sourcesrrz�## See sources.list(5) for more information, especialy
# Remember that you can only use http, ftp or file URIs
# CDROMs are managed through the apt-cdrom tool.
�wNrD)r$r$r�rrr��writer�rorrrrHrU�close)r2�filesr`r�r�rgs      r!�save�SourcesList.save�s��-/���t�y�y�>�Q���>�>�+�+�,B�C�D�E�
��d�C��A������!���
�
��		��)�)���;�;�e�+�)-�f�k�k�3�)?�E�+�+�&���(9�:�:��+�+�&�,�,�T�2��k�k�"�(�(�����6�$��\�\�^�����	�$�!�����\�\�^�����	�$�s�	E�5B#E�
E�)E:rc�:�/n0nUH�nURcMURR(a,URnXS;a/X5'X5nURU5 MY[URR5S:�dM~URU5 M� X#4$)z5get all parent and child channels in the sources listr)rtr�r%r$r)r2r�parents�used_child_templatesrgr+�temps       r!�check_for_relations�SourcesList.check_for_relations�s�����EG��"�F����&�����$�$��o�o���2�02�(�-�+�0�����F�#��v���/�/�0�1�4��N�N�6�*�#�$�.�.r'c� �/nURH�n[U[5(aURU5 M+[	UR
5S:XaE[	UR5S:Xa,[	UR5S:XaURU5 M�UR
HbnURHOnURH<nUR[X#XE55 URRUS5 M> MQ Md M� U$)a&Present an exploded view of the list where each entry corresponds exactly to a Release file.

A release file is uniquely identified by the triplet (type, uri, suite). Old style entries
always referred to a single release file, but deb822 entries allow multiple values for each
of those fields.
rrx)r$rrrr%r$r�r�r�rbrZrR)r2�resr�r�r��suis      r!ru�SourcesList.exploded_list�s���-/���Y�Y�E��%��-�-��
�
�5�!��E�K�K� �A�%���
�
�O�q�(�����%��*��
�
�5�!� �;�;�C�$�z�z��#(�<�<�C��J�J�'@��S�'V�W� �L�L�.�.�s�2�w�7�$0� *�'�� �
r')rVr$rZ)Tz /usr/share/python-apt/templates/rr.)!rDrErFrGr0r�rHr3r[rr�rkrrTrr�r$�intrr�rr�r�rbrr�r��tuple�dictrr�rurJrKr'r!rr�s���@�!�=��
������
�� +�(�(�>�2��

�#�%;�$<�d�$B�C�
�NQ�
�	�(�	)�
�$���')�04�i��i��i��	i�
��I�i��
i��i��D�j�i� ��}�i�'��-�i�
 �i�V'�#9�'�d�'�	5��	5��	5�	��t��	�s�	�F��F��F�&�1�&�c�&�
�$�8/�$�^�4�/�	�t�N�#�T�(�D��4H�*H�%I�I�	J�/�4�t�$:�;�r'rc�8�\rSrSrSrS\4SjrS\S\4Sjr	Sr
g	)
ri�zlmatcher class to make a source entry look nice
lots of predefined matchers to make it i18n/gettext friendly
rXc�L�/Ul[R"SU-5nUH~n[RR	U5nURS5nUSUn[
X1S9nURH-nURcMURRU5 M/ M� g)Nz	%s/*.infoz.infor)�base_dir)	�	templatesr�r_r`�basenamer7r
�	match_urir%)r2rX�
spec_filesr�r+r�rts       r!r3�SourceEntryMatcher.__init__�s���)+����Y�Y�{�[�8�9�
��A���� � ��#�A����w��A��!�A��A��A�4�D� �N�N���%�%�1��N�N�)�)�(�3�+��	r'rgrc��SnURGHgnURb
URcM URb�URb�URb�URb�[
R"URUR5(ae[
R"URUR5(a5URUR:XdURS:XaSnX1l	 U$URUR5(dGMURcGMURcGM,[
R"URUR5(dGM_SnX1l	 U$ U$)z%Add a matching template to the sourceFr1T)r�r�r�r��
match_name�re�searchrRrIrtr)r2rg�foundrts    r!rR�SourceEntryMatcher.matchs�������H��z�z�!�V�[�[�%8���"�"�.��'�'�3��J�J�*��K�K�+��I�I�h�0�0�&�*�*�=�=��H�H�X�0�0�&�+�+�>�>�����
�
�-����%�1G���"*������"�"�6�:�:�.�.��'�'�3��K�K�+��H�H�X�0�0�&�+�+�>�>���"*�����7'�6�r')r�N)rDrErFrGr0rHr3rTr�rRrJrKr'r!rr�s'����C���2��t�r'r�__main__zentry %sz!http://archive.ubuntu.com/ubuntu/z$http://de.archive.ubuntu.com/ubuntu/zis_mirror(): %sz http://archive.ubuntu.com/ubuntuz#http://de.archive.ubuntu.com/ubuntur)5rOr��ior��os.pathr_r�r�r�rv�collections.abcrrr�typingrrrr	r
r�rRr�distinfor
rr�__all__rHr�rr$r&r�r)rMr[rjrlrrbrr�rTrrrrD�init_configr�r��info�mirrorrKr'r!�<module>r�s���4��	���	�
���8�8�9�9���(��C�L�����#��C��D��:�H�Q�K��D��G��*�(�*�&
1��
1� 
/�H�g�a�j�
/� �Q��1���
z<�z<�zN �N �b~�~�B�{�$5�5�6����"�$=�=���
��s�s�l	1�1�j�z�������m�G������Z�%�)�)�+�-�.���+�-S��F��L�L�"�V�+�,��L�L��.�0V�	
��
�L�L��/�1V�	
��%r'

Youez - 2016 - github.com/yon3zu
LinuXploit