3 ft` @sddlmZddlmZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z ejdZGdddejZd d Zd d Zd dZdS))absolute_import)unicode_literalsN) basestring)_dnfcs0eZdZfddZd ddZd ddZZS) Sackcstt|j||dS)N)superr__init__)selfargskwargs) __class__/usr/lib/python3.6/sack.pyr %sz Sack.__init__NrcCs8|r ||_||_|dk r4||_|dkr4tjtddS)NFznallow_vendor_change is disabled. This option is currently not supported for downgrade and distro-sync commands) installonlyinstallonly_limitallow_vendor_changeloggerZwarningr)r rrrrrr _configure(szSack._configurecCstjj||S)z'Factory function returning a DNF Query.)rqueryZQuery)r flagsrrrr1sz Sack.query)NrN)r)__name__ __module__ __qualname__r rr __classcell__rr)r rr"s  rc CsT|jj}tjj|ttjj||jjd||jj t j j |jj tjj|jjdkdS)Narch )ZpkgclsZ pkginitvalrcachedirZrootdirZlogfileZlogdebug)ZconfrrutilZ ensure_dirrpackageZPackageZ substitutionsZ installrootospathjoinZlogdirconstZ LOG_HAWKEYZ logfilelevel)baserrrr _build_sack7s   r%c Cs2t|}y|jddWntk r,YnX|S)NF)Z build_cache)r%Zload_system_repoIOError)r$Zsackrrr _rpmdb_sackBs r'cCst|S)z Returns a new instance of sack containing only installed packages (@System repo) Useful to get list of the installed RPMs after transaction. )r')r$rrr rpmdb_sackMsr()Z __future__rrZdnf.utilrZ dnf.packageZ dnf.queryZloggingZhawkeyr Z dnf.pycomprZdnf.i18nrZ getLoggerrrr%r'r(rrrrs