3 gt`, @ sj d dl mZ d dl mZ d dlZd dlmZ d dlZd dlm Z G dd dej ZG dd d ejj ZdS ) )absolute_import)unicode_literalsN)OptionParser)_c s e Zd ZdZ fddZ ZS )RepoDiffrepodiffc s, t t| j|| |d krd S |jt d S )N)superr __init__Zregister_commandRepoDiffCommand)selfbasecli) __class__ /usr/lib/python3.6/repodiff.pyr $ s zRepoDiff.__init__)__name__ __module____qualname__namer __classcell__r r )r r r s r c @ sL e Zd ZdZedZedd Zdd Zdd Z d d Z dd Zd d ZdS )r r z1List differences between two sets of repositoriesc C s | j ddg ddtdd | j ddg dd td d | j ddd g tjdtdd | j dddtdd | j ddtdd | j ddtdd | j ddtdd d S )Nz --repo-oldz-oappendoldz2Specify old repository, can be used multiple times)defaultactiondesthelpz --repo-newz-nnewz2Specify new repository, can be used multiple timesz--archz --archlistz-aarcheszhSpecify 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.)r r z--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_argumentr r Z_SplitCallback)parserr r r set_argparser/ s zRepoDiffCommand.set_argparserc C s | j j}d|_d|_d|_dg| jj_| jj s:| jj rNtd}tj j|x<| jjj D ],}|j| jj | jj kr|j q\|j q\W | jjsdg| j_d S )NTallz*Both old and new repositories must be set.src)r demandsZsack_activationZavailable_repos changelogsr ZconfZdisable_excludesoptsr r r dnf exceptionsErrorZreposr" idenabledisabler )r r$ msgZrepor r r configureM s zRepoDiffCommand.configurec C s | j jr|j|jfS |jS )N)r&