usr/lib/python3.9/site-packages/dnf/__pycache__/drpm.cpython-39.pyc000064400000012357151113272200020772 0ustar00a ©!cÐã@sªddlmZddlmZddlmZddlmZddlmZddl Z ddl Z ddl Z ddl Z ddlZddlZddlZdZe d¡ZGd d „d e jjƒZGd d „d eƒZdS) é)Úabsolute_import)Úunicode_literals)Úhexlify)Úunlink_f)Ú_Nz/usr/bin/applydeltarpmÚdnfcsXeZdZ‡fdd„Zdd„Z‡fdd„Zdd„Zed d „ƒZed d „ƒZ d d„Z ‡Z S)Ú DeltaPayloadcs"tt|ƒ ||¡||_||_dS©N)ÚsuperrÚ__init__Ú delta_infoÚdelta)Úselfr r ÚpkgÚprogress©Ú __class__©ú,/usr/lib/python3.9/site-packages/dnf/drpm.pyr )szDeltaPayload.__init__cCstj |jj¡Sr )ÚosÚpathÚbasenamer Úlocation©rrrrÚ__str__.szDeltaPayload.__str__cs2tt|ƒ |||¡|tjjjkr.|j |¡dSr ) r rÚ_end_cbÚlibdnfÚrepoZPackageTargetCBZTransferStatus_ERRORr Úenqueue)rZcbdataZ lr_statusÚmsgrrrr1szDeltaPayload._end_cbcCsh|j}|j\}}t |¡}t|ƒ ¡}tjj  |¡}|tjjj krRt   t dƒ|¡|j|||j|jdœS)Nzunsupported checksum type: %s)Z relative_urlZ checksum_typeZchecksumZ expectedsizeZbase_url)r ÚchksumÚhawkeyZ chksum_namerÚdecoderrZ PackageTargetZ checksumTypeZChecksumType_UNKNOWNÚloggerZwarningrrÚ downloadsizeZbaseurl)rr ZctypeZcsumr Z ctype_coderrrÚ_target_params6s   ûzDeltaPayload._target_paramscCs|jjSr )r r$rrrrÚ download_sizeHszDeltaPayload.download_sizecCs|jjSr )rr$rrrrÚ _full_sizeLszDeltaPayload._full_sizecCs$|jj}tj |jjjtj |¡¡Sr ) r rrrÚjoinrrZpkgdirr)rrrrrÚlocalPkgPszDeltaPayload.localPkg) Ú__name__Ú __module__Ú __qualname__r rrr%Úpropertyr&r'r)Ú __classcell__rrrrr(s    rc@s>eZdZddd„Zdd„Zdd„Zdd „Zd d „Zd d „ZdS)Ú DeltaInfoNc Csˆd|_t ttj¡rd|_zt d¡|_WnttfyFd|_Yn0|dur`t j   ¡j |_ n||_ ||_ ||_g|_i|_i|_dS)z·A delta lookup and rebuild context query -- installed packages to use when looking up deltas progress -- progress obj to display finished delta rebuilds FTÚSC_NPROCESSORS_ONLNéN)Údeltarpm_installedrÚaccessÚ APPLYDELTAÚX_OKÚsysconfÚ deltarpm_jobsÚ TypeErrorÚ ValueErrorrZconfZConfÚdeltarpm_percentageÚqueryrÚqueueÚjobsÚerr)rr;rr:rrrr Vs zDeltaInfo.__init__cCs¤|js dS|jjr|jsdS| ¡r(dStj | ¡¡rZverifyLocalPkgrÚunlinkrÚendÚcallbackZ STATUS_DRPM)rÚpidÚcodeÚploadrrrrÚjob_done‡s ÿ  zDeltaInfo.job_donec Csbttd|jj| ¡|j ¡g}tjtjg|¢RŽ}t t j j d|d  |dd…¡¡||j |<dS)Nz-azdrpm: spawned %d: %sú é)r4rrAr)rÚspawnlÚP_NOWAITr#rHrrIrJr(r=)rrQZ spawn_argsrOrrrÚ start_job—sþÿzDeltaInfo.start_jobcCsh|jr,t dtj¡\}}|sq,| ||¡q|j |¡t|jƒ|jkrd|  |j  d¡¡|js8qdq8dS)Néÿÿÿÿr) r=rÚwaitpidÚWNOHANGrRr<ÚappendÚlenr7rWrK)rrQrOrPrrrr¡s zDeltaInfo.enqueuecCs<|jr8t ¡\}}| ||¡|jr| |j d¡¡qdS)z!Wait until all jobs have finishedrN)r=rÚwaitrRr<rWrK)rrOrPrrrr]®s   zDeltaInfo.wait)N) r*r+r,r rErRrWrr]rrrrr/Us    r/)Z __future__rrZbinasciirZ dnf.yum.miscrZdnf.i18nrZ dnf.callbackrZ dnf.loggingZdnf.repor!rIZ libdnf.reporrr4Z getLoggerr#rZPackagePayloadrÚobjectr/rrrrÚs      -