ó ¾[/\c@sødZddlmZddlmZddlZddlmZddlmZm Z ddl Z ddl Z ddl Z ddlZ ddlZ ddlZ ddlZ ddlZ ddlZ ddlZddlZddlZddlZejdƒZedƒd Zed ƒd Zed ƒZd „Zfd„Zdefd„ƒYZdefd„ƒYZ de fd„ƒYZ!defd„ƒYZ"defd„ƒYZ#defd„ƒYZ$defd„ƒYZ%defd„ƒYZ&dS(u< Classes for subcommands of the yum command line interface. iÿÿÿÿ(tprint_function(tunicode_literalsN(t OptionParser(t_tucdudnfu+To diagnose the problem, try running: '%s'.urpm -Va --nofiles --nodigestuDYou probably have corrupted RPMDB, running '%s' might fix the issue.urpm --rebuilddbu You have enabled checking of packages via GPG keys. This is a good thing. However, you do not have any GPG public keys installed. You need to download the keys for packages you wish to install and install them. You can do that by running the command: rpm --import public.gpg.key Alternatively you can specify the url to the key you would like to use for a repository in the 'gpgkey' option in a repository section and DNF will install it for you. For more information contact your distribution or package provider.cCsŽ|jjsdS|jƒsŠxk|jjƒD]W}|jsD|jr,|j r,tjdt ƒtjt dƒ|ƒt j j ‚q,q,WndS(uªVerify that there are gpg keys for the enabled repositories in the rpm database. :param base: a :class:`dnf.Base` object. :raises: :class:`cli.CliError` Nu %s uProblem repository: %s(tconftgpgcheckt_gpg_key_checktrepost iter_enabledt repo_gpgchecktgpgkeytloggertcriticaltgpg_msgRtdnftclitCliError(tbaseRtrepo((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt _checkGPGKeyCs  cCs”|jjƒrdSx\|D]T}|jdƒrEtjj|ƒrEdStjjj|ƒd}|d krdSqWt dƒ}tj j |ƒ‚dS( uÖVerify that there is at least one enabled repo. :param base: a :class:`dnf.Base` object. :param possible_local_files: the list of strings that could be a local rpms :raises: :class:`cli.CliError`: Nu.rpmiuhttpuftpufileuhttpsuThere are no enabled repos.(uhttpuftpufileuhttps( Rt _any_enabledtendswithtostpathtexistsRtpycompturlparseRRR(Rtpossible_local_filestlfiletschemetmsg((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt_checkEnabledRepoTs !  tCommandcBsŒeZdZgZdZd Zd„Zed„ƒZ ed„ƒZ ed„ƒZ d„Z d„Z d„Zd „Zd „Zd „ZRS( u%Abstract base class for CLI commands.ucCs ||_dS(N(R(tselfR((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt__init__pscCs |jjS(N(RR(R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRtscCs |jdS(Ni(taliases(R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt_basecmdyscCs |jjjS(N(RRtoutput(R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR&}scCsdS(u4Define command specific options and arguments. #:apiN((R"tparser((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt set_argparserscCsdS(u*Do any command-specific pre-configuration.N((R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt pre_configure…scCsdS(u&Do any command-specific configuration.N((R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt configureŠscCs3t|tjjƒrttfStd|ƒ‚dS(u.Get suggestions for resolving the given error.uerror not supported yet: %sN(t isinstanceRt exceptionstTransactionCheckErrort _RPM_VERIFYt_RPM_REBUILDDBtNotImplementedError(R"terror((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pytget_error_outputs cCsdS(uExecute the command.N((R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pytrun•scCsdS(u%Finalize operations post-transaction.N((R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pytrun_transactionšsN(t__name__t __module__t__doc__R$tsummarytNonetoptsR#tpropertyRR%R&R(R)R*R2R3R4(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR!is      t InfoCommandc BsheZdZdZedƒZdZdddddd d d eh Zed „ƒZ d „Z d„Z RS(uRA class containing methods needed by the cli to execute the info command. uinfou4display details about a package or group of packagesuallu availableu installeduextrasuupdatesuupgradesu autoremoveurecentu obsoletesc Cs¨|jƒ}|jdddddddddd td ƒƒ|jd dddddd d td ƒƒ|jdddddddd tdƒƒ|jdddddddd tdƒƒ|jdddddddd tdƒƒ|jdddddddd tdƒƒ|jdddddddd tdƒƒ|jdddddddd tdƒƒ|jddd d!td"ƒd#|jd|jdtjƒdS($Nu--alltdestu_packages_actiontactionu store_consttconstualltdefaultthelpushow all packages (default)u --availableu availableushow only available packagesu --installedu installedushow only installed packagesu--extrasuextrasushow only extras packagesu --updatesuupgradesushow only upgrades packagesu --upgradesu --autoremoveu autoremoveushow only autoremove packagesu--recenturecentu#show only recently changed packagesupackagestnargsu*tmetavaruPACKAGEtchoices(tadd_mutually_exclusive_groupt add_argumentR9Rt pkgnarrowstDEFAULT_PKGNARROWRtPkgNarrowCallback(tclsR'tnarrows((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR(©s8                cCsÉ|jj}t|_t|_|jjr?|jj|j_n|jjdkr]t|_ n|jj r¤|jjr•|jj dd|jjƒq¤d|j_n|jjdkrÅd|j_ndS(Nu installedu --obsoletesu--u obsoletesuupdatesuupgrades( RtdemandstFalsetfresh_metadatatTruetsack_activationR:t_packages_actiontpackages_actiontavailable_repost obsoletest_option_conflict(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*Ès        cCsD|jj|j|jjjƒƒ|jjd|jj|jjƒS(Nuinfo( Rt _populate_update_security_filterR:Rtsacktquerytoutput_packagesRRtpackages(R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR3Øs"(uinfo( R5R6R7R$RR8RHRGt classmethodR(R*R3(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR<žs  t ListCommandcBs)eZdZdZedƒZd„ZRS(uRA class containing methods needed by the cli to execute the list command. ulistu$list a package or groups of packagescCsD|jj|j|jjjƒƒ|jjd|jj|jjƒS(Nulist( RRVR:RRWRXRYRRRZ(R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR3ås"(ulist(R5R6R7R$RR8R3(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR\Ýs tProvidesCommandcBsAeZdZdZedƒZed„ƒZd„Zd„Z RS(uVA class containing methods needed by the cli to execute the provides command. uprovidesu whatprovidesu*find what package provides the given valuecCs#|jddddtdƒƒdS(Nu dependencyRBu+RCu SOME_STRING(RFR(R'((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR(óscCs+|jj}t|_t|_t|_dS(N(RRLRORSRMRNRP(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*÷s   cCs)tjtdƒƒ|jj|jjƒS(NuSearching Packages: (R tdebugRRtprovidesR:t dependency(R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR3ýs(uprovidesu whatprovides( R5R6R7R$RR8t staticmethodR(R*R3(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR]ës   tCheckUpdateCommandcBsAeZdZdZedƒZed„ƒZd„Zd„Z RS(uZA class containing methods needed by the cli to execute the check-update command. u check-updateu check-upgradeu$check for available package upgradesc CsN|jddddtdddtdƒƒ|jd d d d td ƒƒdS(Nu --changelogsR=u changelogsR@R>u store_trueRAushow changelogs before updateupackagesRBu*RCuPACKAGE(RFRMR(R'((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR( s  cCsG|jj}t|_t|_|jjr6t|_nt|jƒdS(N( RRLRORPRSR:t changelogsR R(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*s      cCsù|jjjƒjƒ}|jjjrx|j|jjjƒjƒƒ}|jjjƒjd|ƒ}|j|ƒ}n|j j |j |ddƒ|jj |j j dtd|j jƒ}|rÖd|j j_n|jjjrõ|j jƒndS(NRTtcmp_typeugtetprint_Rcid(RRWRXtupgradesRRTtuniont installedtfilterRRVR:t check_updatesRZRORcRLtsuccess_exit_statustautocheck_running_kernelt_check_running_kernel(R"RXt obsoletedRTtfound((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR3s!(u check-updateu check-upgrade( R5R6R7R$RR8RaR(R*R3(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRbs   tRepoPkgsCommandc Bs]eZdZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZd efd „ƒYZd efd „ƒYZ d efd„ƒYZ defd„ƒYZ defd„ƒYZ defd„ƒYZ defd„ƒYZeeeeee e e e e eh Zd ZedƒZd„Zd„Zd„Zd„ZRS(!u2Implementation of the repository-packages command.tCheckUpdateSubCommandcBs&eZdZdZd„Zd„ZRS(u'Implementation of the info sub-command.u check-updatecCs"|jj}t|_t|_dS(N(RRLRORSRP(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*1s  cCs@|jj|jj|jdtƒ}|r<d|jj_ndS(u?Execute the command with respect to given arguments *cli_args*.ReidN( RRjR:t pkg_specstreponameRORRLRk(R"Ro((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt run_on_repo6s(u check-update(R5R6R7R$R*Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRq,s tInfoSubCommandcBs&eZdZdZd„Zd„ZRS(u'Implementation of the info sub-command.uinfocCsŸ|jj}t|_|jjr6|jj|j_n|jjdkrTt|_n|jjr›|jjrŒ|jj dd|jjƒq›d|j_ndS(Nu installedu --obsoletesu--u obsoletes( RRLRORPR:t_pkg_specs_actiontpkg_specs_actionRSRTRU(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*Bs       cCsN|jj|j|jjjƒƒ|jjd|jj|jj|j ƒdS(u?Execute the command with respect to given arguments *cli_args*.uinfoN( RRVR:RRWRXRYRwRrRs(R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRtOs"(uinfo(R5R6R7R$R*Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRu=s tInstallSubCommandcBs&eZdZdZd„Zd„ZRS(u*Implementation of the install sub-command.uinstallcCs4|jj}t|_t|_t|_t|_dS(N(RRLRORSRPt resolvingt root_user(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*Zs     cCs8|jj|j|jjjƒƒt|j|jƒt}|jjs—y|jj d|j ƒWn*t j j k rtjtdƒƒqXt}n|xy|jjD]k}y|jj ||j ƒWnBt j j k rtdƒ}tj||jjj|ƒƒq¤Xt}q¤W|s4t j jtdƒƒ‚ndS(Nu*uNo package available.uNo package %s available.uNo packages marked for install.(RRVR:RRWRXRRMRrtinstallRsRR,t MarkingErrorR tinfoRROR&ttermtboldtError(R"tdonetpkg_specR((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRtas$"   # (uinstall(R5R6R7R$R*Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRxUs tListSubCommandcBseZdZdZd„ZRS(u'Implementation of the list sub-command.ulistcCsN|jj|j|jjjƒƒ|jjd|jj|jj|j ƒdS(u?Execute the command with respect to given arguments *cli_args*.ulistN( RRVR:RRWRXRYRwRrRs(R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRtƒs"(ulist(R5R6R7R$Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRƒ~stMoveToSubCommandcBs&eZdZdZd„Zd„ZRS(u*Implementation of the move-to sub-command.umove-tocCs4|jj}t|_t|_t|_t|_dS(N(RRLRORPRSRyRz(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*Žs     cCst|j|jƒt}|jjsÉy|jjdd|jƒWn{tj j k rnt j t dƒƒqïtj jk r—t j t dƒƒqïtj jk r¿tsÆtdƒ‚qïXt}n&x#|jjD]}y|jj|d|jƒWnétj j k r.t dƒ}t j ||ƒqÖtj jk r¼}x¥|jD]h}d}|jjj|ƒ}|r‡t dƒ|}nt d ƒ}t j ||jjj|ƒ|ƒqMWqÖtj jk rätsëtdƒ‚qÖXt}qÖW|stj jt d ƒƒ‚nd S( u?Execute the command with respect to given arguments *cli_args*.u*t new_reponameuNo package installed.uNo package available.u+Only the above marking errors are expected.uNo match for argument: %suu (from %s)u%Installed package %s%s not available.uNothing to do.N(RRRRMR:Rrt reinstallRsRR,tPackagesNotInstalledErrorR R}RtPackagesNotAvailableErrorR|tAssertionErrorRORZthistoryRR&R~RR€(R"RR‚Rterrtpkgtxmsgtpkgrepo((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRt•s@    )   (umove-to(R5R6R7R$R*Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR„‰s tReinstallOldSubCommandcBs&eZdZdZd„Zd„ZRS(u0Implementation of the reinstall-old sub-command.u reinstall-oldcCs4|jj}t|_t|_t|_t|_dS(N(RRLRORPRSRyRz(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*Ås     cCs t|j|jƒt}|jjsÒy |jjd|j|jƒWntj j k rwt dƒ}t j |ƒqûtj jk r t j t dƒƒqûtj jk rÈtsÏtdƒ‚qûXt}n)x&|jjD]}y |jj||j|jƒWnétj j k r:t dƒ}t j ||ƒqßtj jk rÈ}x¥|jD]h}d}|jjj|ƒ}|r“t dƒ|}nt dƒ}t j ||jjj|ƒ|ƒqYWqßtj jk rðts÷tdƒ‚qßXt}qßW|stj jt d ƒƒ‚nd S( u?Execute the command with respect to given arguments *cli_args*.u*u)No package installed from the repository.uNo package available.u+Only the above marking errors are expected.uNo match for argument: %suu (from %s)u%Installed package %s%s not available.uNothing to do.N(RRRRMR:RrR†RsRR,R‡RR R}RˆR|R‰RORZRŠRR&R~RR€(R"RRR‚R‹RŒRRŽ((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRtÌsD      )   (u reinstall-old(R5R6R7R$R*Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRÀs tReinstallSubCommandcBs/eZdZdZd„Zd„Zd„ZRS(u,Implementation of the reinstall sub-command.u reinstallcCs>ttj|ƒj|ƒtj|ƒtj|ƒf|_dS(uInitialize the command.N(tsuperRpRR#RR„twrapped_commands(R"R((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR#þs cCsIt|jj_x3|jD](}|j|_|j|_|jƒqWdS(N(RORRLRSR’R:RsR*(R"tcommand((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*s   cCsot|j|jƒxU|jD]2}y|jƒWntjjk rMqqXPqWtjjtdƒƒ‚dS(u?Execute the command with respect to given arguments *cli_args*.u!No packages marked for reinstall.N( RRRR’RtRR,R€R(R"R“((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRt s(u reinstall(R5R6R7R$R#R*Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRùs   tRemoveOrDistroSyncSubCommandcBs/eZdZdZd„Zd„Zd„ZRS(u8Implementation of the remove-or-distro-sync sub-command.uremove-or-distro-synccCs4|jj}t|_t|_t|_t|_dS(N(RRLRORSRPRyRz(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*s     c Cs'|jjjj|ƒtjj|ƒ}|j|jjjƒ}|jjj}g|j ƒD]!}|j |ƒ|kr\|^q\}|s¡tj j d|ƒ‚n|j ƒ}|jjjj} xa|D]Y} |jd| jd| jƒr|jjjj| ƒqÆ|jjjj| d| ƒqÆWdS(u;Synchronize a package with another repository or remove it.uno package matchedtnametarcht clean_depsN(RRRWt disable_repoRtsubjecttSubjecttget_best_queryRŠRhRR,R‡t availableRtclean_requirements_on_removeRiR•R–t_goalt distupgradeterase( R"R‚RsR™tmatchesRŠRŒRhRœR—tpackage((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt_replace$s!   cCst|j|jƒt}|jjsxy|jd|jƒWn0tj j k rnt dƒ}t j |ƒqâXt}njxg|jjD]Y}y|j||jƒWn3tj j k r×t dƒ}t j ||ƒq…Xt}q…W|stj jt dƒƒ‚ndS(u?Execute the command with respect to given arguments *cli_args*.u*u)No package installed from the repository.uNo match for argument: %suNothing to do.N(RRRRMR:RrR£RsRR,R‡RR R}ROR€(R"RRR‚((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRt9s$     (uremove-or-distro-sync(R5R6R7R$R*R£Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR”s   tRemoveOrReinstallSubCommandcBs&eZdZdZd„Zd„ZRS(u6Implementation of the remove-or-reinstall sub-command.uremove-or-reinstallcCs4|jj}t|_t|_t|_t|_dS(N(RRLRORPRSRyRz(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*[s     c Cst|j|jƒt}|jjsµy,|jjdd|jd|jdtƒWnXt j j k rƒt dƒ}t j|ƒq\t j jk r«ts²tdƒ‚q\Xt}n§x¤|jjD]–}y,|jj|d|jd|jdtƒWn[t j j k r)t dƒ}t j||ƒqÂt j jk rQtsXtdƒ‚qÂXt}qÂW|s}t j jt dƒƒ‚nd S( u?Execute the command with respect to given arguments *cli_args*.u*t old_reponametnew_reponame_neqt remove_nau)No package installed from the repository.u)Only the above marking error is expected.uNo match for argument: %suNothing to do.N(RRRRMR:RrR†RsRORR,R‡RR R}R|R‰R€(R"RRR‚((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRtbs4        (uremove-or-reinstall(R5R6R7R$R*Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR¤Vs tRemoveSubCommandcBs&eZdZdZd„Zd„ZRS(u)Implementation of the remove sub-command.uremovecCs=|jj}t|_t|_t|_t|_t|_dS(N( RRLRORPt allow_erasingRMRSRyRz(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*Œs      cCsït}|jjshy|jjd|jƒWn0tjjk r^t dƒ}t j |ƒqÏXt }ngxd|jjD]V}y|jj||jƒWn-tjjk rÄt j t dƒ|ƒquXt }quW|sët j t dƒƒndS(u?Execute the command with respect to given arguments *cli_args*.u*u)No package installed from the repository.uNo match for argument: %suNo packages marked for removal.N(RMR:RrRtremoveRsRR,R|RR R}ROtwarning(R"RRR‚((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRt”s     (uremove(R5R6R7R$R*Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR¨‡s tUpgradeSubCommandcBs&eZdZdZd„Zd„ZRS(u*Implementation of the upgrade sub-command.uupgradeu upgrade-tocCs4|jj}t|_t|_t|_t|_dS(N(RRLRORPRSRyRz(R"RL((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*´s     cCsÍt|j|jƒt}|jjsA|jj|jƒt}ngxd|jjD]V}y|jj ||jƒWn-t j j k rt jtdƒ|ƒqNXt}qNW|sÉt j jtdƒƒ‚ndS(u?Execute the command with respect to given arguments *cli_args*.uNo match for argument: %suNo packages marked for upgrade.N(RRRRMR:Rrt upgrade_allRsROtupgradeRR,R|R R}RR€(R"RR‚((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRt»s   (uupgradeu upgrade-to(R5R6R7R$R*Rt(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR¬¯s urepository-packagesu repo-pkgsu repo-packagesurepository-pkgsu7run commands on top of all packages in given repositorycsOtt|ƒjˆƒ‡fd†|jDƒ}d|_d„|Dƒ|_dS(uInitialize the command.c3s|]}|ˆƒVqdS(N((t.0tsubcmd(R(s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pys ßscSs)i|]}|jD]}||“qqS((R$(R¯R°talias((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pys âs N(R‘RpR#tSUBCMDSR9R°t_subcmd_name2obj(R"Rt subcmd_objs((Rs=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR#Üs c Cs3g|jD]}|jd^q }tt|ƒjddddtjdtdƒƒ|jdddd |ƒd }|d d d ddddh}|jƒ}|jddddddd dddtdƒƒ|jddddddd dtdƒƒ|jddddddd dtdƒƒ|jddddddddtdƒƒ|jd dddddddtd!ƒƒ|jd"dddddddtd!ƒƒ|jd#dddddd dtd$ƒƒ|jd%dddddddtd&ƒƒ|jd'dd(dtd)ƒd |d|dtj ƒdS(*NiureponameRBiR>RCuREPOusubcmdRDuallu installedu availableu autoremoveuextrasu obsoletesurecentuupgradesu--allR=u_pkg_specs_actionu store_constR?R@RAushow all packages (default)u --availableushow only available packagesu --installedushow only installed packagesu--extrasushow only extras packagesu --updatesushow only upgrades packagesu --upgradesu --autoremoveushow only autoremove packagesu--recentu#show only recently changed packagesu pkg_specsu*uPACKAGE( R²R$R‘RRFt_RepoCallbackEnableRRER9RI(R"R'R°tsubcommand_choicesRHRGRK((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR(äsJ#                     cCs’y|j|jjd|_Wn;tjjtfk r[}|jjjƒtjj‚nX|j|j_|jj d|j_ |jj ƒdS(u8Verify whether the command can run with given arguments.iN( R³R:R°RRRtKeyErrort optparsert print_usageRsR*(R"te((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR* scCs|jjƒdS(u>Execute the command with respect to given arguments *extcmds*.N(R°Rt(R"((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR3s(urepository-packagesu repo-pkgsu repo-packagesurepository-pkgs(R5R6R7R!RqRuRxRƒR„RRR”R¤R¨R¬R²R$RR8R#R(R*R3(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRp)s0) 79>1(#      ( t HelpCommandcBs8eZdZdZedƒZed„ƒZd„ZRS(uRA class containing methods needed by the cli to execute the help command. uhelpudisplay a helpful usage messagecCs#|jddddtdƒƒdS(NucmdRBu?RCuCOMMAND(RFR(R'((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR($scCsk|jj s%|jj|jjkr8|jjjƒn/|jj|jj}|jjj||ƒƒdS(N(R:tcmdRt cli_commandsR¸t print_help(R"R“((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR3(s  (uhelp( R5R6R7R$RR8RaR(R3(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR»s  tHistoryCommandcBs•eZdZd ZedƒZeƒZeƒZe d„ƒZ d„Z d„Z d„Z d„Zd„Zd „Zeƒed d „Zd „ZRS(uUA class containing methods needed by the cli to execute the history command. uhistoryu(display, or use, the transaction historycCs[ddddddg}|jddd d |d |d d tjdddj|ƒƒdS(Nulistuinfouredouundourollbacku userinstalledu transactionsRBu*RDR@iR>RCu[%s]u|(RFRRItjoin(R'tcmds((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR(;s  cCs^t}tdƒj|jjƒ}|jj}|jjdkrØt}|jjstdƒ}t j |ƒt jj |ƒ‚n:t |jjƒdkr¹t j |ƒt jj |ƒ‚nt|_t|j|jƒn t|_t|_t|_tj|jjjtjƒs?tdƒ}t j |ƒt jj |ƒ‚n|j|j||ƒ|_dS( NuUFound more than one transaction ID. '{}' requires one transaction ID or package name.uredouundourollbacku(No transaction ID or package name given.iu(You don't have access to the history DB.(uredouundourollback(RMRtformatR:ttransactions_actionRRLROt transactionsR R RRtlenRSRRRNRPRzRtaccessRŠRtR_OKt_args2transaction_idstmerged_transaction_idsttransaction_ids(R"trequire_one_transaction_idtrequire_one_transaction_id_msgRLR((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR*Cs2             cCs²t|tjjƒr¢|jjdkrG|jj\}tdƒ|fS|jjdkr¢|jjddkr{|jjn |jjd\}tdƒ|fSntj ||ƒS(u.Get suggestions for resolving the given error.uundouVCannot undo transaction %s, doing so would result in an inconsistent package database.urollbackiuforceiuZCannot rollback transaction %s, doing so would result in an inconsistent package database.( R+RR,R-R:RÃRÄRR!R2(R"R1tid_((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR2`s "  cCs|jj|ƒ}|dkr+ddgfStjj|jƒ}td|j|fƒ|j j |ƒx|j ƒD]ù}t |jj jƒjdt|ƒd|jƒƒ}|jtjjkr)|stjtdƒ|j jjtt|ƒƒƒƒddgfS|d}|jjt|ƒƒqt|jtjjkrt|sJqtn|d}|jjt|ƒƒqtqtW|jjƒ|jj ƒdS( NiuFailed history redou!Repeating transaction %u, from %stnevraRsuNo package %s available.uAn operation cannot be redonei(!Rthistory_get_transactionR9Rtutiltnormalize_timet beg_timestamptprintttidR&thistoryInfoCmdPkgsAlteredRZtlistRWRXRitstrt from_repoR>t transactiontFORWARD_ACTIONSR R}RR~RRR{tlibdnftTransactionItemAction_REMOVERªtresolvetdo_transaction(R"textcmdstoldttmtitpkgsRŒ((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt _hcmd_redoos,  3"    cCsHy|jj|dƒSWn)tjjk rC}dt|ƒgfSXdS(Nii(Rthistory_undo_transactionRR,R€R×(R"RßR‹((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt _hcmd_undoŠscCsHy|jj|dƒSWn)tjjk rC}dt|ƒgfSXdS(Nii(Rthistory_rollback_transactionRR,R€R×(R"RßR‹((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt_hcmd_rollbackscCs+t|jjƒƒ}|jj|ddƒS(u&Execute history userinstalled command.uPackages installed by userunevra(ttupleRtiter_userinstalledR&tlistPkgs(R"Rã((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyt_hcmd_userinstalled–suc s^‡fd†}tƒ}x3ˆjjD]%}d|kr­y|jddƒ\}}Wn9tk rŽtjtdƒj|ƒƒt j j ‚nXtdƒ} y||ƒ}Wn9tk rætjt| ƒj|ƒƒt j j ‚nXy||ƒ}Wn9tk r2tjt| ƒj|ƒƒt j j ‚nX|ra||kratj|ƒt j j ‚n||kr}||}}n|j ||fƒ|j t||dƒƒq%y|j ||ƒƒWq%tk rIˆjjj|gƒ} | r|j | ƒqJtdƒj|ƒ} |r9tj| ƒt j j ‚qJtj| ƒq%Xq%Wt|dtƒS( u0Convert commandline arguments to transaction idscsi|dkrd}n|jdƒr1|d}nt|ƒ}|dkre|ˆjjjƒj7}n|S(Nulastu0ulast-ii(t startswithtintR&RŠtlastRÔ(tsttransaction_id(R"(s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pytstr2transaction_idŸs     u..iuWInvalid transaction ID range definition '{}'. Use '..'.uYCan't convert '{}' to transaction ID. Use '', 'last', 'last-'.iu8No transaction which manipulates package '{}' was found.treverse(tsetR:RÄtsplitt ValueErrorR R RRÂRRRtaddtupdatetrangeR&RŠtsearchR}tsortedRO( R"t merged_idstrequire_one_trans_idtrequire_one_trans_id_msgRòRÊtttbegin_transaction_idtend_transaction_idtcant_convert_msgttransact_ids_from_pkgnameR((R"s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyRÈ›sT              cCsD|jj}|dkr0|jj|jƒ}n±|dkrc|jj|j|jj|jƒ}n~|dkr„|j|jƒ}n]|dkr¥|j |jƒ}n<|dkrÆ|j |jƒ}n|dkrá|j ƒ}n|dkrñdS|\}}|dkrt |jj_n%|dkr@tjj|dƒ‚ndS( Nulistuinfouundouredourollbacku userinstalledii(R:RÃR&thistoryListCmdRÊthistoryInfoCmdRÄRÉRæRäRèRìR9RORRLRyRR,R€(R"tvcmdtrettcodetstrs((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR3Ûs*           (uhistory(R5R6R7R$RR8RôRÊRÉRaR(R*R2RäRæRèRìRMRÈR3(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pyR¿0s         ?('R7t __future__RRRÛtdnf.cli.option_parserRtdnf.i18nRRtargparsetdnf.cliRtdnf.cli.demandt dnf.consttdnf.exceptionst dnf.pycomptdnf.transactiontdnf.utilt functoolstloggingtoperatorRt getLoggerR R.R/RRR tobjectR!R<R\R]RbRpR»R¿(((s=/usr/lib/python2.7/site-packages/dnf/cli/commands/__init__.pytsH                   5?(ÿô