Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/dnf-plugins/
Upload File :
Current File : //lib/python2.7/site-packages/dnf-plugins/download.pyc

�
	i/\c@@s�ddlmZddlmZddlmZmZddlmZddlZddl	Zddl
ZddlZddlZddl
ZddlZddlZddlZddlZejjdejjfd��Y�ZdS(i(tabsolute_import(tunicode_literals(t_tlogger(tOptionParserNtDownloadCommandcB@s�eZdgZed�Zd�Zed��Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
ed
�Zed�Zed��Zd
�Zd�ZRS(udownloadu%Download package to current directorycC@s,tt|�j|�d|_d|_dS(N(tsuperRt__init__tNonetoptstparser(tselftcli((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyR+s	cC@sA|jddddtd��|j�}|jddddtd	��|jd
dddtd��|jdd
dddgdtjdddtd��|jddddtd��|jddddtd��|jdddddddtd��|jdddddd d!d"gdgdtd#��dS($Nupackagestnargsu+thelpupackages to downloadu--sourcetactionu
store_trueudownload the src.rpm insteadu--debuginfou'download the -debuginfo package insteadu--archu
--archlisttdestuarchestdefaulttmetavaru[arch]u5limit  the  query to packages of given architectures.u	--resolveu(resolve and download needed dependenciesu	--alldepsu^when running with --resolve, download all dependencies (do not exclude already installed ones)u--urlu--urlsuurluJprint list of urls where the rpms can be downloaded instead of downloadingu--urlprotocolsuappendtchoicesuhttpuhttpsursyncuftpu4when running with --url, limit to specific protocols(tadd_argumentRtadd_mutually_exclusive_groupRt_SplitCallback(R
ttarget((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyt
set_argparser0s(






cC@s�|jj}t|_t|_|jjrB|jjrBt|_	n|jj
ra|jjj
�n|jjr�|jjj�n|jjr�|jj|jj_n!tjjtj��|jj_dS(N(RtdemandstTruetsack_activationtavailable_reposR	tresolvetalldepstFalsetload_system_repotsourcetbasetrepostenable_source_repost	debuginfotenable_debug_repostdestdirtconftdnfti18ntucdtostgetcwd(RR((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyt	configureJs		cC@s|jjr$|j|jj�}n9|jjrH|j|jj�}n|j|jj�}|jjr�x�|D]�}|jt	j
krp|jd|jj�}|r�|GHq�t
d�|j}|jjjr�tjj|��ntj|�qpqpWdS|j|�dS(uExecute the util action here.tschemesu$Failed to get mirror for package: %sN(R	R!t_get_pkg_objs_sourcetpackagesR%t_get_pkg_objs_debuginfot_get_pkg_objs_rpmsturltrepoidthawkeytCMDLINE_REPO_NAMEtremote_locationturlprotocolsRtnameR"R(tstrictR)t
exceptionstErrorRtwarningt
_do_downloads(RtpkgstpkgR4tmsg((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pytrun]s"
cC@s�i}x-|D]%}|jt|�g�j|�q
Wg}g}x�|j�D]r}g|D]}|jtjkr\|^q\}|r�|j|d�qOn|jdd��|j|d�qOW|r�|jj	||jj
j�n|rnx{|D]p}|j�}t
jj|jjjt
jj|��}	t
jj||	�rNq�ntj||jjj�q�Wntg||D]}|j�^q|�}
|
S(u=
        Perform the download for a list of packages
        itkeycS@s|jj|jjfS(N(trepotprioritytcost(tx((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyt<lambda>�s(t
setdefaulttstrtappendtvaluesR5R6R7tsortR"tdownload_packagestoutputtprogresstlocalPkgR,tpathtjoinR(R'tbasenametsamefiletshutiltcopytsorted(RR@tpkg_dictRAtto_downloadtcmdlinetpkg_listtpkgs_cmdlinetsrctdstt	locations((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyR?xs0
#

* )cC@s1|jjr|j|�}n|j|�}|S(uc
        Return a list of dnf.Package objects that represent the rpms
        to download.
        (R	Rt_get_packages_with_depst
_get_packages(Rt	pkg_specsR@((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyR3�scC@s=|j|�}|j|�}t|j|dt��}|S(uj
        Return a list of dnf.Package objects that represent the source
        rpms to download.
        R!(R3t_get_source_packagestsetRcR(RRdR@tsource_pkgs((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyR0�sc	
C@s�t�}|jjj�}|j�}x�|j|�D]�}x�|j|jgD]v}|jd|dt	|j
�d|jd|jd|j
�}t}x!|D]}|j|�t}q�W|rPPqPqPWq7W|S(um
        Return a list of dnf.Package objects that represent the debuginfo
        rpms to download.
        R:tepochtversiontreleasetarch(RfR"tsacktqueryt	availableRct
debug_nametsource_debug_nametfiltertintRhRiRjRkRtaddR(	RRdtdbg_pkgstqRAtdbg_namet
dbg_availablet	dbg_foundtp((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyR2�s$				


cC@s�|r|jn|j}g}x�|D]�}y|j||��Wq%tjjk
r�}tjtjj	|��|j
jjr�tjt
d��tjj|��q�q%Xq%Wttj|��}|S(u Get packages matching pkg_specs.uExiting due to strict setting.(t_get_query_sourcet
_get_queryRLR)R<tPackageNotFoundErrorRterrorR*R+R"R(R;RR=tlistt	itertoolstchain(RRdR!tfunctqueriestpkg_specteR@((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyRc�s
c	C@s|j|�}tj|jj�}x|D]}|j|�q+W|j�}|r�|j�|j�}x*|D]"}||krq||g7}qqqqW|St	d�g}t
jdj|g|D]}t
|�^q���t
jtjj|j���gSdS(u-Get packages matching pkg_specs and the deps.uError in resolve of packages:u
    N(RcR6tGoalR"RltinstallRCt
list_installst
list_upgradesRRR>RTRKR)tutilt_format_resolve_problemst
problem_rules(	RRdR!R@tgoalRAtrctnew_pkgsRB((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyRb�s

3cC@s�t�}x�|D]�}|jrN|j|j�tjdt|�|j�q|jdkr}|jd|j|jf�qtj	t
d�t|��qWt|�S(u4Get list of source rpm names for a list of packages.u  --> Package : %s Source : %susrcu
%s-%s.src.rpmuNo source rpm defined for %s(Rft	sourcerpmRsRtdebugRKRkR:tevrtinfoRR~(R@RgRA((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyRe�s	
		  cC@s9tjjj|�d}|o(|dk}|sR|jd�r�tjj|�r�|jj|gd|jj	j
�}|jjj�j
d|�Stjj|�}|j|jj�}|j�}|j�}|jjr�|jd	|jj�}nt|j��dkr5td
�|}tjj|��n|S(u#Return a query to match a pkg_spec.iuhttpuftpufileuhttpsu.rpmRQRARkuNo package %s available.(uhttpuftpufileuhttps(R)tpycompturlparsetendswithR,RStisfileR"tadd_remote_rpmsRPRQRlRmtfiltermtsubjecttSubjecttget_best_queryRntlatestR	tarchesRqtlenRCRR<R|(RR�R/tis_urlR@tsubjRuRB((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyR{�s'$c	C@s�|d }tj|�}|jjj�}|j�}|j�}|jd|jd|j	d|j
d|j�}t|j
��dkr�td�|}tjj|��n|S(u/Return a query to match a source rpm file name.i����R:RiRjRkiuNo package %s available.(R6tsplit_nevraR"RlRmRnR�RqR:RiRjRkR�RCRR)R<R|(RR�tnevraRuRB((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyRzs
(t__name__t
__module__taliasesRtsummaryRtstaticmethodRR.RCR?R3R0R2RRcRbReR{Rz(((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyR%s					!		
		(t
__future__RRtdnfpluginscoreRRtdnf.cli.option_parserRR)tdnf.clitdnf.exceptionstdnf.i18ntdnf.subjecttdnf.utilR6RR,RWtplugintregister_commandRtCommandR(((s8/usr/lib/python2.7/site-packages/dnf-plugins/download.pyt<module>s

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]