404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.224.64.51: ~ $
3

�gt`�,�@sjddlmZddlmZddlZddlmZddlZddlm	Z	Gdd�dej
�ZGdd	�d	ejj
�ZdS)
�)�absolute_import)�unicode_literalsN)�OptionParser)�_cs eZdZdZ�fdd�Z�ZS)�RepoDiff�repodiffcs,tt|�j||�|dkrdS|jt�dS)N)�superr�__init__Zregister_command�RepoDiffCommand)�self�base�cli)�	__class__��/usr/lib/python3.6/repodiff.pyr	$szRepoDiff.__init__)�__name__�
__module__�__qualname__�namer	�
__classcell__rr)rrr src@sLeZdZdZed�Zedd��Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZdS)r
rz1List differences between two sets of repositoriesc	Cs�|jddgddtd�d�|jddgdd	td
�d�|jddd
gtjdtd�d�|jdddtd�d�|jddtd�d�|jddtd�d�|jddtd�d�dS)Nz
--repo-oldz-o�append�oldz2Specify old repository, can be used multiple times)�default�action�dest�helpz
--repo-newz-n�newz2Specify new repository, can be used multiple timesz--archz
--archlistz-a�archeszhSpecify architectures to compare, can be used multiple times. By default, only source rpms are compared.z--sizez-s�
store_truez5Output additional data about the size of the changes.)rrz--compare-archzMCompare packages also by arch. By default packages are compared just by name.z--simplez7Output a simple one line message for modified packages.z--downgradezNSplit the data for modified packages between upgraded and downgraded packages.)�add_argumentrrZ_SplitCallback)�parserrrr�
set_argparser/s

zRepoDiffCommand.set_argparsercCs�|jj}d|_d|_d|_dg|jj_|jj	s:|jj
rNtd�}tj
j|��x<|jjj�D],}|j|jj	|jj
kr�|j�q\|j�q\W|jjs�dg|j_dS)NT�allz*Both old and new repositories must be set.�src)r
�demandsZsack_activationZavailable_repos�
changelogsrZconfZdisable_excludes�optsrrr�dnf�
exceptions�ErrorZreposr"�id�enable�disabler)rr$�msgZreporrr�	configureMs
zRepoDiffCommand.configurecCs|jjr|j|jfS|jS)N)r&�compare_archr�arch)r�pkgrrr�_pkgkey`szRepoDiffCommand._pkgkeyc
s6t�fdd�|D���t�j��}t�fdd�|D���t�j��}t�}x:|j|d�D]*}x$|j|jd�D]}||�j|�<qlWqXW�jjj}t�fdd�||D��fdd�||D�|ggd�}	xj|j	|�D]\}
�|
}�|
}|j
|j
kr�q�||j
|j
�d	k�r|	d
j||f�q�|	dj||f�q�W|	S)aNcompares packagesets old and new, returns dictionary with packages:
        added: only in new set
        removed: only in old set
        upgraded: in both old and new, new has bigger evr
        downgraded: in both old and new, new has lower evr
        obsoletes: dictionary of which old package is obsoleted by which new
        csg|]}�j|�|f�qSr)r2)�.0�p)rrr�
<listcomp>msz-RepoDiffCommand._repodiff.<locals>.<listcomp>csg|]}�j|�|f�qSr)r2)r3r4)rrrr5os)�	obsoletes)Zprovidescsg|]}�|�qSrr)r3�k)�new_drrr5zscsg|]}�|�qSrr)r3r7)�old_drrr5{s)�added�removedr6�upgraded�
downgradedrr=r<)�dict�set�keys�filterr6r2r�sack�evr_cmp�intersection�evrr)
rrrZold_keysZnew_keysr6Z	obsoleterZ	obsoletedrCrr7�pkg_old�pkg_newr)r8r9rr�	_repodiffes0
zRepoDiffCommand._repodiffc
sh�fdd��dd�}��fdd�}tddddd�}x<t|d	�D],}ttd
�j�|���|d	|j7<q@Wxjt|d�D]Z}ttd�j�|���|d
j�j|��}|r�ttd�j�|���|d|j7<q~W�jj	�r�|d�r:ttd��x<t|d�D],\}}|d|j|j7<|||��q
W|d�r�ttd��x�t|d�D],\}}|d|j|j7<|||��q^Wn\|d|d}	|	�r�ttd��x8t|	�D],\}}|d|j|j7<|||��q�Wttd��ttd�jt
|d	���ttd�jt
|d����jj	�rlttd�jt
|d���ttd�jt
|d���n&ttd�jt
|d�t
|d����jj�rdttd�j||d	���ttd�j||d����jj	�s�ttd�j||d|d���n4ttd�j||d���ttd�j||d���ttd�j||d	|d|d|d���dS) Ncs �jjrt|�Sd|j|jfS)Nz%s-%s)r&r/�strrrE)r1)rrr�pkgstr�sz'RepoDiffCommand._report.<locals>.pkgstrcSsXt|�}|dkr.|djtjjj|�j��7}n&|dkrT|djtjjj|�j��7}|S)Nrz ({})z (-{}))rI�formatr'r
Z
format_number�strip)Znumr-rrr�sizestr�sz(RepoDiffCommand._report.<locals>.sizestrcsBg}�jjr*|jd�|��|�f��n|jd�|jd�|��|�f�|jdt|d
��|jrv|jd}nd}x�|jD]�}|r�|d|dkr�Pn2|d|dkr�|d|dkr�|d|dkr�P|jd	|djd
�tjj|d�tjj|d�f�q�W�jj	�r0|jt
d�j|j	|j	��tdj
|��dS)Nz%s -> %s��-�rZ	timestampZauthor�textz
* %s %s
%sz%a %b %d %YzSize change: {} bytes�
���)r&Zsimpler�lenr%Zstrftimer'Zi18nZucd�sizerrK�print�join)rFrGZmsgsZ	old_chlogZchlog)rJrrr�report_modified�s2

z0RepoDiffCommand._report.<locals>.report_modifiedr)r:r;r<r=r:zAdded package  : {}r;zRemoved package: {}r6zObsoleted by   : {}r<z
Upgraded packagesr=z
Downgraded packagesz
Modified packagesz
SummaryzAdded packages: {}zRemoved packages: {}zUpgraded packages: {}zDowngraded packages: {}zModified packages: {}zSize of added packages: {}zSize of removed packages: {}zSize of modified packages: {}zSize of upgraded packages: {}zSize of downgraded packages: {}zSize change: {})r>�sortedrVrrKrU�getr2r&Z	downgraderT)
rrrMrXZsizesr1ZobsoletedbyrFrGZmodifiedr)rJrr�_report�sf










zRepoDiffCommand._reportcCs�|jjjtj�j|jjd�}|jjjtj�j|jjd�}|jj	rld|jj	krl|j
|jj	d�|j
|jj	d�|jjr�|j
dd�|j
dd�n|j
dd�|j
dd�|j�|j�|j
|j||��dS)N)Zreponame�*)r0rP)Zlatest_per_arch)Zlatest)rrBZquery�hawkeyZIGNORE_EXCLUDESrAr&rrrZfiltermr/Zapplyr[rH)rZq_newZq_oldrrr�run�szRepoDiffCommand.runN)r)
rrr�aliasesrZsummary�staticmethodr!r.r2rHr[r^rrrrr
+s&ar
)Z
__future__rrZdnf.clir'Zdnf.cli.option_parserrr]ZdnfpluginscorerZPluginrr
ZCommandr
rrrr�<module>s

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