j~ z d dl mZ d dl mZ d dl mZ d dlZd dlmZ ddlmZm Z m Z mZmZm Z G d d e ZdS ) )print_function)division)absolute_importN)BasePkgManager ) CONFIG_DIRis_major_versioncreate_config_dirs ALT_NAMESscan_node_versionsALT_NODE_PREFIXc n e Zd ZdZ fdZeZeZdZ d Z d Zd Zd Z d 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 t t | d S N)superr __init__)self __class__s Y/opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/clselectnodejs/pkgmanager.pyr zPkgManager.__init__ s% j$((***** z/var/log/cl-nodejs-last-yum.logc 0 | j |z }| j dd|gz S )z Build the yum groupinstall argv for an alt-nodejs version. :param version: major NodeJS version, e.g. "18" :rtype: list[str] -ygroupinstall _alt_names _yum_argvr versiongroups r format_cmd_string_for_installingz+PkgManager.format_cmd_string_for_installing- s$ ')~~u ===r c 2 | j |z }| j ddd|gz S )u0 Build the yum groupremove argv for an alt-nodejs version. Testing repo must be enabled — otherwise yum cannot see groups that were originally installed from cloudlinux-updates-testing. :param version: major NodeJS version, e.g. "18" :rtype: list[str] z'--enablerepo=cloudlinux-updates-testingr groupremover r s r format_cmd_string_for_removingz)PkgManager.format_cmd_string_for_removing7 s. ')~5-! r c <