a &c, @ 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| || |d u rd S |t d S N)superr __init__Zregister_commandRepoDiffCommand)selfbasecli __class__ 8/usr/lib/python3.9/site-packages/dnf-plugins/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 r6| jj sJtd}tj || jj D ],}|j| jj | jj v rz| qV| qV| 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&