Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/clselectnodejs/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/clselectnodejs/__pycache__/pkgmanager.cpython-311.pyc

�

!�g��z�ddlmZddlmZddlmZddlZddlmZddlmZm	Z	m
Z
mZmZm
Z
Gd�d	e��ZdS)
�)�print_function)�division)�absolute_importN)�BasePkgManager�)�
CONFIG_DIR�is_major_version�create_config_dirs�	ALT_NAMES�scan_node_versions�ALT_NODE_PREFIXc����eZdZdZ�fd�ZeZdZeZ	dZ
d�ede	de
g��Zd�ede	de
g��Z
d	�Zd
�Zd�Zd�Zd
�Zed���Z�xZS)�
PkgManagerz�
    Class responsible for all interactions with Yum, NodeJS version
    installation/removal and gathering info about already installed versions
    c�V��tt|�����dS�N)�superr�__init__)�self�	__class__s ��Y/opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/clselectnodejs/pkgmanager.pyrzPkgManager.__init__s%���
�j�$���(�(�*�*�*�*�*�z)LANG=C yum --disableplugin=fastestmirror z!&>/var/log/cl-nodejs-last-yum.log�z-y groupinstall z{} z7--enablerepo=cloudlinux-updates-testing -y groupremove c�<�td�|��zS)Nz{}/.lock)r
�format)r�versions  r�_get_lock_file_pathzPkgManager._get_lock_file_path@s����!2�!2�7�!;�!;�;�;rc�~�t|��sd�|��S|���}|r|SdS)z5Do some common pre-installation/uninstallation checksz3Invalid version "{}". It should be positive integerN)r	r�_check_yum_in_progress)rr�
working_errors   r�_verify_actionzPkgManager._verify_actionCsR����(�(�	C�3�39�6�'�?�?�
C��3�3�5�5�
��	!� � �	!�	!rc��|���}|s|���dStjd|��}|S)a�
        Should return list of major versions available to install from
        currently enabled repos.
            Note, this can be an empty list if no NodeJS version has been
            released to repos yet or in case of network/repos/yum problem.
        OR
            None if our cache is updating right now because it was
            absent/outdated/corrupted/etc.
        :rtype: list | None
        Nzalt-nodejs(\d+)\n)�_read_yum_cache�update_yum_cache�re�findall)r�data�	availables   r�checkout_availablezPkgManager.checkout_availableLsL���#�#�%�%���	��!�!�#�#�#��4��J�3�T�:�:�	��rc��t��Sr)r�rs r�_scan_interpreter_versionsz%PkgManager._scan_interpreter_versionscs��!�#�#�#rc�"�t��dSr)r
r*s r�_create_config_dirszPkgManager._create_config_dirsfs�������rc�L�ddlm}|��}|�|��S)zJ
        Check what passed version isn't used any web-application
        r)�ApplicationsManager)�$clselect.clselectnodejs.apps_managerr/�is_version_in_use)rr/�apps_managers   r�_is_version_in_usezPkgManager._is_version_in_useis9��	M�L�L�L�L�L�*�*�,�,���-�-�g�6�6�6r)�__name__�
__module__�__qualname__�__doc__rr�_config_dir�_yum_cmdr�
_alt_names�
_redirect_log�join�_install_cmd�_remove_cmdrr r(r+r-�staticmethodr3�
__classcell__)rs@rrrs���������
+�+�+�+�+��K�;�H��J�7�M��7�7����E��	���L��'�'��A��E��	���K�<�<�<�!�!�!����.$�$�$�����7�7��\�7�7�7�7�7rr)�
__future__rrrr$� clselect.baseclselect.pkgmanagerrrrr	r
rrr
r�rr�<module>rDs���&�%�%�%�%�%�������&�&�&�&�&�&�	�	�	�	�;�;�;�;�;�;�����������������Z7�Z7�Z7�Z7�Z7��Z7�Z7�Z7�Z7�Z7r

Hacked By AnonymousFox1.0, Coded By AnonymousFox