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੐)|#o0aڱ$I>}k&1`U#V?YsV x>{t1[I~D&(I$I/{H0fw"q"y%4 IXyE~M3 8XψL}qE$I[> nD?~sf ]o΁ cT6"?'_Ἣ $I>~.f|'!N?⟩0G KkXZE]ޡ;/&?k OۘH$IRۀwXӨ<7@PnS04aӶp.:@\IWQJ6sS%I$e5ڑv`3:x';wq_vpgHyXZ 3gЂ7{{EuԹn±}$I$8t;b|591nءQ"P6O5i }iR̈́%Q̄p!I䮢]O{H$IRϻ9s֧ a=`- aB\X0"+5"C1Hb?߮3x3&gşggl_hZ^,`5?ߎvĸ%̀M!OZC2#0x LJ0 Gw$I$I}<{Eb+y;iI,`ܚF:5ܛA8-O-|8K7s|#Z8a&><a&/VtbtLʌI$I$I$I$I$I$IRjDD%tEXtdate:create2022-05-31T04:40:26+00:00!Î%tEXtdate:modify2022-05-31T04:40:26+00:00|{2IENDB`Mini Shell

HOME


Mini Shell 1.0
DIR:/usr/lib/python3/dist-packages/softwareproperties/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/softwareproperties/__pycache__/SoftwareProperties.cpython-311.pyc
�

3LGf�}���ddlZddlZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
	ddlmZn#e
$r
ejZYnwxYwddlZ	ddlZn#e
$rddlZYnwxYwddl
mZddlmZ	ddlmZn#e
$r	ddlmZYnwxYwddlmZddlZddlZddlZdd	lmZdd
lmZmZddl m!Z!ddl"m#Z#dd
l$m%Z%Gd�de&��Z'e(dkr>e'��Z)e*e)�+����e)�,d��dSdS)�N)�md5)�	maketrans)�NamedTemporaryFile)�escape)�ConfigParser)�gettext�)�AptAuth)�SourcesList�SourceEntry)�InvalidShortcutException)�shortcut_handler)�Gioc��eZdZdZdZeed����\ZZZ	edede	diZ
dAd	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'd&�Z(d'�Z)d(�Z*d)�Z+d*�Z,d+�Z-d,�Z.d-�Z/d.�Z0d/�Z1d0�Z2d1�Z3d2�Z4d3�Z5d4�Z6d5�Z7dBd7�Z8dBd8�Z9dCd:�Z:d;�Z;d<�Z<d=�Z=d>�Z>d?�Z?e@dDd@���ZAdS)E�SoftwarePropertiesz /usr/share/app-install/channels/z$/etc/update-manager/release-upgrades��normal�lts�neverN�/c�j�|dz|_||_|dkr tj�d|��|dkrd}||_||_t��|_tj
���|_
g|_d|_
|���|���|���g|_t%j��|_t+|���|_t/j��|_t5j|j��dS)z� Provides the core functionality to configure the used software
        repositories, the corresponding authentication keys and
        update automation z/etc/popularity-contest.confr�DirNz/usr/share/software-properties/F)�rootdir)�
popconfiler�apt_pkg�config�set�options�datadirr�sourceslist�
aptsources�distro�
get_distro�seen_server�modified_sourceslist�reload_sourceslist�backup_sourceslist�backup_apt_conf�custom_mirrors�queue�Queue�myqueuer
�apt_keyr�Cancellable�cancellable�atexit�register�wait_for_threads)�selfrrrs    �G/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py�__init__zSoftwareProperties.__init__Vs���<�<�D�O��D�L��#�~�~�
�n�����(�(�(��$���1�g��D�L��D�L�"�}�}�D���#�.�.�0�0�D�K��D�� %�D���������������������D���;�=�=�D�L��7�+�+�+�D�L���(�(�D��
�O�D�)�*�*�*�*�*�c��tj��D]7}|jtj��jkr|����8dS)z9 wait for all running threads (PPA key fetchers) to exit N)�	threading�	enumerate�ident�current_thread�join)r3�ts  r4r2z#SoftwareProperties.wait_for_threadssK��
�
 �
"�
"����	
��I�,�.�.�4�	4�	4�	��������r6c���i|_tj���D];}tj�tj|��}||j|<�<dS)z$Backup all apt configuration optionsN)�apt_conf_backup�softwareproperties�CONF_MAP�keysrr�find_i)r3�option�values   r4r(z"SoftwareProperties.backup_apt_conf�s`���D��$�-�2�2�4�4�-�-����%�%�&8�&A�&�&I�J�J��',���V�$�$�-�-r6c��|j���D]J}tj�t
j|t|j|�����K|���dS)z$Restore the stored apt configurationN)	r?rBrrrr@rA�str�write_config)r3rDs  r4�restore_apt_confz#SoftwareProperties.restore_apt_conf�su���&�+�+�-�-�>�>������-�6�v�>��t�3�F�;�<�<�	>�	>�	>�	>��������r6c���tj�tjd��dk�rDtj�tjd��dkr+t
j�d��rtjStj�tjd��dkr?tj�tjd��dkrtj	Stj�tjd��dkr?tj�tjd��dkrtj
SdStj�tjd��dkr?tj�tjd��dkrtjSdS)z� Parse the apt cron configuration. Try to fit a predefined use case
        and return it. Special case: if the user made a custom
        configurtation, that we cannot represent it will return None �
autoupdater�
unattendedr	�/usr/bin/unattended-upgrade�autodownloadN)rrrCr@rA�os�path�exists�UPDATE_INST_SEC�UPDATE_DOWNLOAD�
UPDATE_NOTIFY�
UPDATE_MANUAL�r3s r4�get_update_automation_levelz.SoftwareProperties.get_update_automation_level�sn���~���/�8��F�G�G�!�K�K��>� � �!3�!<�\�!J�K�K�q�P�P��w�~�~�;�<�<�Q�%�5�5�
�^�
"�
"�#5�#>�~�#N�
O�
O�ST�
T�
T�
�^�
"�
"�#5�#>�|�#L�
M�
M�QR�
R�
R�%�5�5�
�^�
"�
"�#5�#>�|�#L�
M�
M�QR�
R�
R�
�^�
"�
"�#5�#>�~�#N�
O�
O�ST�
T�
T�%�3�3��4�	��	�	�1�:�<�H�	I�	I�Q�	N�	N�	��	�	�1�:�>�J�	K�	K�q�	P�	P�!�/�/��tr6c���|tjkr|tj�tjdt
d����tj�tjdt
d�����n�|tjkr|tj�tjdt
d����tj�tjdt
d�����nB|tjkr{tj�tjdt
d����tj�tjdt
d����n�tj�tjdt
d����tj�tjdt
d����tj�tjdt
d����|�	��dS)z� Set the apt periodic configurtation to the selected
        update automation level. To synchronize the cache update and the
        actual upgrading function, the upgrade function, e.g. unattended,
        will run every day, if enabled. rLr	rNrrKN)
r@rRrrrrArGrSrT�set_modified_config)r3�states  r4�set_update_automation_levelz.SoftwareProperties.set_update_automation_level�s���

�"�2�2�2�����-�6�|�D�c�!�f�f�M�M�M�����-�6�~�F��A���O�O�O�O�	�$�4�	4�	4�����-�6�~�F��A���O�O�O�����-�6�|�D�c�!�f�f�M�M�M�M�	�$�2�	2�	2�����-�6�~�F��A���O�O�O�����-�6�|�D�c�!�f�f�M�M�M�M�����-�6�|�D�c�!�f�f�M�M�M�����-�6�|�D�c�!�f�f�M�M�M�����-�6�~�F��A���O�O�O��������r6c��|tj�tjd��ksStj�tjdt
|����|���dSdS)z8Set the interval in which we check for available updatesrKN)rrrCr@rArrGrY)r3�dayss  r4�set_update_intervalz&SoftwareProperties.set_update_interval�sp���W�^�*�*�+=�+F�|�+T�U�U�
U�
U�
�.�
�
�/�8��F��D�	�	�
R�
R�
R�
�
"�
"�
$�
$�
$�
$�
$�V�
Ur6c�`�tj�tjd��S)z3 Returns the interval of the apt periodic cron job rK)rrrCr@rArVs r4�get_update_intervalz&SoftwareProperties.get_update_interval�s!���>� � �!3�!<�\�!J�K�K�Kr6c��tj�|j��s|jSt��}|�|j��|�dd��rQ|�dd���	��}|j
���D]\}}||kr|cS�|jS)z�
    return the release upgrade policy:
     RELEASE_UPGRADES_NORMAL,
     RELEASE_UPGRADES_LTS,
     RELEASE_UPGRADES_NEVER
    �DEFAULT�Prompt)rOrPrQ�RELEASE_UPGRADES_CONF�RELEASE_UPGRADES_NORMALr�read�
has_option�get�lower�release_upgrades_policy_map�items)r3�parser�type�k�vs     r4�get_release_upgrades_policyz.SoftwareProperties.get_release_upgrades_policy�s����7�>�>�$�4�5�5�*�
�
)�)�
�^�^�F�
�K�K��*�+�+�+�
����8�,�,��
�Z�Z�	�(�
+�
+�
1�
1�
3�
3�d��2�8�8�:�:���$�!�Q���9�9��(�(�(���'�'r6c�8�tj�|j��sRt	|jd��5}|�d|j|z��ddd��n#1swxYwYdSt	|jd��5}td���5}|D]y}|���}|�	���
d��r$|�d	|j|z���a|�|d
z���z|���tj
|j|j��tj|j|j��ddd��n#1swxYwYddd��n#1swxYwYdS)z
    set the release upgrade policy:
     RELEASE_UPGRADES_NORMAL,
     RELEASE_UPGRADES_LTS,
     RELEASE_UPGRADES_NEVER
     �wz[DEFAULT]
Prompt=%s
NT�rzw+)�mode�promptz
Prompt=%s
�
)rOrPrQrd�open�writerjr�stripri�
startswith�flush�shutil�copymode�name�copy)r3�i�f�out�lines     r4�set_release_upgrades_policyz.SoftwareProperties.set_release_upgrades_policy�s7���7�>�>�$�4�5�5����*�3�/�/�O�1�	���(�$�*J�1�*M�M�N�N�N�O�O�O�O�O�O�O�O�O�O�O����O�O�O�O�
�T�	
�d�(��	-�	-�	8��4F�D�4Q�4Q�4Q�	8�UX����$��z�z�|�|���:�:�<�<�"�"�8�,�,�	�

�)�)�M�D�$D�Q�$G�G�
H�
H�
H�
H�

�)�)�D��I�
�
�
�
�	�i�i�k�k�k��o�d�0�#�(�;�;�;��k�#�(�D�6�7�7�7�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8�	8����	8�	8�	8�	8��4sH�$A*�*A.�1A.�F�CE8�,F�8E<	�<F�?E<	�F�F�Fc��tj�|j��r�t	|j��5}|����d��}ddd��n#1swxYwY|D]_}	|�d��\}}|dkr.|�d�����dkrdS�P#t$rY�\wxYwdS)	z� Will return True if the user wants to participate in the popularity
        contest. Otherwise it will return False. Special case: if no
        popcon is installed it will return False rvN�=�PARTICIPATE�"�yesTF)
rOrPrQrrwrf�splitryri�
ValueError)r3r��linesr��keyrEs      r4�get_popcon_participationz+SoftwareProperties.get_popcon_participation�s��
�w�~�~�d�o�&�&�	�
�$�/�
"�
"�	'�a��&�&�(�(�.�.��&�&�%�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'��	�	�D�
�"�j�j��o�o���U��-�'�'�E�K�K��,<�,<�,B�,B�,D�,D��,M�,M��4�4����
�
�
���
�����5s$�(A-�-A1�4A1�=A	C
�

C�Cc����|dkrd�nd�tj�|j��r<t	|jd��5}�fd�|D��}ddd��n#1swxYwYn�t��}t	dd��5}|�|�d	����ddd��n#1swxYwY|���}g}|�	d
|z��|�	dt���z��|�	d��t	|jd
��5}|�|��ddd��dS#1swxYwYdS)z? Enable or disable the participation in the popularity contest Tr��norsc�B��g|]}tjdd�z|����S)z^(PARTICIPATE=)(".+?")z\1"%s")�re�sub)�.0r�rEs  �r4�
<listcomp>z@SoftwareProperties.set_popcon_pariticipation.<locals>.<listcomp>s=���-�-�-���V�5�y�5�7H�$�O�O�-�-�-r6Nz/dev/urandom�rbizMY_HOSTID="%s"
zPARTICIPATE="%s"
zUSE_HTTP="yes"
rr)rOrPrQrrwr�updaterf�	hexdigest�appendrG�
writelines)r3�
is_helpfulrr��mr��idrEs       @r4�set_popcon_pariticipationz,SoftwareProperties.set_popcon_pariticipations*����T��������	�w�~�~�d�o�&�&�+��$�/�3�
'�
'�	-�:�-�-�-�-�!+�-�-�-�E�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-�	-����	-�	-�	-�	-��

�E�E��
�.�$�
'�
'�	#�1�
�H�H�Q�V�V�D�\�\�"�"�"�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#�	#����	#�	#�	#�	#�
�[�[�]�]����
���)�B�.�/�/�/�
���+�c�%�j�j�8�9�9�9�
���)�*�*�*�	
�d�o�s�	#�	#��q�	���U������������������������s6�A!�!A%�(A%�)C�C�C�E+�+E/�2E/c�@�tj�d��S)NrM)rOrP�isfilerVs r4�have_unattended_upgradesz+SoftwareProperties.have_unattended_upgradess��
�W�^�^�9�
:�
:�:r6c�R�t|jj��dkrd|j_dSd|j_i}g}|�|jj��|�|jj��|D]R}|j|vr+|jD]"}||j�	|���#�6t|j��||j<�St|jj��dkr|jj||jj
<|jjD]�}|j|vs{|j|vr�tt||j��t|j��z��dksAtt|j��|jjz��dksd|j_dS��dS)z�Return True if all distro componets are also available as
       source code. Otherwise return Flase. Special case: If the
       configuration cannot be represented return Noner	FTrN)�lenr"�source_code_sources�get_source_code�extend�main_sources�
child_sources�template�comps�addr�
cdrom_sources�cdrom_comps�source_template�
enabled_comps)r3�	templates�sources�source�comps     r4�get_source_code_statez(SoftwareProperties.get_source_code_state s���
�4�;�*�+�+�a�/�/�',���#��u�'+���#��	������t�{�/�0�0�0����t�{�0�1�1�1��	?�	?�F���)�+�+�"�L�9�9�D��f�o�.�2�2�4�8�8�8�8�9�.1���->�->�	�&�/�*�*��t�{�(�)�)�A�-�-�59�[�5L�I�d�k�1�2��k�5�	�	�F���i�/�/���9�,�,��S��6�?�3�4�4�s�6�<�7H�7H�H�I�I�Q�N�N���V�\�*�*�T�[�-F�F�G�G�1�L�L�.3���+��t�t���4r6c��d|jfd|jfd|jfd|jffD]\}}t	d|�d|�����|jr7d|jjfd|jjffD]\}}t	d|�d|�����t	d��d	S)
z4Print the data of a source entry to the command linezURI:zComps:zEnabled:zValid:� z	MatchURI:zBaseURI:rvN)�urir��disabled�invalid�printr��	match_uri�base_uri)r3r��labelrEs    r4�print_source_entryz%SoftwareProperties.print_source_entryGs���"�F�J�/�$�f�l�3�&�F�O�(;�<�$�&�.�&8�9�;�)�)����	��%�%�%���'�(�(�(�(�
��-� +�V�_�-F�G� *�F�O�,D�E�G�	-�	-�N�U�E��E�e�e�e�U�U�+�,�,�,�,�	�$�K�K�K�K�Kr6c��td��|jD]#}t|������$td��dS)zPrint the complete sources.listzSTART SOURCES.LIST:zEND SOURCES.LIST
N)r�r rG�r3r�s  r4�massive_debug_outputz'SoftwareProperties.massive_debug_outputTsQ��	�
� � � ��"����
�f�j�j�l�l�����	�
�����r6c�z�||j_|j�|��}|���|S)z! change the main download server )r"�default_server�
change_server�set_modified_sourceslist)r3�server�ress   r4�change_main_download_serverz.SoftwareProperties.change_main_download_server[s8��!'�D�K��
�+�
#�
#�F�
+�
+�C��!�!�#�#�#��Jr6c�b�|j�|��|���dS)z Enable a component of the distroN)r"�enable_componentr��r3r�s  r4r�z#SoftwareProperties.enable_componentbs0���K� � ��&�&�&��!�!�#�#�#�#�#r6c�b�|j�|��|���dS)z!Disable a component of the distroN)r"�disable_componentr�r�s  r4r�z$SoftwareProperties.disable_componentgs0���K�!�!�$�'�'�'��!�!�#�#�#�#�#r6c�L�|jjjD]}|j|kr|cS�dS�N)r"r��childrenr~)r3r~r�s   r4�_find_template_from_stringz-SoftwareProperties._find_template_from_stringls>���K�/�8����	��$�	�	�����
��r6c�R�t|t��r|�|��}|jjD]'}|j|kr|j�|���(|jjD]'}|j|kr|j�|���(|�	��dS)�7Enable a child repo of the distribution main repositoryN)
�
isinstancerGr�r"r�r�r �remover�r�)r3r�r�s   r4�disable_child_sourcez'SoftwareProperties.disable_child_sourceqs����(�C� � �;��0�0��:�:�h��+�+�,�,���?�h�&�&���#�#�F�+�+�+���+�1�,�,���?�h�&�&���#�#�F�+�+�+���!�!�#�#�#�#�#r6c��t|t��r|�|��}|jdkr
|jj}n|j}|j�||j���|���dS)r�N)r��dist)	r�rGr�r�r"r��
add_sourcer~r�)r3r��	child_uris   r4�enable_child_sourcez&SoftwareProperties.enable_child_source~s����(�C� � �;��0�0��:�:�h���D� � ��K�.�	�	��%�	��K���y�x�}��=�=�=��!�!�#�#�#�#�#r6c��g}|�|jj��|�|jj��|jjD]}|j�|���|���dS)z%Remove all distro source code sourcesN)r�r"r�r�r�r r�r��r3r�r�s   r4�disable_source_code_sourcesz.SoftwareProperties.disable_source_code_sources�s{���G��N�N�4�;�+�,�,�,��N�N�4�;�,�-�-�-��+�1�(�(�������'�'�'�'��!�!�#�#�#�#�#r6c��g}|�|jj��|�|jj��|jjD]}|j�|���|D]V}|j�d|j|j	|j
d|jj�|��dz|j
���W|jjD]j}|j�d|jjj|jjj|j
d|jj�|��dz|j
���k|���dS)z0Enable source code source for all distro sources�deb-srczAdded by software-propertiesr	N)r�r"r�r�r�r r�r�r�r�r��list�index�filer�r�r�r~r�r�s   r4�enable_source_code_sourcesz-SoftwareProperties.enable_source_code_sources�sZ���G��N�N�4�;�+�,�,�,��N�N�4�;�,�-�-�-��+�1�(�(�������'�'�'�'��*�*������Y�#�Z�#�[�#�\�;�!�-�2�8�8��@�@��B�#�[�
	*�	*�	*�	*��+�+�*�*������Y�!�[�8�A�!�[�8�=�#�\�;�!�-�2�8�8��@�@��B�#�[�
	*�	*�	*�	*�	�!�!�#�#�#�#�#r6c��g|_|jjD]7}t|j|j���}|j�|���8dS)z+Store a backup of the source.list in memory�r�r�N)�sourceslist_backupr r�rr�r�r�)r3r��
source_bkps   r4r'z%SoftwareProperties.backup_sourceslist�sY�� �D���"�'�3�3�� �f�k�v�{�C�C�C�
���&�&�z�2�2�2�2�3�3r6c�z�|���|jjD]}t|��|kr|cS�dSr�)r&r r�rG)r3r�r�s   r4�_find_source_from_stringz+SoftwareProperties._find_source_from_string�sO��	�������"�'����	�V����	�	��
�
�
�
��4r6c��t|t��r|�|��}|j|_|���dS)z&Enable or disable the selected channelN)r�rGr�r�r�r�s  r4�toggle_source_usez$SoftwareProperties.toggle_source_use�sM���&�#���5��,�,�V�4�4�f� �/�)�F�O��!�!�#�#�#�#�#r6c��t|jj��D]c\}}t|��|krK|jj|j}t||��|jj|<|���dS�ddS)NTF)r9r r�rGr�rr�)r3�	old_entry�	new_entryr��entryr�s      r4�replace_source_entryz'SoftwareProperties.replace_source_entry�s���#�D�$4�$9�:�:������	�U���y�	 �	 ���$�U�+�0��'2�9�d�'C�'C����e�$��%�%�'�'�'��t�t�	
!�
�5r6c�V�|���|���dS)zMRevert all settings to the state when software-properties
       was launchedN)rI�revert_sourceslistrVs r4�revertzSoftwareProperties.revert�s.��	�������������r6c��g|j_|jD]<}t|j|j���}|jj�|���=|���|���dS)z6Restore the source list from the startup of the dialogr�N)	r r�r�rr�r�r��save_sourceslistr&)r3r��source_resets   r4r�z%SoftwareProperties.revert_sourceslist�s|���D����)�3�3��"�����E�E�E�����$�$�\�2�2�2�2��������������r6c��d|_|jr |jjr|���|���|���dS)zCThe sources list was changed and now needs to be saved and reloadedTN)r%r�
massive_debugr�r�r&rVs r4r�z+SoftwareProperties.set_modified_sourceslist�s\�� $�D���|�$���2�$��!�!�#�#�#��������������r6c�.�|���dS)z+Write the changed apt configuration to fileN)rHrVs r4rYz&SoftwareProperties.set_modified_config�s���������r6c��|jdkr�|jr�dt|j������d|j��}t|j��dkr|jD]
}|d|zz
}�|jdvr|dtd��zz
}|d|j	zz
}nCd|j	�d	|j�d
�}|jD]
}|d|zz
}�|jdvr|dtd��zz
}|Sd|jj
z}|jdvr|dtd
��zz
}|jr
|d|jzz
}|jjdkrT|jD]L}|j�|��r(|jj
D]}|j|kr
|d|j
zz
}��D|d|zz
}�M|S)z5Render a nice output to show the source in a treeviewNz<b>z</b> r	z %s)r�zrpm-srcz
(Source Code)z
%sr�z</b>z	<b>%s</b>z (%s)zSource CodeF)r��commentrryr�r�r�rm�_r��description�child�
has_component�
componentsr~)r3r��contents�cr�s     r4�
render_sourcez SoftwareProperties.render_source�s���
��$����>�	7�	7�)/���)?�)?�)E�)E�)G�)G�)G�)G�)/���6�H��6�<� � �1�$�$���*�*�A����	�)�H�H��{�4�4�4��E�A�o�$6�$6�6�6������+�+�H�H�	7�*0����V�[�[�[�A�H��\�
&�
&���E�A�I�%����{�4�4�4��E�A�o�$6�$6�6�6�������!<�<���;�0�0�0���!�M�"2�"2�2�2�H��>�	.��u�v�~�-�-�H��?� �E�)�)���
.�
.���?�0�0��6�6�.�$�_�7�?�?���6�T�>�>�$����(>�>�H��?����
�-�H�H��r6c�<�d}d}d}d}tdd��}|jr&d}|jj}|jj|jkrd}n"|j�d|j�d|j��}|jrd}|j	�
d��rd}|||||�|��fS)z&extract attributes to sort the sourcesr	�
0123456789�
9876543210rr��src)rr�r��distributionr"r�r�r�r�rm�find�	translate)r3r��cur_sys�has_template�has_comment�	is_source�revert_numbers�descs        r4�get_comparablez!SoftwareProperties.get_comparables����g��l��k��i� ��|�<�<�n�	�������*���?�'�4�;�6�6��G��%�z�z�z�6�;�;�;����E�$�
�^���k�	��	�	�%�	 �	 ���)��|�[�)��n�n�^�,�,�.�.r6c���g}|jjD]d}|js[||jjvrM||jjvr?||jjvr1||jjvr#||jjvr|�	|���e|S)z>Return a list of sources that are not part of the distribution)
r r�r�r"r�r�r��disabled_sourcesr�r�)r3�isv_sourcesr�s   r4�get_isv_sourcesz"SoftwareProperties.get_isv_sources-s����K��"�'�'�'���~�	'��$�+�2�2�2��$�+�3�3�3��$�+�3�3�3��$�+�6�6�6����8�8�8����v�&�&�&���r6c��|jjS)z-Return the list of CDROM based distro sources)r"r�rVs r4�get_cdrom_sourcesz$SoftwareProperties.get_cdrom_sources:s
���;�$�$r6c�,�|j|jjvdfS)z�Return a tuple: the first value describes if a component is enabled
       in the Internet repositories. The second value describes if the
       first value is inconsistent.F)r~r"�download_compsr�s  r4�get_comp_download_statez*SoftwareProperties.get_comp_download_state>s��

�I���3�3�U�;�;r6c�z�g}|jjD]'}|j|kr|�|j���(t|��dkr/t|jjt|��z��dkrdSt|��dkr/t|jjt|��z��dkrdSdS)z�Return a tuple: the first value describes if a component is enabled
       in one of the child source that matcth the given template.
       The second value describes if the first value is inconsistent.r)TF)FT)FF)r"r�r�r�r�r�r�r)r3r�r�r�s    r4�get_comp_child_statez'SoftwareProperties.get_comp_child_stateEs���
�E���*�&�&���>�X�%�%��L�L���%�%�%��
�5�z�z�A�~�~��D�K�%��E�
�
�2�3�3�q�8�8��}�	�U���a����D�K�%��E�
�
�2�3�3�q�8�8��m��~r6c��|j���g|_|j�|j��dSr�)r �refresh�sourceslist_visibler"�get_sourcesrVs r4r&z%SoftwareProperties.reload_sourceslistZs>����������D���K���D�,�-�-�-�-�-r6c��|jdz|jdz|jdzg}|D]#}tj�|��rnS�$t	d��t|dd��5}|�d��ddd��n#1swxYwYd	}tj�|��rZtj|��tj	}|tj
zs't	d
|z��tj|d��|D�]>}g}tj�|���rt|d��5}|���}ddd��n#1swxYwYtj�d
��}t|d��5}|D]L}|���D] }	|�d|	z��dkrn�!|�|���M|���D]1}
|�d|
�d|�|
���d����2	ddd��n#1swxYwY��@dS)z+Write the current apt configuration to filez/etc/apt/apt.conf.d/10periodicz#/etc/apt/apt.conf.d/20auto-upgradesz+/etc/apt/apt.conf.d/15adept-periodic-updatezNo config found, creating onerrr�Nz/etc/cron.daily/aptz file '%s' not executable, fixingi�rsz
APT::PeriodiczAPT::Periodic::%szAPT::Periodic::z "z";
)rrOrPr�r�rwrxrQ�stat�ST_MODE�S_IXUSR�chmod�	readlinesrr�subtreer�r
rC)r3�	conffilesr��ac�perm�periodic�content�cnfr�r�r�s           r4rHzSoftwareProperties.write_config_s,����>�>���C�C���K�K�M�I�
����	�����	�	��
����+�,�,�,��	�!��c�"�"��a�	�������������������������
�B�	�w�~�~�b����
�W�R�[�[���
&�d��T�\�!��
�0�2�5�6�6�6�
���U�����H�H���g�	�����	!�	!�H�
�(�C�
 �
 �	"�A��K�K�M�M�'�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"�	"����	"�	"�	"�	"��n�$�$�_�5�5���(�C�
 �
 �
	H�A����d��x�x�z�z�
�
�����.�#�6�7�7�1�<�<���=��g�g�d�m�m�m���8�8�:�:�H�H�a�
�G�G�G�Q�Q�Q��
�
�1�
�
�
�
�F�G�G�G�G�H�
	H�
	H�
	H�
	H�
	H�
	H�
	H�
	H�
	H�
	H�
	H����
	H�
	H�
	H�
	H��H�Hs7�)B�B�B�E)�)E-	�0E-	�#BI�I
	�
I
	c�l�|j�d��|j���dS)zQBackup the existing sources.list files and write the current
       configurationz.saveN)r �backup�saverVs r4r�z#SoftwareProperties.save_sourceslist�s6��	����G�$�$�$���������r6c��t|��}tj�|j��r�tjd|jz��D]�}t
|��5}|D]�}|����d��r�*|t|��krRtj�	tj�
|����dccddd��cS��	ddd��n#1swxYwY��dS)zs
    helper that checks if a given line is in the source list
    return the channel name or None if not found
    z	%s/*.list�#rN)rrOrPrQ�CHANNEL_PATH�globrwryrz�splitext�basename)r3�srcline�srcentry�filenamer�r�s      r4�_get_channel_from_linez)SoftwareProperties._get_channel_from_line�s~��
�7�#�#�H�	�w�~�~�d�'�(�(�E��i��d�.?� ?�@�@�E�E�(�
�(�^�^�	E�q��E�E�d��z�z�|�|�&�&�s�+�+�
���;�t�,�,�,�,��W�%�%�b�g�&6�&6�x�&@�&@�A�A�!�D�D�D�	E�	E�	E�	E�	E�	E�	E�	E�	E�	E�-�E�	E�	E�	E�	E�	E�	E�	E�	E�	E�	E�	E����	E�	E�	E�	E���4s�!BD�3D�D	�D	c��|���j}|�|��}|r$|j�d|�d�}|�|��dSdS)z�
    helper that adds the gpg key of the channel to the apt
    keyring *if* the channel is in /usr/share/app-install/channels
    rz.keyTF)rr�r<r5�add_key)r3�shortcutr9�channel�keyps     r4�&check_and_add_key_for_channel_shortcutz9SoftwareProperties.check_and_add_key_for_channel_shortcut�sf��
�"�"�$�$�)�G��)�)�'�2�2�G��� �-�-�-�w�w�w�
7�d�
�l�l�4����
�T��5r6c��dS)z) abstract interface to keep the UI alive N�rVs r4�update_interfacez#SoftwareProperties.update_interface�s���r6c���|�d��s|S|���d}	|�dd��d}n#t$rd}YnwxYwd|�d|jj�d|��}|S)z�
    short cut - this:
      apt-add-repository http://packages.medibuntu.org free non-free
    same as
      apt-add-repository 'deb http://packages.medibuntu.org/ '$(lsb_release -cs)' free non-free'
    �httprr�r	�mainzdeb )rzr��
IndexErrorr"�codename)r3r��repo�areass    r4�expand_http_linez#SoftwareProperties.expand_http_line�s����?�?�6�"�"��
�k��:�:�<�<��?�D���
�
�3�q�!�!�!�$�����������������"�d�d�D�K�$8�$8�$8�%�%�A�D��Ks�A�A�AFc��	t|�����}n#t$rYdSwxYw|�||��S)z*
    Add a source for the given line.
    F)rryr
�add_source_from_shortcut)r3r��enable_source_coder?s    r4�add_source_from_linez'SoftwareProperties.add_source_from_line�sY���#�D�J�J�L�L�1�1����#����
�U�U������(�(��3E�F�F�Fs�!$�
2�2c	��|���j}|j}|�|��}|rdnd}||dd�z}t||��}t||��}|js|jrdS|�|��s|���|j�|j	|j
|j|j|j
|j|j���|j�||j
|j|j|j
|j|j���|���|jr?|jjr3ddl}	|	���}
|
�|j���d	S)
z�
    Add a source with the given shortcut and add the signing key if the
    site is a known channel or the shortcut implementer adds it.
    r�z	# deb-srcrNF)r�r��
architecturesr)�sources_listT)rr��sourceparts_filerMr�rBr>r r�rmr�r�r�r�r�rSr�rr��apt�Cache)r3r?rP�deb_liner��debsrc_entry_type�debsrc_line�
new_deb_entry�new_debsrc_entryrV�caches           r4rOz+SoftwareProperties.add_source_from_shortcut�s����#�#�%�%�*�H��$�D��$�$�X�.�.�H�%7�H�	�	�[��#�h�q�r�r�l�2�K���$�/�/�M�"�;��5�5����� 0� 8��
�U��6�6�x�@�@�������������+�&�*�&�+�&�,�!.�!6�+�0�'4�'B�
�D�D�D�	����*�)�-�)�.�)�/�!1�!9�.�3�'7�'E�
�G�G�G�	�!�!�#�#�#��|�9���+�9��
�
�
��	�	����
���"2�"7��8�8�8��4r6Tc��|r�t|t��r,|�|��}|�|d��nm|�k|�|d��t	j|��}d|_d|_|�|d��d|_|�|d��dSt|t��r|�|��}|�dS|jtj	�
d��kr3|jj�
td|j�����	|j�|��n#t $rYnwxYw|���dS)zRemove the given sourceTNFr�zDir::Etc::sourcelistr#)r�)r�rGr��
remove_sourcerrmr�r�rr�	find_filer r�r�rr�r�r�)r3r��remove_source_codes   r4r_z SoftwareProperties.remove_source�s����
�	�F�C�	 �	 �
*��.�.�v�6�6�����6�4�(�(�(�(������6�5�)�)�)���6�"�"�����������6�5�)�)�)�������6�5�)�)�)��f��&�#���5��,�,�V�4�4�f�
�~��f�
�{�g�n�.�.�/E�F�F�F�F�
���"�"�;�r���#D�#D�#D�E�E�E��
����f�%�%�%�%������
�d�����	�!�!�#�#�#�#�#s�=E�
E%�$E%c��tj�|��sdS	|j�|��}|S#YdSxYw)z7Add a gnupg key to the list of trusted software vendorsF)rOrPrQr-r�)r3rPr�s   r4r>zSoftwareProperties.add_keysL��
�7�>�>�$�����u���l���t�$�$���
����u�u���s	�?�Ac���tj��}|�|�d����|���|�|j��S)z<Add a gnupg key from a utf-8 data string (e.g. copy-n-paste)zutf-8)�tempfilerrx�encoder{r>r~)r3�keydata�tmps   r4�add_key_from_dataz$SoftwareProperties.add_key_from_data'sO��
�
%�
'�
'�C��I�I�g�n�n�W�%�%�&�&�&��I�I�K�K�K��<�<���!�!�!r6c�L�	|j�|��dS#YdSxYw)z<Remove a gnupg key from the list of trusted software vendorsTF)r-�rm)r3�keyids  r4�
remove_keyzSoftwareProperties.remove_key.s0������������t����u�u���s��#c�J�	|j���dS#YdSxYw)z Run apt-key update TF)r-r�rVs r4�update_keyszSoftwareProperties.update_keys6s0���
�l������
�T���
�U�U���s��"c��t|tj��sJ�|j}|r|j}|j}n7tj|��}|�|��}|j}|j}|j�d|�d|�d�S)z" Return the PackageKit package id �;)	r�r�Package�current_ver�ver_str�arch�DepCache�get_candidate_verr~)r3�	apt_cache�pkg�cur_ver�verrt�depcache�	candidates        r4�get_package_idz!SoftwareProperties.get_package_id>s����c�7�?�+�+�+�+�+��o�G����o���|����#�I�.�.���.�.�s�3�3�	�����~���(�(�(�C�C�C����.�.r6c�F�tj|��}|�|��}g}	|j�d��D]?}|D]:\}}}	|�|��dkr|�||���;�@n#ttf$rgcYSwxYw|S)zF Get the package dependencies, which can be filtered out by a pattern �Depends���)	rrurv�depends_list_strrhr
r��KeyError�	TypeError)
rw�package�patternr{r|�dependencies�dep_list�dep_name�dep_ver�dep_ops
          r4�get_dependenciesz#SoftwareProperties.get_dependenciesLs�����	�*�*�H��*�*�7�3�3�I��L��!�2�6�6�y�A�A�	=�	=�H�-5�
=�
=�)��'�6��=�=��)�)�R�/�/� �'�'�	�(�(;�<�<�<��
=�	=��
�i� �����	�	�	������s�AB�B�B)NNr)F)Tr�)B�__name__�
__module__�__qualname__r5rdr��rangere�RELEASE_UPGRADES_LTS�RELEASE_UPGRADES_NEVERrjr5r2r(rIrWr[r^r`rpr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r'r�r�r�r�r�r�rYrrrrrrr&rHr�r<rBrErMrQrOr_r>rhrlrnr}�staticmethodr�rDr6r4rrCs�������2�,�A���d�5�5��8�8�n�n�	�����h��e��g�!��'+�'+�'+�'+�R���-�-�-�������.���(%�%�%�L�L�L�(�(�(�&���0��� ���2;�;�;�%�%�%�N��� � � ����$�$�$�
$�$�$�
���
$�$�$�$�$�$�$�$�$�$�$�$�83�3�3����$�$�$����������������%�%�%�N.�.�.�*���%�%�%�<�<�<����*.�.�.�
,H�,H�,H�\������ ���0�0�0����"	G�	G�	G�	G�$�$�$�$�L&$�&$�&$�&$�P���"�"�"�������/�/�/������<���r6r�__main__)-rr�hashlibrr�rOr6r|r8r0rd�stringr�ImportErrorrGr$r*r+r�xml.sax.saxutilsr�configparserrrr�r!�aptsources.distror@r
�aptsources.sourceslistrr�"softwareproperties.shortcuthandlerr
�softwareproperties.shortcutsr�
gi.repositoryr�objectrr��spr�rpr�rDr6r4�<module>r�s���4��������������	�	�	�	�	�	�	�	�����
�
�
�
�����
�
�
�
�������������������m�)�)�)�����������,�,�,�,����������������(�'�'�'�'�'�#�#�#�#�#�#�(�'�'�'�'�'�'�'���(�(�(�'�'�'�'�'�'�'�'�(���� � � � � � �������������������=�=�=�=�=�=�=�=�G�G�G�G�G�G�9�9�9�9�9�9�������X�X�X�X�X��X�X�X�v�z�������"��%��&�&�(�(�)�)�)�� � ��#�#�#�#�#��s3�3�A�A�
A�	A�A�+A2�2B�?B