ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/clconfigure/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/clconfigure/__pycache__/packages.cpython-311.pyc

�

;G�fL
����ddlZddlZddlZddlmZmZdZdZed��d���Zed��d���Z	ed	��dde
defd
���Zd�Z
d�ZdS)�N)�task�run�uninstalled�	installedz Erasing package '{package_name}'c��tddd|g��t|��}tjd||��t|krtd���dS)N�rpmz-ez--nodeps�AChecking package '%s' state again... package is now in state '%s'�Failed to do required actions)r�get_package_state�logging�info�
STATE_REMOVED�RuntimeError)�package_name�
current_states  �py/clconfigure/packages.py�
erase_packagers_�����j�,�/�0�0�0�%�l�3�3�M��L�T�Vb�dq�r�r�r��
�%�%��:�;�;�;�&�%�z<Changing package '{package_name}' state to '{desired_state}'c��t|��}tjd||��||krtjd|��dStjd��|tkrd}n|t
krd}nt
���td|d|g��t|��}tjd	||��||krtd
���dS)z�
    Brings package to given state (installed | uninstalled).
    May be executed more than once, doesn't crash on future calls
    z7Checking package '%s' state... package is in state '%s'z"No actions needed for package '%s'Nz(State does not match target, changing...�remove�install�yum�-yr	r
)	rr�debugr
r�STATE_INSTALLED�NotImplementedErrorrr)�
desired_staterr�actions    r�set_package_staters���&�l�3�3�M��M�K�\�[h�i�i�i��
�%�%��
�:�L�I�I�I����L�;�<�<�<��
�%�%����	�/�	)�	)����!�#�#�#�����l�+�,�,�,�%�l�3�3�M��L�T�Vb�dq�r�r�r��
�%�%��:�;�;�;�&�%rz'(Re)installing package '{package_name}'Fr�	reinstallc��t|��}|tkr	|rddd|g}n|tkrddd|g}ndSt|��dS)Nrr rr)rrrr)rr �state�cmds    r�install_packager$6s^���l�+�+�E�����I���k�4��6���	�-�	�	��i��|�4�������H�H�H�H�Hrc�X�tdd|g��}|jdkrtntS)zJ
    Gets current package state.
    Either installed or uninstalled.
    rz-qvr)r�exitcoderr)�package�resps  rrrBs.��
��u�g�&�'�'�D�"�m�q�0�0�?�?�m�Crc�>�d�tjd��D��S)zN
    Gets installed alt-phps
    return: list ['php44', 'php54', 'php80']
    c�<�g|]}tjd|���|��S)z^php\d+$)�re�match)�.0�phps  r�
<listcomp>z/get_list_installed_alt_phps.<locals>.<listcomp>Ps)��P�P�P�C�R�X�k�3�5O�5O�P�C�P�P�Prz/opt/alt)�os�listdir�rr�get_list_installed_alt_phpsr3Ks#��
Q�P�2�:�j�1�1�P�P�P�Pr)F)rr0r+�clconfigurerrrrrr�str�boolr$rr3r2rr�<module>r7s������	�	�	�	�	�	�	�	�!�!�!�!�!�!�!�!��
�����(�)�)�<�<�*�)�<���D�E�E�<�<�F�E�<�6��/�0�0�
�
�#�
�$�
�
�
�1�0�
�D�D�D�Q�Q�Q�Q�Qr

Zerion Mini Shell 1.0