Anons79 Mini Shell

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

�
	i/\c@@s�ddlmZddlmZddlZddlmZddlZddlm	Z	dej
fd��YZdejj
fd	��YZdS(
i(tabsolute_import(tunicode_literalsN(tOptionParser(t_tRepoDiffcB@seZdZd�ZRS(urepodiffcC@s:tt|�j||�|dkr)dS|jt�dS(N(tsuperRt__init__tNonetregister_commandtRepoDiffCommand(tselftbasetcli((s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pyR$s(t__name__t
__module__tnameR(((s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pyR sR	cB@sVeZdZed�Zed��Zd�Zd�Zd�Z	d�Z
d�ZRS(	urepodiffu1List differences between two sets of repositoriesc
C@s|jdddgdddddtd	��|jd
ddgdddddtd
��|jddddgdtjdddtd��|jdddddtd��|jddddtd��|jddddtd��|jddddtd��dS(Nu
--repo-oldu-otdefaulttactionuappendtdestuoldthelpu2Specify old repository, can be used multiple timesu
--repo-newu-nunewu2Specify new repository, can be used multiple timesu--archu
--archlistu-auarchesuhSpecify architectures to compare, can be used multiple times. By default, only source rpms are compared.u--sizeu-su
store_trueu5Output additional data about the size of the changes.u--compare-archuMCompare packages also by arch. By default packages are compared just by name.u--simpleu7Output a simple one line message for modified packages.u--downgradeuNSplit the data for modified packages between upgraded and downgraded packages.(tadd_argumentRRt_SplitCallback(tparser((s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pyt
set_argparser/s
!
!




cC@s�|jj}t|_t|_t|_dg|jj_|j	j
sS|j	jrttd�}t
jj|��nxP|jjj�D]<}|j|j	j
|j	jkr�|j�q�|j�q�W|j	js�dg|j	_ndS(Nuallu*Both old and new repositories must be set.usrc(RtdemandstTruetsack_activationtavailable_repost
changelogsRtconftdisable_excludestoptstnewtoldRtdnft
exceptionstErrortrepostalltidtenabletdisabletarches(R
Rtmsgtrepo((s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pyt	configureMs			
cC@s#|jjr|j|jfS|jS(N(Rtcompare_archRtarch(R
tpkg((s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pyt_pkgkey`scC@s�tg|D]}|j|�|f^q
�}t|j��}tg|D]}|j|�|f^qJ�}t|j��}t�}xM|jd|�D]9}	x0|jd|	j�D]}
|	||j|
�<q�Wq�W|jjj}tdg||D]}||^q�dg||D]}||^qd|dgdg�}
x�|j	|�D]~}||}||}|j
|j
kr�qUn||j
|j
�dkr�|
dj||f�qU|
d	j||f�qUW|
S(
uNcompares 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
        t	obsoletestprovidestaddedtremovedtupgradedt
downgradediu
downgradeduupgraded(tdictR1tsettkeystfilterR2Rtsacktevr_cmptintersectiontevrtappend(R
R!R tptold_dtold_keystnew_dtnew_keysR2t	obsoletert	obsoletedR=tktrepodifftpkg_oldtpkg_new((s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pyt	_repodiffes0..	!!	

c
	@s�fd��d�}��fd�}tdddddddd�}xEt|d	�D]3}td
�j�|��GH|d	c|j7<q\Wx�t|d�D]r}td�j�|��GH|d
j�j|��}|rtd�j�|��GHn|dc|j7<q�W�jjr�|dr�td�GHxHt|d�D]3\}}|dc|j|j7<|||�qLWn|drStd�GHxHt|d�D]3\}}|dc|j|j7<|||�q�WqSnj|d|d}	|	rStd�GHxDt|	�D]3\}}|dc|j|j7<|||�qWntd�GHtd�jt	|d	��GHtd�jt	|d��GH�jjr�td�jt	|d��GHtd�jt	|d��GHn,td�jt	|d�t	|d��GH�jjrtd�j||d	��GHtd�j||d��GH�jjs�td�j||d|d��GHn<td�j||d��GHtd�j||d��GHtd�j||d	|d|d|d��GHndS( Nc@s*�jjrt|�Sd|j|jfS(Nu%s-%s(RR.tstrRR?(R0(R
(s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pytpkgstr�s
cS@st|�}|dkrC|djtjjj|�j��7}n8|dkr{|djtjjj|�j��7}n|S(Niu ({})u (-{})(RMtformatR"Rt
format_numbertstrip(tnumR+((s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pytsizestr�s+,c
@s�g}�jjr8|jd�|��|�f�n[|jd�|jd�|��|�f�|jdt|d��|jr�|jd}nd}x�|jD]�}|r|d|dkr�Pq|d|dkr|d|dkr|d|dkrPqn|jd	|djd
�tjj	|d�tjj	|d�f�q�W�jj
r�|jtd�j|j
|j
��ndj
|�GHdS(
Nu%s -> %suu-i����iu	timestampuauthorutextu
* %s %s
%su%a %b %d %YuSize change: {} bytesu
(RtsimpleR@tlenRRtstrftimeR"ti18ntucdtsizeRROtjoin(RJRKtmsgst	old_chlogtchlog(RNR
(s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pytreport_modified�s2&
#		R4iR5R6R7uaddeduAdded package  : {}uremoveduRemoved package: {}u	obsoletesuObsoleted by   : {}uupgradedu
Upgraded packagesu
downgradedu
Downgraded packagesu
Modified packagesu
SummaryuAdded packages: {}uRemoved packages: {}uUpgraded packages: {}uDowngraded packages: {}uModified packages: {}uSize of added packages: {}uSize of removed packages: {}uSize of modified packages: {}uSize of upgraded packages: {}uSize of downgraded packages: {}uSize change: {}(
R8tsortedRRORYtgetR1Rt	downgradeRU(
R
RIRSR^tsizesR0tobsoletedbyRJRKtmodified((RNR
s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pyt_report�sf	!

! cC@s!|jjjtj�jd|jj�}|jjjtj�jd|jj�}|jj	r�d|jj	kr�|j
d|jj	�|j
d|jj	�n|jjr�|j
dd�|j
dd�n |j
dd�|j
dd�|j�|j�|j
|j||��dS(Ntreponameu*R/tlatest_per_architlatest(RR<tquerythawkeytIGNORE_EXCLUDESR;RR R!R*tfiltermR.tapplyReRL(R
tq_newtq_old((s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pytrun�s

(urepodiff(R
RtaliasesRtsummarytstaticmethodRR-R1RLReRp(((s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pyR	+s			&	a(t
__future__RRtdnf.cliR"tdnf.cli.option_parserRRjtdnfpluginscoreRtPluginRRtCommandR	(((s8/usr/lib/python2.7/site-packages/dnf-plugins/repodiff.pyt<module>s

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