404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.224.30.237: ~ $
3

�gt`1�@s�ddlmZddlmZddlmZddlmZmZddlZddl	Zddl
Z
ddlZddlZddl
Z
ddlZddlZdZGdd�dej�ZGd	d
�d
ejj�ZGdd�dejj�Zd
d�Zdd�Zdd�ZdS)�)�absolute_import)�unicode_literals)�ucd)�_�loggerNzdnf-debug-dump version 1
cs eZdZdZ�fdd�Z�ZS)�Debug�debugcsDtt|�j||�||_||_|jdk	r@|jjt�|jjt�dS)N)�superr�__init__�base�cliZregister_command�DebugDumpCommand�DebugRestoreCommand)�selfrr)�	__class__��/usr/lib/python3.6/debug.pyr
)s
zDebug.__init__)�__name__�
__module__�__qualname__�namer
�
__classcell__rr)rrr%srcsteZdZdZed�Z�fdd�Zdd�Zedd��Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Z�ZS)r
�
debug-dumpz5dump information about installed rpm packages to filecstt|�j|�d|_dS)N)r	r
r
�	dump_file)rr)rrrr
7szDebugDumpCommand.__init__cCsd|jj_d|jj_dS)NT)r�demands�sack_activation�available_repos)rrrr�	configure;s
zDebugDumpCommand.configurecCs.|jdddtd�d�|jddtd�d	�dS)
Nz	--norepos�
store_trueFz/do not attempt to dump the repository contents.)�action�default�help�filename�?zoptional name of dump file)�nargsr!)�add_argumentr)�parserrrr�
set_argparser?szDebugDumpCommand.set_argparsercCs�|jj}|s6tjdtjtj���}dtj�d|f}tjj|�}|j	d�r\t
j|d�|_nt
|d�|_|jt�|j�|j�|j�|j|jj�|j�|jj�ttd�|�dS)z{create debug txt file and compress it, if no filename specified
           use dnf_debug_dump-<timestamp>.txt.gz by defaultz%Y-%m-%d_%Tzdnf_debug_dump-%s-%s.txt.gz�z.gz�wzOutput written to: %sN)�optsr"�timeZstrftimeZ	localtime�os�uname�path�abspath�endswith�gzip�GzipFiler�open�write�
DEBUG_VERSION�dump_system_info�dump_dnf_config_info�dump_rpm_problems�
dump_packagesZnorepos�dump_rpmdb_versions�close�printr)rr"Znowrrr�runHs 


zDebugDumpCommand.runcCs4tjjr t|jtj�r t|d�}tjj|j|�dS)N�utf8)	�dnfZpycompZPY3�
isinstancerr1r2�bytesZ
write_to_file)r�msgrrrr4as
zDebugDumpCommand.writecCsX|jd�tj�}|jd|d|df�|jdtj�|jdtjjdd��dS)	Nz%%%%SYSTEM INFO
z  uname: %s, %s
��z  rpm ver: %s
z  python ver: %s
�
�)r4r,r-�rpm�__version__�sys�version�replace)rr-rrrr6fs
z!DebugDumpCommand.dump_system_infocCs�|jjj}djdd�|jjjD��}|jd�|jd|d�|jd|d�|jd	|d
�|jdtjj	�|jd|�|jd
dj|jjj
��dS)N�,cSsg|]
}|j�qSr)r)�.0�prrr�
<listcomp>psz9DebugDumpCommand.dump_dnf_config_info.<locals>.<listcomp>z
%%%%DNF INFO
z  arch: %s
�archz  basearch: %s
Zbasearchz  releasever: %s
Z
releaseverz  dnf ver: %s
z  enabled plugins: %s
z  global excludes: %s
)r�confZ
substitutions�joinZ_plugins�pluginsr4r?�const�VERSION�excludepkgs)r�varrSrrrr7ns

z%DebugDumpCommand.dump_dnf_config_infocCsP|jd�t|j�\}}|jdjdd�|D���|jdjdd�|D���dS)Nz%%%%RPMDB PROBLEMS
rFcSs$g|]\}}dt|�t|�f�qS)zPackage %s requires %s
)r)rM�req�pkgrrrrO}sz6DebugDumpCommand.dump_rpm_problems.<locals>.<listcomp>cSs$g|]\}}dt|�t|�f�qS)zPackage %s conflicts with %s
)r)rMrQrYrrrrOs)r4�rpm_problemsrrR)rZmissing�	conflictsrrrr8zs
z"DebugDumpCommand.dump_rpm_problemsc	Cs\|jjj�}|jd�x&t|j��D]}|jdt|��q$W|sFdS|jd�|j�}x�t|jjj	�dd�d�D]�}y�d}|j
dk	r�|j
}n*|jdk	r�|j}nt|j
�dkr�|j
d}|jd|j|f�|jd	d
j|j��x,t|j|jd��D]}|jdt|��q�WWqrtjjk
�rR}z|jd|t|�f�wrWYdd}~XqrXqrWdS)
Nz
%%%%RPMDB
z  %s
z
%%%%REPOS
cSs|jS)N)�id)�xrrr�<lambda>�sz0DebugDumpCommand.dump_packages.<locals>.<lambda>)�keyrz
%%%s - %s
z  excludes: %s
rL)ZreponamezError accessing repo %s: %s
)r�sack�queryr4�sorted�	installed�pkgspec�	availableZreposZiter_enabledZmetalinkZ
mirrorlist�lenZbaseurlr\rRrV�filterr?�
exceptions�Error�str)	rZ
load_repos�qrNreZrepoZurlZpo�errrr9�s2




zDebugDumpCommand.dump_packagescCs(|jd�|jjj�}|jd|�dS)Nz%%%%RPMDB VERSIONS
z
  all: %s
)r4rr`Z_rpmdb_version)rrJrrrr:�s
z$DebugDumpCommand.dump_rpmdb_versions)r)rrr�aliasesr�summaryr
r�staticmethodr'r=r4r6r7r8r9r:rrr)rrr
2s		r
c@sPeZdZdZed�Zdd�Zedd��Zdd�Z	d	d
�Z
dd�Zed
d��ZdS)r�
debug-restorez,restore packages recorded in debug-dump filecCs4d|jj_d|jj_d|jj_|jjs0d|jj_dS)NT)rrrrZ	root_userr*�outputZ	resolving)rrrrr�s



zDebugRestoreCommand.configurecCs~|jddtd�d�|jddtd�d�|jddtd�d�|jd	d
dtd�d
�|jddtd�d�|jddtd�d�dS)Nz--outputrz,output commands that would be run to stdout.)rr!z--install-latestz0Install the latest version of recorded packages.z
--ignore-archz_Ignore architecture and install missing packages matching the name, epoch, version and release.z--filter-typesz[install, remove, replace]zinstall, remove, replacezlimit to specified type)�metavarr r!z--remove-installonlyzqAllow removing of install-only packages. Using this option may result in an attempt to remove the running kernel.r"r(zname of dump file)r$r!)r%r)r&rrrr'�s$z!DebugRestoreCommand.set_argparsercCsV|jjr$t|jjjdd�j��|j_|j|jjd�}|j||j�|j||j�dS)z Execute the command action here.rL� rN)	r*�filter_types�setrK�split�read_dump_filer"�process_installed�process_dump)r�	dump_pkgsrrrr=�szDebugRestoreCommand.runcCs�|jjj�j�}|jj|�}x�|D]�}d}t|�}|j|j|jfd�}|dk	r�|j	|j
|jf}	|	|krpd||	<q�||kr~d}q�d|jkr�d}
nd}
x|j
�D]}|
||<q�Wnd}|r"d|jkr"||ks�|jr"|jr�td|�q"|jj|�q"WdS)NF�skipTrK�removezremove    %s)rr`rarcZ_get_installonly_queryrd�getrrP�epochrJ�releasert�keysZremove_installonlyrqr<Zpackage_remove)rrzr*rcZinstallonly_pkgsrYZ
pkg_remove�spec�dumped_versionsZevrrZd_evrrrrrx�s.


z%DebugRestoreCommand.process_installedc
Cs�x�t|j��D]�\}}|||f}x�t|j��D]�\}}}||||f}	|	dkrRq0|jr^d}
nd|}
|jr�|	dkr�d||
f}nt||
|||�}|	|jkr0|jr�td|	|f�q0y|jj	|�Wq0t
jjk
r�t
jtd�|�Yq0Xq0WqWdS)Nr{rF�.�installz%s%sz%s   %szPackage %s is not available)rbr�Zignore_archZinstall_latest�pkgtup2specrtrqr<rr�r?rhZMarkingErrorr�errorr)rrzr*�n�ar�rl�v�rrrP�pkg_specrrrry�s&
z DebugRestoreCommand.process_dumpcCs�|jd�rtj|�}nt|�}t|j��tkrFtjt	d�|�t
jj�d}i}xp|D]h}t|�}|rr|dkrTd}qT|s�|ddkr�P|j
�}tj|�}d|j|j|jfi�|j|j|jf<qTW|S)	Nz.gzzBad dnf debug file: %sTz
%%%%RPMDB
Frrsr�)r0r1r2r3r�readliner5rr�rr?rhri�strip�hawkeyZsplit_nevra�
setdefaultrrPr~rJr)r"Zfobjr{Zpkgs�liner�Znevrarrrrws(


(z"DebugRestoreCommand.read_dump_fileN)rp)
rrrrmrrnrror'r=rxryrwrrrrr�s#rcs�tjj|�}|j�j��t�}t�}x@�D]8�|j�fdd��jD��|j�fdd��jD��q*W�fdd�|D�}�fdd�|D�}||fS)Ncs2g|]*}t|�dkrt|�jd�r|�f�qS)zsolvable:prereqmarkerzrpmlib()rj�
startswith)rMrX)rYrrrO:sz rpm_problems.<locals>.<listcomp>csg|]}|�f�qSrr)rMrQ)rYrrrO=scs$g|]\}}�j|d�s||f�qS))�provides)rg)rMrXrY)�allpkgsrrrO?scs$g|]\}}�j|d�r||f�qS))r�)rg)rMrQrY)r�rrrOAs)	r?r`Z_rpmdb_sackrarcru�update�requiresr[)rZrpmdbr�r[Zmissing_requiresZexisting_conflictsr)r�rYrrZ3s
rZcCst|j|j|j|j|j�S)N)r�rrPr~rJr)rYrrrrdFsrdcCs<|sdnd|jd�}|dkr"dnd|}d|||||fS)NrFz.%sr�z%s:z%s-%s%s-%s%s)NrF)�lstrip)rrPr~rJrr�rlrrrr�Jsr�)Z
__future__rrZdnf.i18nrZdnfpluginscorerrr?Zdnf.clir1r�r,rGrIr+r5ZPluginrrZCommandr
rrZrdr�rrrr�<module>s&
w

Filemanager

Name Type Size Permission Actions
builddep.cpython-36.opt-1.pyc File 7.27 KB 0644
builddep.cpython-36.pyc File 7.27 KB 0644
changelog.cpython-36.opt-1.pyc File 4.08 KB 0644
changelog.cpython-36.pyc File 4.08 KB 0644
config_manager.cpython-36.opt-1.pyc File 7.09 KB 0644
config_manager.cpython-36.pyc File 7.09 KB 0644
copr.cpython-36.opt-1.pyc File 20.2 KB 0644
copr.cpython-36.pyc File 20.2 KB 0644
debug.cpython-36.opt-1.pyc File 10.56 KB 0644
debug.cpython-36.pyc File 10.56 KB 0644
debuginfo-install.cpython-36.opt-1.pyc File 5.93 KB 0644
debuginfo-install.cpython-36.pyc File 5.93 KB 0644
download.cpython-36.opt-1.pyc File 9.29 KB 0644
download.cpython-36.pyc File 9.29 KB 0644
generate_completion_cache.cpython-36.opt-1.pyc File 3 KB 0644
generate_completion_cache.cpython-36.pyc File 3 KB 0644
groups_manager.cpython-36.opt-1.pyc File 8.45 KB 0644
groups_manager.cpython-36.pyc File 8.45 KB 0644
needs_restarting.cpython-36.opt-1.pyc File 9.88 KB 0644
needs_restarting.cpython-36.pyc File 9.88 KB 0644
repoclosure.cpython-36.opt-1.pyc File 4.31 KB 0644
repoclosure.cpython-36.pyc File 4.31 KB 0644
repodiff.cpython-36.opt-1.pyc File 7.55 KB 0644
repodiff.cpython-36.pyc File 7.55 KB 0644
repograph.cpython-36.opt-1.pyc File 2.72 KB 0644
repograph.cpython-36.pyc File 2.72 KB 0644
repomanage.cpython-36.opt-1.pyc File 6.37 KB 0644
repomanage.cpython-36.pyc File 6.37 KB 0644
reposync.cpython-36.opt-1.pyc File 10.19 KB 0644
reposync.cpython-36.pyc File 10.19 KB 0644
spacewalk.cpython-36.opt-1.pyc File 9.79 KB 0644
spacewalk.cpython-36.pyc File 9.79 KB 0644
system_upgrade.cpython-36.opt-1.pyc File 22.48 KB 0644
system_upgrade.cpython-36.pyc File 22.48 KB 0644
universal_hooks.cpython-36.opt-1.pyc File 5.86 KB 0644
universal_hooks.cpython-36.pyc File 5.86 KB 0644