a !cd@sddlmZddlmZddlmZddlZddlZddlmZddlZ ddl Z dZ dZ de e fZ Gddde jjZGd d d e jjZGd d d eZd dZddZGdddeZdS))absolute_import)print_function)unicode_literalsN)_%s.%scseZdZfddZZS)TransactionErrorcstt||dSN)superr__init__)selfmsg __class__6/usr/lib/python3.9/site-packages/dnf/transaction_sr.pyr /szTransactionError.__init____name__ __module__ __qualname__r __classcell__rrr rr.srcseZdZfddZZS)TransactionReplayErrorcsr||_t|ttfr||_n|g|_|r:tdj|d}ntd}|jD]}|dt|7}qHtt | |dS)z :param filename: The name of the transaction file being replayed :param errors: a list of error classes or a string with an error description zWThe following problems occurred while replaying the transaction from file "{filename}":)filenamez :returns: the loaded data of the transaction )r`r rrrget_dataszTransactionReplay.get_datacCs|jS)zW :returns: an array of warnings gathered during the transaction replay )rTrrrr get_warnings szTransactionReplay.get_warningsc Cs|j}g}|jD]B}z||WqtyP}z||WYd}~qd}~00q|jD]}z|d}|d}ztj|d}WnHtj j y}z,|tt |WYd}~WqZWYd}~n d}~00|dkr| |||dnv|dkr | |||dnX|dkr*||||dn:|d krH||||dn|ttd j||d WqZty}z,|ttd j|jd dWYd}~qZd}~0ty}z||WYd}~qZd}~00qZ|jD]} z | d}| d} ztj| d}WnLtj j y^}z.|tt |WYd}~WqWYd}~n d}~00|dkr~|| || dnv|dkr|| || dnX|dkr|| || dn:|d kr|| || dn|ttdj|| dWntty<}z,|ttdj|jd dWYd}~n8d}~0tyj}z||WYd}~n d}~00q|rt||dS)z* Replays the transaction. Nr*r.r0rrr/rsrxrvz@Unexpected value of group action "{action}" for group "{group}".)r*rAz&Missing object key "{key}" in a group.rrjr4zJUnexpected value of environment action "{action}" for environment "{env}".)r*rDz-Missing object key "{key}" in an environment.)rKrcrrr:rer<r=rrrrrrrrrrryrzrfrrrrr) r r]rrr(rBr*rrrErrrrruns " $    " &     $zTransactionReplay.runc Cs>|jjs dSg}|jjD] }z |j}Wn0tyX}zWYd}~qWYd}~n d}~00t|}||jvr|jr|jtjj tjj tjj fvrt dj |d}|js|t|n |j|z>|j|}|jtjjtjjfvstj||jdkr||_Wqty$}z WYd}~qd}~00q|r:t|j|dS)z Sets reasons in the transaction history to values from the stored transaction. Also serves to check whether additional packages were pulled in by the transaction, which results in an error (unless ignore_extras is True). NzgPackage nevra "{nevra}", which is not present in the transaction file, was pulled into the transaction.rnr)rJr=rCryrrRrLr*r<ZTransactionItemAction_UPGRADEDZ TransactionItemAction_DOWNGRADEDZ!TransactionItemAction_REINSTALLEDrrrMr:rrTrSZTransactionItemAction_INSTALLZTransactionItemAction_REMOVEZTransactionItemReasonComparer,rrK)r rr@rCr(r+r Z replay_reasonrrrpost_transaction`sD "     z"TransactionReplay.post_transaction)rINFFF)rrr__doc__r rUrVrgrdrarrrrrrrrrrrrrrrrrrrrHs6  '   a   (   OrH)Z __future__rrrr<r|Zdnf.i18nrZdnf.exceptionsrrZr&Z VERSION_MINORr8 exceptionsrrrrr)rGobjectrHrrrrs     K