§ À•¿jÆãóz—ddlmZddlmZddlmZddlZddlmZddlmZm Z m Z m Z m Z m Z Gd„d e¦«ZdS) é)Úprint_function)Údivision)Úabsolute_importN)ÚBasePkgManageré)Úscan_python_versionsÚis_major_versionÚ CONFIG_DIRÚcreate_config_dirsÚ ALT_NAMESÚALT_PYTHON_PREFIXcó^—eZdZdZd„ZeZeZdZ d„Z d„Z d„Z d„Z d„Zd „Zed „¦«Zd S) Ú PkgManagerz– Class responsible for all interactions with Yum, python version installation/removal and gathering info about already installed versions có"—t¦«dS©N)r ©Úselfs úY/opt/cloudlinux/venv/lib64/python3.11/site-packages/clselect/clselectpython/pkgmanager.pyÚ_create_config_dirszPkgManager._create_config_dirss€ÝÑÔÐÐÐóz/var/log/cl-python-last-yum.logcó—t¦«Sr)rrs rÚ_scan_interpreter_versionsz%PkgManager._scan_interpreter_versions-s€Ý#Ñ%Ô%Ð%rcód—td | dd¦«¦«zS)Nz{}/.lockú.Ú)r ÚformatÚreplace)rÚversions rÚ_get_lock_file_pathzPkgManager._get_lock_file_path0s2€Ý  :×#4Ò#4Ø �OŠO˜C Ñ $Ô $ñ$&ô$&ñ&ð &rcóÌ—| ¦«}|s,| ¦«| ¦«}|sdStjd|¦«}d„|D¦«}|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-python(\d+)cóX—g|]'}d |d|dd…g¦«‘Œ(S)rrrN)Újoin)Ú.0rs rú z1PkgManager.checkout_available..Js5€ÐRÐRÐR¸W�S—X’X˜w qœz¨7°1°2°2¬;Ð7Ñ8Ô8ÐRÐRÐRr)Ú_read_yum_cacheÚupdate_yum_cacheÚreÚfindall)rÚdataÚ availables rÚcheckout_availablezPkgManager.checkout_available4sx€ð×#Ò#Ñ%Ô%ˆØð Ø × !Ò !Ñ #Ô #Ð #Ø×'Ò'Ñ)Ô)ˆDØð Ø�tÝ”JÐ0°$Ñ7Ô7ˆ ØRÐRÈ ÐRÑRÔRˆ ØÐrcó~—t|¦«sd |¦«S| ¦«}|r|SdS)z5Do some common pre-installation/uninstallation checksz>Invalid version "{}". It should be two digits separeted by dotN)r rÚ_check_yum_in_progress)rrÚ working_errors rÚ_verify_actionzPkgManager._verify_actionMsR€å Ñ(Ô(ð Nð>ß>DºfÀW¹o¼oð Nà×3Ò3Ñ5Ô5ˆ Ø ð !Ø Ð ð !ð !rcóX—|j| dd¦«z}|jdd|gzS)ax Build the yum install argv for an alt-python version. Defense-in-depth: `version` is already validated by `_verify_action()` (`is_major_version()` enforces \d+\.\d+), but with shell=False this is no longer load-bearing for command-injection safety. :param version: major python version, e.g. "3.11" :rtype: list[str] rrú-yÚinstall©Ú _alt_namesrÚ _yum_argv©rrÚpkgs rÚ format_cmd_string_for_installingz+PkgManager.format_cmd_string_for_installingVs2€ðŒo §¢°°RÑ 8Ô 8Ñ8ˆØŒ~  y°#Ð 6Ñ6Ð6rcóX—|j| dd¦«z}|jdd|gzS)z› Build the yum remove argv for an alt-python version. :param version: major python version, e.g. "3.11" :rtype: list[str] rrr1Úremover3r6s rÚformat_cmd_string_for_removingz)PkgManager.format_cmd_string_for_removingds2€ðŒo §¢°°RÑ 8Ô 8Ñ8ˆØŒ~  x°Ð 5Ñ5Ð5rcóL—ddlm}|¦«}| |¦«S)zJ Check what passed version isn't used any web-application r)ÚApplicationsManager)Ú$clselect.clselectpython.apps_managerr=Úis_version_in_use)rr=Ú apps_managers rÚ_is_version_in_usezPkgManager._is_version_in_usens9€ð MÐLÐLÐLÐLÐLØ*Ð*Ñ,Ô,ˆ Ø×-Ò-¨gÑ6Ô6Ð6rN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr Ú _config_dirr r4Ú _log_filerrr+r/r8r;Ú staticmethodrA©rrrrsµ€€€€€ððð ððð€Kð€Jà1€Ið&ð&ð&ð&ð&ð&ðððð2!ð!ð!ð 7ð 7ð 7ð6ð6ð6ðð7ð7ñ„\ð7ð7ð7rr)Ú __future__rrrr'Ú clselect.baseclselect.pkgmanagerrrrr r r r r rrIrrúrLsæðð&Ð%Ð%Ð%Ð%Ð%ØÐÐÐÐÐØ&Ð&Ð&Ð&Ð&Ð&Ø € € € à;Ð;Ð;Ð;Ð;Ð;ððððððððððððððððð_7ð_7ð_7ð_7ð_7�ñ_7ô_7ð_7ð_7ð_7r