3 ft`@sRddlmZddlmZddlmZddlZdZdZGdddeZ d dd Z dS) )absolute_import)unicode_literals)_Nc@szeZdZdddZddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZifddZdS)TransactionWrapper/cCs@tj||_ddddddddd d d d d ddg|_g|_d|_dS)NZcheckorderZaddEraseZ addInstallZ addReinstallrunZpgpImportPubkeyZ pgpPrtPktsZproblemssetFlags setVSFlags setProbFilterZ hdrFromFdnonextZcleanT)rpmZTransactionSetts_methodstsflagsopen)selfrootr!/usr/lib/python3.6/transaction.py__init__s$ zTransactionWrapper.__init__cCs |jdS)N)close)rrrr__del__+szTransactionWrapper.__del__cCs |jr|jjd|_d|_dS)NF)rrZcloseDB)rrrrr/s zTransactionWrapper.closecOsLd|kr|jd}ng}|jj||}x |D]\}}}|j|||q,W|S)Npatterns)poprdbMatchpattern)rargskwdsrZmitagtpZpatrrrr5s zTransactionWrapper.dbMatchcCs ||jkr|j|St|dS)N)r getMethodAttributeError)rattrrrr __getattr__@s  zTransactionWrapper.__getattr__cCs|jS)N)r)rrrr__iter__FszTransactionWrapper.__iter__cCs t|j|S)N)getattrr)rmethodrrrr!IszTransactionWrapper.getMethodcCs"|jj||jj|jddS)N)rappendrr )rflagsrrr pushVSFlagsQs zTransactionWrapper.pushVSFlagscCs |jjd}|jj||BdS)Nr)rr )rflagcurflagsrrr addTsFlagUs zTransactionWrapper.addTsFlagcCs|jjd}|jj||S)Nr)rr )rr.rrr getTsFlagsYs  zTransactionWrapper.getTsFlagscCs|j}t||@S)N)r0bool)rr-valrrr isTsFlagSet^szTransactionWrapper.isTsFlagSetcCs|j|j_dS)N)filenorZscriptFd)rfdrrr setScriptFdbszTransactionWrapper.setScriptFdc Cs|j}|jtj|jddkr0|jjtj|jj|j d}|jj |g}|dk rx |D]\}\}}} |j |q^W|s|j t d|S)zetests the ts we've setup, takes a callback function and a conf dict for flags and what notZdiskspacecheckrNz(Errors occurred during test transaction.) r0r/r ZRPMTRANS_FLAG_TESTgetrr ZRPMPROB_FILTER_DISKSPACErcallbackr r*r) rcbZconfZ origflagsZtserrorsZ reserrorsZdescretypeZmountZneedrrrtestes  zTransactionWrapper.testN)r)__name__ __module__ __qualname__rrrrr$r%r!r,r/r0r3r6r<rrrrrs  rrcCs t|d}|jtjtjB|S)N)r)rr,r Z_RPMVSF_NOSIGNATURESZ_RPMVSF_NODIGESTS)rread_tsrrrinitReadOnlyTransaction{s rA)r) Z __future__rrZdnf.i18nrr r@robjectrrArrrr s   e