%PDF- %PDF-
Mini Shell

Mini Shell

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

�

&��e�$���ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m	Z	ddl
mZddlmZgd�Z
ddlmZd�Zd	�Zd
�Zd�Zd�Zd
�Zy)�N)�datetime)�OptionParser)�gettext)
z/binz/bootz/etcz/initrdz/libz/lib32z/lib64z/sbinz/usrz/var�)�DistUpgradeConfigc	��t�}|jdddd��|jddd��|jd	dd
��|jddd
td���|jdddtd���|jddddtd���|jdddtd���|jdddtd���|jddd dtd!��"�|j�S)#z/ setup option parser and parse the commandline z--have-prerequists�havePrerequists�
store_trueF)�dest�action�defaultz--with-network�withNetwork)rrz--without-network�store_falsez
--frontend�frontendNz_Use frontend. Currently available: 
DistUpgradeViewText, DistUpgradeViewGtk, DistUpgradeViewKDE)rr
�helpz--mode�mode�desktopz(*DEPRECATED* this option will be ignoredz	--partial�partialz:Perform a partial upgrade only (no sources.list rewriting))rr
rrz--disable-gnu-screenzDisable GNU screen support)rr
rz	--datadir�datadir�.zSet datadirz--devel-release�
devel_releasez"Upgrade to the development release)rrr
r)r�
add_option�_�
parse_args)�parsers �=/usr/lib/python3/dist-packages/DistUpgrade/DistUpgradeMain.py�do_commandliner6sH��
�^�F�
���*�1B�)�5��:�
���&�]�,��O�
���)�
�]��S�
���l��D��[�\��]����h�V�I��G�H��J�
���k�	�5�)��Y�Z��\����,�\�#��9�:��<����k�	�3��]�+��-�
���'��*�E��A�B��D������c
�F�|jddd�}tjj|�stj|�tj
|dz�r�t
j�}|d|j|j|j|j|jfzz}tjj|�stj|�tj
|dz�D]S}tj|tjj|tjj!|����Utjj|d�}|j"r|dz
}t%|d�5	d	d	d	�t'j(t&j*|d
d��t'j,d
|j.z�t'j,ddjtj0��z�t2j4j7d	�}|dj8j:}t'j,d|z�t'j,dt<j>z�|S#1swY��xYw)z setup the logging �Files�LogDirz/var/log/dist-upgrade/z/*.logz/%04i%02i%02i-%02i%02izmain.logz.partial�aNz%%(asctime)s %(levelname)s %(message)s�w)�level�filename�format�filemodezUsing config files '%s'zuname information: '%s'� �aptzapt version: '%s'zpython version: '%s') �getWithDefault�os�path�exists�mkdir�globr�now�year�month�day�hour�minute�shutil�move�join�basenamer�open�logging�basicConfig�DEBUG�info�config_files�unamer)�apt_pkg�Cache�current_ver�ver_str�sys�version)	�options�config�logdirr0�
backup_dir�f�fname�cache�apt_versions	         r�
setup_loggingrOOs���
�
"�
"�7�8�4L�
M�F�
�7�7�>�>�&�!�
������y�y����!��l�l�n���4�������3�7�7�SV�S[�S[�\_�\f�\f�7g�g�g�
��w�w�~�~�j�)��H�H�Z� ����6�(�?�+�	I�A��K�K��2�7�7�<�<�
�2�7�7�3C�3C�A�3F�G�H�	I��G�G�L�L��
�+�E����
����	
�e�S�	�
��
����g�m�m�!&�F�!$�&��L�L�*�V�-@�-@�@�A��L�L�*�S�X�X�b�h�h�j�-A�A�B��K�K���d�#�E���,�*�*�2�2�K��L�L�$�{�2�3��L�L�'�#�+�+�5�6��M�
�
�s�J�J c���	ddlm}t
jj|d�}tjd|z�tjd�}|�}|jd|dd�	�tj|�	tjd
dgtjd��j�d
}tt
jj|d�d�5}|j!|�ddd�y#t$rtjd�YywxYw#1swYyxYw#t"$r"}tjd|z�Yd}~yd}~wwxYw)Nr)�AptClonezfailed to import AptClonezapt-clone_system_state.tar.gzzcreating statefile: '%s'�6�/T)�	sourcedir�target�with_dpkg_status�
scrub_sources�lspciz-nn��stdout�universal_newlinesrz	lspci.txtr#zlspci failed: %s)�	apt_clonerQ�ImportErrorr;�errorr+r,r8�debug�umask�
save_state�
subprocess�Popen�PIPE�communicater:�write�OSError)rIrQrU�	old_umask�clone�srK�es        r�save_system_staterlps,���'��W�W�\�\�&�"A�
B�F��M�M�,�v�5�6����� �I��J�E�	���s�6�D�����H�H�Y��.�
�
�
�G�E�?�:�?�?�.2�4�4?�K�M�!�E��
�"�'�'�,�,�v�{�3�S�
9�	�Q�
�G�G�A�J�	�	��#���
�
�1�2����"	�	���.��
�
�(�1�,�-�-��.�sH�D�A#D5�*D)�<D5�D&�%D&�)D2�.D5�2D5�5	E �>E�E c	��|jg|jdd�zD]:}|s�	ddlm}|d|zd�}t	||�}|||j
��}|Stjd
�td
�tjd�S#t$r8}tjd|�d|�d	��td
|�d|�d	��Yd}~��d}~wwxYw)z0 setup view based on the config and commandline �Viewr)�
import_moduler�DistUpgrade)rIrzcan't import view 'z' (�)zcan't load z (Nz!No view can be imported, abortingr)
r�getlist�	importlibro�getattrr�	Exceptionr;�warning�printr^rE�exit)	rGrHrI�requested_viewro�
view_modul�
view_class�instancerks	         r�
setup_viewr}�s���#�+�+�,�V�^�^�F�6�-J�J�����	>�/�&�s�>�'9�=�I�J�!��^�<�J�!�����I�H���O�)�"	�
�
�9�:�
�1�2�������O���	>��O�O�^�A�N�O��.�!�<�=�=��	>�s�2B�	C�.C�Cc��d}	tjddgtjd��j�d}t	j
d|z�||vr0t	jd
�tjdddd
d|g�dtjd<dddddd|gtjz}t	jd|z�tjd|�y	#t$rt	jd�Yy	wxYw)z� check if there is a upgrade already running inside gnu screen,
        if so, reattach
        if not, create new screen window
    z$ubuntu-release-upgrade-screen-window�screenz-lsTrYrzscreen returned: '%s'zscreen could not be runNz)found active screen session, re-attachingz/usr/bin/screenz-dz-rz-p�1�RELEASE_UPGRADER_NO_SCREENz-ez\0\0z-c�screenrcz-Szre-exec inside screen: '%s')
rbrcrdrer;r_rgr>r+�execv�environrE�argv)�
SCREENNAME�out�cmds   r�%run_new_gnu_screen_window_or_reattachr��s���
8�J�����
�e��Z�_�_�#�%�%0�[�]�1�6��	�
�
�-��3�4�
�S�����@�A�
���"�h��d�D�*�%M�N�-0�B�J�J�+�,���������!�X�X�&�C��L�L�.��4�5��H�H�
��$��%�����.�/���s�AC%�%D�Dc��t�\}}t|j�}t||�}ddlm}t
jd|z�tjd�|j�|jdk(rHtjjtj�d�}tjd|�t|||�}|j r(dtj"vr|j$s
t'�tj(d�sd	tj"d<dd
lm}||||j��}t-j.|j0�|j2r:|j5�st7j8d�t7j8d�t;|�|j=�ryy)
z
 main method r)�VERSIONz%release-upgrader version '%s' startedzubuntu-release-upgraderr�mor��NEEDRESTART_SUSPEND�y)�DistUpgradeController)rr)rrrrO�DistUpgradeVersionr�r;r>r�
textdomainr+r,r8�getcwd�bindtextdomainr}�needs_screenr��disable_gnu_screenr��getenvr��atexit�register�_enableAptCronJobr�doPartialUpgraderErxrl�run)	rG�argsrHrIr��	localedir�viewr��apps	         r�mainr��sO��%�&�O�W�d�
�w���
/�F�
�7�F�
+�F�+��L�L�8�7�B�C����0�1�����'�/�/�S�"8��G�G�L�L�����d�3�	����8�)�D��g�v�v�.�D�	
���(�B�J�J�6��&�&�-�/��9�9�*�+�,/��
�
�(�)�<�
��g�w���
G�C�
�O�O�C�)�)�*�����#�#�%��H�H�Q�K�������f���w�w�y��r)r)r�rr/r;r+r6rbrEr�optparserr�SYSTEM_DIRS�DistUpgradeConfigParserrrrOrlr}r�r��rr�<module>r�sW��,�
����	�
��
��!� �
��7��2�B.�4�4%�B.
r

Zerion Mini Shell 1.0