https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /usr/lib/python2.7/site-packages/redhat_support_tool/helpers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pyc
�
��Tc@sdZddlmZddlmZddlmZddlZddlZddl	Z	ddlj
jZddlZddl
Z
ddlZddlZddlZdZdZejd�ZdZd	efd
��YZdefd��YZd
ejfd��YZdS(s2
A module that facilitates access to the Yum API.
i����(t_(t	TextMeter(tRPMBaseCallbackNs!Nigel Jones <nigjones@redhat.com>s%Keith Robertson <kroberts@redhat.com>s-redhat_support_tool.helpers.yumdownloadhelpertNoReposErrorcBseZd�ZRS(cCstj||�dS(N(t	Exceptiont__init__(tselftmsg((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pyR*s(t__name__t
__module__R(((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pyR)st	NullMetercBseZd�ZRS(cCsdS(sV
        Without this Yum will send annoying installation progress to stdout.
        N((Rtpackagetactiont
te_currenttte_totalt
ts_currenttts_total((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pytevent/s(RR	R(((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pyR
.stYumDownloadHelpercBskeZd�Zddd�Zd�Zdd�Zd�Zdd�Zddd�Z	d	�Z
d
�ZRS(cCs�tjj|�|jdddd�ttjd�rN|j�t|_n|j�t	|dd��|j
jtdt
j��dS(	s�
        Returns an initialized yum.YumBase object.

        Important:
         You must close() the object after performing a transaction.
        t
debuglevelit
errorleveltsetCacheDirt_checkSignaturescSstS(N(tTrue(txty((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pyt<lambda>MstfoN(tyumtYumBaseRt
doConfigSetupthasattrRRt_override_sigcheckst
_getConfigtsetattrtrepostsetProgressBarRtsyststdout(R((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pyR8s


srhel*debug*t*cCs�|r|jj|�n|r2|jj|�n|jjd�|j�|jj�}d}x0|D](}tj|j|�rh|d}qhqhWt	|�dks�|dkr�t
td|���n|jjtdt
j��dS(Niis�No repositories matching %s were able to be enabled, please ensure that your system is subscribed to the appropriate software repositories.R(R#tdisableRepot
enableRepoR$tNonetdoRepoSetuptlistEnabledtfnmatchtidtlenRRRR%R&(Rtrepos_to_enabletrepos_to_disablet
enabled_repostmatch_counttrepo((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pytsetup_reposRs

	cCs4g}x'|jj�D]}|j|j�qW|S(s�Return a list of repoids
        Iterates over repos.listEnabled() and assembles a list of the
        repository ids used by yum.
        (R#R,tappendR.(RtrepoidsR4((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pytget_repoidsmscCs�d}yH|jjd�|jjd|g�}|jjtdtj��Wn3tk
r�}t	j
tj|�t	j
|�nX|S(sU
        Find package in the available repos. WARNING: by default this
        function only searches the debug repos.  You need to change
        the args to search other repos.

        Keyword arguments:
         query            -- A package name.  Wildcards allowed.

        Returns:
             An array yum package objects.
        tpatternsRN(R*R#R$tpkgSacktreturnPackagesRR%R&RtloggertlogtloggingtERRORt	exception(RtquerytretValte((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pytfind_packagews cCs�tjj|j��s�tjtjj|j���}|j|j}|j|kr�t	d|jdd|ddf�}t
jtj
|�tSntS(Ns,Package size: %d MB > Available space: %d MBi(tostpathtexiststlocalPkgtstatvfstdirnametf_bavailtf_frsizetsizeRR<R=R>R?tFalseR(Rtpkgobjtfs_stattfs_sizeR((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pytisSpaceToDownloadPackage�s!#cCs�|sttd���nyr|j|�sXtd||j�f�}t|��n|j|g�}|r�tdj||���nWn6tk
r�}td|�GHtjtj	|�dSXt|d�r�|jSdSdS(NsNo package object.s/Insufficient space to download package %s to %ss
s	ERROR: %st	localpath(
RRRRRHtdownloadPkgstjoinR<R=R>R?R*RRS(RROterrterrorsRC((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pytdownloadPackage�s" cCs�|j|�}d}|r�y1x*|jD]}|jd�r(|}Pq(q(WWq�tk
r�}td|�GHtjtj	|�q�Xn|s�td|�}td|�GHtjtj	|�t|��dSt
|d�r�|j}nd|j|j
|jf}tjj||�}	tjj|	d�}
tjj|
�r]tjtjd|
�|
Stjj|	�stj|	�n|j|||
�S(Ntvmlinuxs	ERROR: %ss.Failed to install kernel debug symbols from %stnvrs%s-%s-%ss&%s already exists, skipping extraction(RXR*tfilelisttendswithRRR<R=R>R?RRZtnametversiontreleaseRERFRURGtINFOtmkdirtextractFile(RROt
kernelext_dirtlocationtvmlinuxfoundRFRCRVtpkgnvrtdestdirtdest((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pyt_extractKernelDebug�s:cCs5g}tj�jdd�}tjj|�sgtd�|}|GHtjt	j
|�t|��ntj|tj
�s�td�|}|GHtjt	j
t�t|��nx{|D]s}|j||�}|r�t|d�r�|j}nd|j|j|jf}|ji|d6|d6�q�q�W|S(	Ntoptiontkern_debug_dirsXUnable to download kernel debug symbols because the cache directory, %s, does not exist.sZUnable to download kernel debug symbols because the cache directory, %s, is not writeable.RZs%s-%s-%sRRF(tconfighelpertget_config_helpertgetRERFRGRR<R=R>R?RtaccesstW_OKtstrRiRRZR]R^R_R6(RtpkgArytextracted_pathsRcRVROtretRf((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pytextractKernelDebugs�s4			
	
cCs�d|}d|g}dd|g}d}tj�}y�tjd�}tj|�tj|dtjdtj�}	tj|d|	j	dtjdtj�}
|
j
�\}}|
j}
|
d	kr�t|j
���ntjtjj||�|�Wn~tk
r}}tjtj|�td
|�GHtd||f�GHtjj|�rttjtjj|��nd}nXtj|�|r�tj|�n|S(Nt.trpm2cpiotcpios-ids-rhstR&tstderrtstdinis	ERROR: %ss#ERROR: Unable to extract %s from %s(R*REtgetcwdttempfiletmkdtemptchdirt
subprocesstPopentPIPER&tcommunicatet
returncodeRtrstriptshutiltmoveRFRUR<R=R>R?RRGtrmtreeRJ(RtpkgloctpatternRhtcpiopatterntrpm2cpiocmdtcpiocmdttempdirtprevcwdtproc1tproc2toutRVRtRC((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pyRb�s<

			#

N(RR	RR5R8R*RDRRRXRiRuRb(((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pyR7s		
	&	%(t__doc__t(redhat_support_tool.helpers.confighelperRturlgrabber.progressRtyum.rpmtransRR-R>REthelpersRlR�RR%R|Rt
__author__t	getLoggerR<R*t_yum_helperRRR
RR(((sQ/usr/lib/python2.7/site-packages/redhat_support_tool/helpers/yumdownloadhelper.pyt<module>s&	

https://t.me/AnonymousX5 - 2025