%PDF- %PDF-
Mini Shell

Mini Shell

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

�

QKf�C���ddlZddlZddlZddlZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZmZddlmZmZddlmZmZmZmZmZGd�d	e�ZGd
�de�ZGd�d
e�Z e!dk(r
e dd�Z"yy)�N)�
BadStatusLine)�quote)�Request�urlopen)�	HTTPError�URLError�)�get_lang�get_dist�get_dist_version�get_ubuntu_flavor�get_ubuntu_flavor_namec��eZdZy)�MetaReleaseParseErrorN)�__name__�
__module__�__qualname__���9/usr/lib/python3/dist-packages/DistUpgrade/MetaRelease.pyrr2s��rrc��eZdZd�Zy)�Distc��||_||_||_||_d|_d|_d|_d|_d|_y�N)	�name�version�date�	supported�releaseNotesURI�releaseNotesHtmlUri�upgradeTool�upgradeToolSig�upgrade_broken)�selfrrrrs     r�__init__z
Dist.__init__7sF����	������	�"���#���#'�� ����"���"��rN)rrrr%rrrrr6s��
#rrc��eZdZdZdej
vZdZdZ						dd�Z	d�Z
d�Zd	�Zd
�Z
d�Zed��Zd
�Zd�Zy)�MetaReleaseCorezT
    A MetaReleaseCore object abstracts the list of released
    distributions.
    �DEBUG_UPDATE_MANAGERz$/etc/update-manager/release-upgradesz /etc/update-manager/meta-releaseNc	�|�|rd|_|jd|�d|���||_||_t	j
�|_d|_d|_|�tj�}t|��|_t|��|_t�|_t#�|_d|_d|_d}|dz|_|dz|_d|_d	|_t3j4�}t6j8j;|j<�r�	|j?|j<�|jId�rod}
d
D]h}|jK|
|�s�|j|j<�d|jM|
|��d��tO||
�d|��|jM|
|���jt3j4�}t6j8j;|jP�r�	|j?|jP�|jKdd�r�|jMdd�jS�}|dk(s|dk(r"d|_|jjU�y|dk(rZd|_tWjX�}
|
j[|j �r|j,|_n|jd�nd|_|r|j,|_|r |xj*|j.z
c_n!|r|xj*|j0z
c_|jd|j*z�d|_.|j_�s|jd�yt	j`|jb��je�y#t2j@$r9}	tBjDjGd
|j<�d|	���Yd}	~	yd}	~	wwxYw#t2j@$r9}	tBjDjGd
|jP�d|	���Yd}	~	yd}	~	wwxYw)NTz MetaRelease.__init__() useDevel=z
 useProposed=)�cachezhttps://changelogs.ubuntu.com/zmeta-releasezmeta-release-ltsz-developmentz	-proposedzERROR: failed to read 'z':
�METARELEASE)�URI�URI_LTS�URI_UNSTABLE_POSTFIX�URI_PROPOSED_POSTFIXz: � �_�DEFAULT�Prompt�never�no�ltsz Prompt=lts for non-LTS, ignoring�normalzmetarelease-uri: %sz_buildMetaReleaseFile failed)�target)3�DEBUG�_debug�
forceDownload�useDevelopmentRelease�	threading�Event�
downloaded�
upgradable_to�new_dist�apt�Cacher
�flavorr�flavor_namer�current_dist_namer�current_dist_version�no_longer_supported�prompt�METARELEASE_URI�METARELEASE_URI_LTS� METARELEASE_URI_UNSTABLE_POSTFIX� METARELEASE_URI_PROPOSED_POSTFIX�configparser�ConfigParser�os�path�exists�CONF_METARELEASE�read�Error�sys�stderr�write�has_section�
has_option�get�setattr�CONF�lower�set�distro_info�UbuntuDistroInfo�is_lts�metarelease_information�_buildMetaReleaseFile�Thread�download�start)r$r<�useProposed�debug�forceLTSr;r*�base_uri�parser�e�sec�krI�dis              rr%zMetaReleaseCore.__init__Ps�����D�J����$�k�
3�	
�
+���%:��"�#�/�/�+���!�����
��=��I�I�K�E�'�e�4���1��>���!)����$4�$6��!�#'�� ����4��'�.�8���#+�.@�#@�� �0>��-�0;��-��*�*�,��
�7�7�>�>�$�/�/�0�
����D�1�1�2��!�!�-�0�#���N�A��(�(��a�0����#�4�4�f�j�j��a�6H�J�� ���a�&8�&�*�*�S�!�:L�M�N��*�*�,��
�7�7�>�>�$�)�)�$�
����D�I�I�&�� � ��H�5����I�x�8�>�>�@���W�$��$��")�D�K��O�O�'�'�)���u�_�"'�D�K�%�5�5�7�B��y�y��!7�!7�8�/3�/G�/G��,����$F�G�"*�D�K��#'�#;�#;�D� � �� � �D�$I�$I�I� �
�� � �D�$I�$I�I� ����)�D�,@�,@�@�A�'+��$��)�)�+��K�K�6�7������
�
�.�4�4�6��K �%�%�
��
�
� � ��,�,�a�1����
��8 �%�%�
��
�
� � �9=���A�F����	
�s0�N �5O/� O,�3/O'�'O,�/P;�/P6�6P;c���tjjdtjj|j��|_	t
|j
d�j�	tjj'|j
�dk(rtj(|j
�y
#t$�rtjdtjjd��}tjj|�d}tjj|�sP	tj|�n9#t$r-}tj j#d|z�Yd}~Yyd}~wwxYwtjj|�sQ	tj$|d�n9#t$r-}tj j#d|z�Yd}~Yyd}~wwxYwtjj|d	�}tjj|�sP	tj$|�n9#t$r-}tj j#d|z�Yd}~Yyd}~wwxYwtjj|tjj|j��|_Y��iwxYw#t*$rYy
wxYw)Nz/var/lib/update-manager/�a�XDG_CACHE_HOMEz~/.cacherzmkdir() failed: '%s'Fi�zupdate-manager-coreT)rPrQ�join�basenamerJ�METARELEASE_FILE�open�close�IOError�getenv�
expanduser�splitrR�makedirs�OSErrorrVrWrX�mkdir�getsize�unlink�	Exception)r$�	cache_dir�cache_parent_dirrmrQs     rrdz%MetaReleaseCore._buildMetaReleaseFile�s�� "�����&����(8�(8��9M�9M�(N�!
���
	���&�&��,�2�2�4�@	��w�w���t�4�4�5��:��	�	�$�/�/�0���I�	��	�	� �"�'�'�"4�"4�Z�"@��I� "�w�w�}�}�Y�7��:���7�7�>�>�"2�3�!��K�K� 0�1���!��J�J�$�$�%;�a�%?�@� ��!���7�7�>�>�)�,�!��H�H�Y��.���!��J�J�$�$�%;�a�%?�@� ��!���7�7�<�<�	�+@�A�D��7�7�>�>�$�'�!��H�H�T�N���!��J�J�$�$�%;�a�%?�@� ��!��%'�G�G�L�L��b�g�g�&�&�t�';�';�<�%�D�!�7	��D�	���	�s��$B?�3AK�?A>K�>E�K�	F
�"F�?K�F
�
"K�-G�K�	G:�
"G5�/K�5G:�:AK�=I�K�	J	�"J�>K�J	�	AK�K�	K+�*K+c��||_y)zWvirtual function that is called when the distro is no longer
        supported
        N)rH�r$�dists  r�dist_no_longer_supportedz(MetaReleaseCore.dist_no_longer_supported�s��$(�� rc��||_y)zWvirtual function that is called when a new distro release
        is available
        N)rAr�s  r�new_dist_availablez"MetaReleaseCore.new_dist_available�s����
rc��|jd�|j}|jd|z�d}g}tj|j�}	|j��r�dD]}||jvs�td|z��|jd}|jd|z�|jd}ttjj|��}d|d	<tjt|��}	t|jd
�}
|jd}t!|||	|
�}d|jvr8|jd|_t%�}
|
r|xj"d
|
zz
c_d|jvr<|jd|_|j)|�}|r|xj&|z
c_d|jvr|jd|_d|jvr|jd|_d|jvr|jd|_|j1|�||k(r|}|j�r���|jj7�d|_|�|jd�yd}|D]L}|j8|j8kDs�|j:s
|j<s�6|}|jd|z�n|dk7r$|j:s||_|jA|�|dk7r||_|jC|�y#tj2$rtd|j4z��wxYw)NzMetaRelease.parse()zcurrent dist name: '%s')r�Version�	Supported�DatezRequired key '%s' missingrzfound distro name: '%s'r�r�r�r��ReleaseNotesz?lang=%s�ReleaseNotesHtml�UpgradeTool�UpgradeToolSignature�
UpgradeBrokenzUnable to parse %sz,current dist not found in meta-release file
F�znew dist: %sT)"r:rF�apt_pkg�TagFilerc�step�sectionr�list�email�utils�	parsedate�time�mktime�tuple�intrrr
r �#_get_release_notes_uri_query_stringr!r"r#�appendrUrJrxrrr<r@r�r�)r$rF�current_dist�dists�	index_tag�required_keyr�rawdate�
parseddaterrrr��lang�queryr@s                r�parsezMetaReleaseCore.parse�sM�����)�*� �2�2�����-�0A�A�B������O�O�D�$@�$@�A�	�+	��.�.�"�$L��L�#�9�+<�+<�<�3�7�,�F����
!�(�(��0�����5��<�=�#�+�+�F�3��!�%�+�+�"7�"7��"@�A�
� !�
�1�
��{�{�5��#4�5���	� 1� 1�+� >�?�	�#�+�+�I�6���D�'�4��;��!�Y�%6�%6�6�+4�+<�+<�^�+L�D�(�#�:�D���,�,�
�T�0A�A�,�%��):�):�:�/8�/@�/@�*�0�D�,�!�D�D�T�J�E���0�0�E�9�0� �I�$5�$5�5�'0�'8�'8��'G�D�$�)�Y�->�->�>�*3�*;�*;�.�+�D�'�#�i�&7�&7�7�*3�*;�*;�O�*L�D�'����T�"��,�,�#'�L�M�.�.�"�X	
�$�$�*�*�,�'+��$�
���K�K�G�H���
��
	�D��y�y�<�,�,�,�
�~�~�d�.H�.H�� $�
����N�]�:�;��
	��B��|�'=�'=�!.�D���)�)�,�7��B��!.�D���#�#�M�2���O�}�}�	�'�$�t�';�';�;��
�	�s�$L+�;GL+�+,Mc�N�|jd�d}t|j�}|jdd�|jdd�t	j
|jtj�r*	t	j|j�j}|dkDrD|js8|jdtjtj|���	t|d�	�}tj j#|j�rNt	j
|jtj�s 	t	j$|j�	t)|jd
�}|j+�D]"}|j-|j/d���$|j1�|j3dd�||_|j9�|j4�d|jd�	|jG�|jPrG|jPjRr1t	jN|j�n|jd�|jTjW�y#t$rY���wxYw#t$r'}t'd
|j�d|�d��Yd}~��\d}~wwxYw#t6$rY��wxYw#t:$r�}|j<dk(rctj j#|j�r:|jd|jz�t)|jd�|_n|jd|z�Yd}~���d}~wt>t@tBjDf$r7}|jd|z�t'd|jz�Yd}~���d}~wwxYw#tH$rEtKjLd|jz�t	jN|j�Y���wxYw)NzMetaRelease.download()rz
Cache-ControlzNo-Cache�Pragmazno-cachezIf-Modified-Since�)�timeoutzCan't unlink 'z' (�)zw+zUTF-8i0zreading file '%s'�rz%result of meta-release download: '%s'zIFailed to connect to %s. Check your Internet connection or proxy settingsz!have self.metarelease_informationzparse failed for '%s'zNO self.metarelease_information),r:rrJ�
add_headerrP�accessrv�W_OK�stat�st_mtimer~r;r��asctime�gmtimerrQrRr��printrw�	readlinesrX�decode�flush�seekrcryrxr�coderr�socketr�r�r��logging�	exception�removerAr#r?r_)r$�lastmodified�req�urirm�f�lines       rrfzMetaReleaseCore.downloadZs)�����,�-����d�*�*�+������
�3����x��,�
�9�9�T�*�*�B�G�G�4�
�!�w�w�t�'<�'<�=�F�F���!��D�$6�$6��N�N�#�T�\�\�$�+�+�l�2K�%L�
�(	��#�r�*�C��w�w�~�~�d�3�3�4�R�Y�Y��%�%�r�w�w�>���I�I�d�3�3�4�
���.�.��5���M�M�O�2�D��G�G�D�K�K��0�1�2����	����q�!��/0��,�
�I�I�K�"�'�'�3��K�K�;�<�
1��
�
���}�}����!=�!=��	�	�$�/�/�0��K�K�9�:��������C�
��
��"���48�4I�4I�1�M�������
��
���	I��v�v��}�������0E�0E�!F����/�$�2G�2G�G�H�/3�D�4I�4I�3�/O��,����C�a�G�H����-����8�	��K�K�?�!�C�D��$�&*�&:�&:�;�
�
��	���
1��!�!�+�d�.C�.C�C���	�	�$�/�/�0�
1�s��<)J�/A$K&�J$�4A4K�(K&�O�	J!� J!�$	K�-K�	K&�K�K&�	K#� K&�"K#�#K&�&	O�/BM;�;!O�,O�O�A
P$�#P$c�8�|jj�Sr)r?�is_set)r$s r�downloadingzMetaReleaseCore.downloading�s���?�?�)�)�+�+�+rc��d}t�}|r|d|zz
}|d|jzz
}|d|jzz
}t|d�S)N�?zlang=%s&zos=%s&zver=%sz/?)r
rDrr)r$r��qr�s    rr�z3MetaReleaseCore._get_release_notes_uri_query_string�sR�����z���
��d�"�"�A�	�X����
#�#��	�X����
$�$���Q��~�rc�b�|jr#tjj|dz�yy)N�
)r9rVrWrX)r$�msgs  rr:zMetaReleaseCore._debug�s$���:�:��J�J���S�4�Z�(�r)FFFFFN)rrr�__doc__rP�environr9r]rSr%rdr�r�r�rf�propertyr�r�r:rrrr'r'Ds{���

#�b�j�j�0�E�2�D�9��$������p7�f-�^(��X�xK�Z�,��,��)rr'�__main__F)#rBr�r`rN�http.clientrr��email.utilsr�rPr�rVr�r=�urllib.parser�urllib.requestrr�urllib.errorrrr�r
rrr
rr�r�objectrr'r�metarrr�<module>r�s���.����%���	�
�
����+�,���	�I�	�#�6�#�v)�f�v)�r�z���5�%�(�D�r

Zerion Mini Shell 1.0