Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/dnf-plugins/
Upload File :
Current File : //lib/python2.7/site-packages/dnf-plugins/debug.pyo

�
	i/\c@@sddlmZddlmZddlmZddlmZmZddlZddl	Zddl
Z
ddlZddlZddl
Z
ddlZddlZdZdejfd��YZd	ejjfd
��YZdejjfd��YZd
�Zd�Zd�ZdS(i(tabsolute_import(tunicode_literals(tucd(t_tloggerNudnf-debug-dump version 1
tDebugcB@seZdZd�ZRS(udebugcC@satt|�j||�||_||_|jdk	r]|jjt�|jjt�ndS(N(	tsuperRt__init__tbasetclitNonetregister_commandtDebugDumpCommandtDebugRestoreCommand(tselfRR	((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR)s		(t__name__t
__module__tnameR(((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR%sRcB@szeZdZed�Zd�Zd�Zed��Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�ZRS(
u
debug-dumpu5dump information about installed rpm packages to filecC@s#tt|�j|�d|_dS(N(RRRR
t	dump_file(RR	((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR7scC@s"t|jj_t|jj_dS(N(tTrueR	tdemandstsack_activationtavailable_repos(R((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyt	configure;sc	C@sH|jddddtdtd��|jddd	dtd
��dS(Nu	--norepostactionu
store_truetdefaultthelpu/do not attempt to dump the repository contents.ufilenametnargsu?uoptional name of dump file(tadd_argumenttFalseR(tparser((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyt
set_argparser?s
cC@s|jj}|sPtjdtjtj���}dtj�d|f}ntjj|�}|j	d�r�t
j|d�|_nt
|d�|_|jt�|j�|j�|j�|j|jj�|j�|jj�td�|GHdS(u{create debug txt file and compress it, if no filename specified
           use dnf_debug_dump-<timestamp>.txt.gz by defaultu%Y-%m-%d_%Tudnf_debug_dump-%s-%s.txt.gziu.gzuwuOutput written to: %sN(toptstfilenamettimetstrftimet	localtimetostunametpathtabspathtendswithtgziptGzipFileRtopentwritet
DEBUG_VERSIONtdump_system_infotdump_dnf_config_infotdump_rpm_problemst
dump_packagestnorepostdump_rpmdb_versionstcloseR(RR!tnow((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pytrunHs !





cC@sMtjjr3t|jtj�r3t|d�}ntjj|j|�dS(Nuutf8(	tdnftpycomptPY3t
isinstanceRR*R+tbytest
write_to_file(Rtmsg((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR-as!cC@sp|jd�tj�}|jd|d|df�|jdtj�|jdtjjdd��dS(	Nu%%%%SYSTEM INFO
u  uname: %s, %s
iiu  rpm ver: %s
u  python ver: %s
u
u(R-R%R&trpmt__version__tsystversiontreplace(RR&((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR/fs
 cC@s�|jjj}djg|jjjD]}|j^q%�}|jd�|jd|d�|jd|d�|jd|d�|jd	tj	j
�|jd
|�|jddj|jjj��dS(Nu,u
%%%%DNF INFO
u  arch: %s
uarchu  basearch: %s
ubasearchu  releasever: %s
u
releaseveru  dnf ver: %s
u  enabled plugins: %s
u  global excludes: %s
(Rtconft
substitutionstjoint_pluginstpluginsRR-R8tconsttVERSIONtexcludepkgs(RtvartpRH((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR0ns.
#cC@s�|jd�t|j�\}}|jdjg|D](\}}dt|�t|�f^q5��|jdjg|D](\}}dt|�t|�f^qz��dS(Nu%%%%RPMDB PROBLEMS
uuPackage %s requires %s
uPackage %s conflicts with %s
(R-trpm_problemsRRFR(Rtmissingt	conflictstreqtpkgRD((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR1zs
6c	C@s�|jjj�}|jd�x1t|j��D]}|jdt|��q2W|s]dS|jd�|j�}x>t|jjj	�dd��D]}y�d}|jdk	r�|j}n@|jdk	r�|j}n%t
|j�dkr|jd}n|jd|j|f�|jdd	j|j��x:t|jd
|j��D]}|jdt|��qUWWq�tjjk
r�}|jd|t|�f�q�q�Xq�WdS(Nu
%%%%RPMDB
u  %s
u
%%%%REPOS
tkeycS@s|jS(N(tid(tx((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyt<lambda>�siu
%%%s - %s
u  excludes: %s
u,treponameuError accessing repo %s: %s
(RtsacktqueryR-tsortedt	installedtpkgspect	availabletrepostiter_enabledR
tmetalinkt
mirrorlisttlentbaseurlRTRFRKtfilterR8t
exceptionstErrortstr(	Rt
load_repostqRMR]trepoturltpote((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR2�s2

("cC@s4|jd�|jjj�}|jd|�dS(Nu%%%%RPMDB VERSIONS
u
  all: %s
(R-RRXt_rpmdb_version(RRB((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR4�s
(u
debug-dump(RRtaliasesRtsummaryRRtstaticmethodRR7R-R/R0R1R2R4(((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR2s										R
cB@s\eZdZed�Zd�Zed��Zd�Zd�Z	d�Z
ed��ZRS(	u
debug-restoreu,restore packages recorded in debug-dump filecC@s1t|jj_t|jj_t|jj_dS(N(RR	RRRt	root_user(R((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR�sc	C@s�|jddddtd��|jddddtd��|jddddtd	��|jd
ddd
ddtd��|jddddtd��dS(Nu--outputRu
store_trueRu,output commands that would be run to stdout.u--install-latestu0Install the latest version of recorded packages.u
--ignore-archu_Ignore architecture and install missing packages matching the name, epoch, version and release.u--filter-typestmetavaru[install, remove, replace]Ruinstall, remove, replaceulimit to specified typeufilenameRiuname of dump file(RR(R((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR�s



cC@s�|jjr9t|jjjdd�j��|j_n|jjj�j�}|j	|jj
d�}|j|||j�|j||j�|jj
s�|jj�|jj�ndS(u Execute the command action here.u,u iN(R tfilter_typestsetRCtsplitRRXRYR[tread_dump_fileR!tprocess_installedtprocess_dumptoutputtresolvetdo_transaction(RR[t	dump_pkgs((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR7�s*
c	C@s0x)t|�D]}t}t|�}|j|j|jfddddddg�\}}}	}
}}||	|
||f}
|j|
kr�||j|jf=q
|dkr�d||j|jfd<d|jkr�t	}q�nd|jkr�t	}n|s
|j
rd|GHq(|jj|�q
q
WdS(Nuinstallureplaceiuremoveuremove    %s(
RZRR\tgetRtarchR
tpkgtupRtRRzRtpackage_remove(RR[R}R RRtfilteredtspecRtdntdatdetdvtdrt
dump_naevr((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyRx�s&	$		cC@s3x,t|j��D]\}}}}}}t}	|jrCd}
n
d|}
|jr�|dkr�d||
f}d|jkr�t}	q�n<t||
|||�}|dkr�d|jkr�t}	n|	s|jr�d|GHq+y|j	j
|�Wq+tjj
k
r'tjtd�|�q+XqqWdS(Nuu.uinstallu%s%sureplaceuinstall   %suPackage %s is not available(RZtvaluesRtignore_archtinstall_latestRtRtpkgtup2specRzRtinstallR8RetMarkingErrorRterrorR(RR}R RtntaRmtvtrR�Rtpkg_spec((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyRy�s(+		
		c	C@sC|jd�r!tj|�}nt|�}t|j��tkrjtjt	d�|�t
jj�nt
}i}x�|D]�}t|�}|r�|dkr}t}q}q}n|s�|ddkr�Pn|j�}tj|�}dt|j�t|j�t|j�t|j�t|j�g||j|jf<q}W|S(Nu.gzuBad dnf debug file: %su
%%%%RPMDB
iu uinstall(R)R*R+R,RtreadlineR.RR�RR8ReRfRRtstripthawkeytsplit_nevraRRtepochRBtrelease(R!tfobjtskiptpkgstlineR�tnevra((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyRw
s0
	&(u
debug-restore(RRRoRRpRRqRR7RxRyRw(((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR
�s				c
C@s:tjj|�}|j�j�}t�}t�}x�|D]�}|jg|jD];}t|�dkrSt|�j	d�rS||f^qS�|jg|j
D]}||f^q��q=Wg|D]*\}}|jd|�s�||f^q�}g|D]*\}}|jd|�r||f^q}	||	fS(Nusolvable:prereqmarkerurpmlib(tprovides(R8RXt_rpmdb_sackRYR[RutupdatetrequiresRgt
startswithRPRd(
RtrpmdbtallpkgsR�RPRRRQRDtmissing_requirestexisting_conflicts((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyRN,s		
)-$$cC@s%t|j|j|j|j|j�S(N(R�RRR�RBR�(RR((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR\?scC@sI|sdnd|}|dkr(dnd|}d|||||fS(Nuu.%su%s:u%s-%s%s-%s%s(Nu(R
(RRR�RBR�R�Rm((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyR�Cs(t
__future__RRtdnf.i18nRtdnfpluginscoreRRR8tdnf.cliR*R�R%R?RAR"R.tPluginRR	tCommandRR
RNR\R�(((s5/usr/lib/python2.7/site-packages/dnf-plugins/debug.pyt<module>s$
w�		

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