I Rc@sdZddlZddlZddlmZddlmZmZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl mZmZmZmZddlZddlZddlZddlmZdZd Zd Zd Zd Zd ZdZdZdZdZgdZ dfdYZ!de!fdYZ"de!fdYZ#de!fdYZ$ddZ%dZ&de!fdYZ'd e'fd!YZ(d"e!fd#YZ)d$e!fd%YZ*d&e!fd'YZ+d(e!fd)YZ,d*e!fd+YZ-d,e!fd-YZ.d.e!fd/YZ/d0e!fd1YZ0d2e!fd3YZ1d4e!fd5YZ2d6e!fd7YZ3d8e!fd9YZ4d:e!fd;YZ5d<e!fd=YZ6d>e!fd?YZ7d@e!fdAYZ8dBe!fdCYZ9dDe!fdEYZ:dFe!fdGYZ;dHe!fdIYZ<dJe!fdKYZ=dLe!fdMYZ>eZ?dNe!fdOYZ@dPe!fdQYZAdRe!fdSYZBdS(Ts< Classes for subcommands of the yum command line interface. iN(t logginglevels(t_tP_(tmisc(t utf8_widthtutf8_width_fillt to_unicodet exception2msg(t updateinfocCsj||jkr|jdS|j|}|jdj|}|jjtd|jj|dS(Nthelps Mini usage: (tyum_cli_commandstusaget _makeOutputtloggertcriticalR(tbasetbasecmdtcmdttxt((s!/usr/share/yum-cli/yumcommands.pyt_err_mini_usage(s  cCs8|jjdkr4|jjtdtjndS(sVerify that the program is being run by the root user. :param base: a :class:`yum.Yumbase` object. :raises: :class:`cli.CliError` is,You need to be root to perform this command.N(tconftuidR RRtclitCliError(R((s!/usr/share/yum-cli/yumcommands.pyt checkRootUID1scCs|jr dS|jsxw|jjD]c}|jsA|jr)|j r)td}|jj ||jj td|t j q)q)WndS(sVerify that there are gpg keys for the enabled repositories in the rpm database. :param base: a :class:`yum.Yumbase` object. :raises: :class:`cli.CliError` Ns  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 yum will install it for you. For more information contact your distribution or package provider. sProblem repository: %s( t_override_sigcheckst gpgKeyChecktrepost listEnabledtgpgcheckt repo_gpgchecktgpgkeyRR RRR(Rtrepotmsg((s!/usr/share/yum-cli/yumcommands.pyt checkGPGKey;s   cCsIt|dkrE|jjtd|t||tjndS(s/Verify that *extcmds* contains the name of at least one package for *basecmd* to act on. :param base: a :class:`yum.Yumbase` object. :param basecmd: the name of the command being checked for :param extcmds: a list of arguments passed to *basecmd* :raises: :class:`cli.CliError` is(Error: Need to pass a list of pkgs to %sN(tlenR RRRRR(RRtextcmds((s!/usr/share/yum-cli/yumcommands.pytcheckPackageArgYs   cCsdd}d|krd}nt||kr`|jjtd|t||tjndS(s0Verify that *extcmds* contains the name of at least two packages for *basecmd* to act on. :param base: a :class:`yum.Yumbase` object. :param basecmd: the name of the command being checked for :param extcmds: a list of arguments passed to *basecmd* :raises: :class:`cli.CliError` is--is'Error: Need at least two packages to %sN(R#R RRRRR(RRR$tmin_args((s!/usr/share/yum-cli/yumcommands.pytcheckSwapPackageArghs     cCst|dkrE|jjtd|t||tjn|jj|ddt dt }|s|jjtd|t||tjnt|dkrg|D]}|j r|^q}nt|dkrJdj g|D]}|j ^q}|jjtd ||ft||tjn|dj s|jj |dj|jjtd |dj nd S( s/Verify that *extcmds* contains the name of at least one package for *basecmd* to act on. :param base: a :class:`yum.Yumbase` object. :param basecmd: the name of the command being checked for :param extcmds: a list of arguments passed to *basecmd* :raises: :class:`cli.CliError` is/Error: Need to pass a repoid. and command to %sit name_matcht ignore_cases0Error: Need to pass a single valid repoid. to %sis, sAError: Need to pass only a single valid repoid. to %s, passed: %ss'Repo %s has been automatically enabled.N(R#R RRRRRRt findRepostTruet isEnabledtjointui_idt enableRepotidtverbose_loggertinfo(RRR$Rtr((s!/usr/share/yum-cli/yumcommands.pytcheckRepoPackageArgzs.    "   (%    cCsEt|dkrA|jjtdt||tjndS(sVerify that *extcmds* contains the name of at least one item for *basecmd* to act on. Generally, the items are command-line arguments that are not the name of a package, such as a file name passed to provides. :param base: a :class:`yum.Yumbase` object. :param basecmd: the name of the command being checked for :param extcmds: a list of arguments passed to *basecmd* :raises: :class:`cli.CliError` isError: Need an item to matchN(R#R RRRRR(RRR$((s!/usr/share/yum-cli/yumcommands.pyt checkItemArgs  cCsEt|dkrA|jjtdt||tjndS(s-Verify that *extcmds* contains the name of at least one group for *basecmd* to act on. :param base: a :class:`yum.Yumbase` object. :param basecmd: the name of the command being checked for :param extcmds: a list of arguments passed to *basecmd* :raises: :class:`cli.CliError` is%Error: Need a group or list of groupsN(R#R RRRRR(RRR$((s!/usr/share/yum-cli/yumcommands.pyt checkGroupArgs  cCsd}t|d krG|jjtd d j|tjnxM|D]E}||krN|jjtd |t||tjqNqNWd S(sLVerify that *extcmds* contains at least one argument, and that all arguments in *extcmds* are valid options for clean. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command being checked for :param extcmds: a list of arguments passed to *basecmd* :raises: :class:`cli.CliError` theaderstpackagestmetadatatdbcachetpluginss expire-cachetrpmdbtallis#Error: clean requires an option: %ss, s!Error: invalid clean argument: %rN(R7spackagesR9R:R;s expire-cachesrpmdbsall(R#R RRR-RRR(RRR$t VALID_ARGSR((s!/usr/share/yum-cli/yumcommands.pyt checkCleanArgs     cCst|dkr+|jjtdnt|dkr|jjtd|dtjj|ds|jjtd|d|j t j qn)|jjtd|j t j dS(svVerify that the arguments given to 'yum shell' are valid. yum shell can be given either no argument, or exactly one argument, which is the name of a file. :param base: a :class:`yum.Yumbase` object. :param basecmd: the name of the command being checked for :param extcmds: a list of arguments passed to *basecmd* :raises: :class:`cli.CliError` isNo argument to shellisFilename passed to shell: %ss2File %s given as argument to shell does not exist.s5Error: more than one file given as argument to shell.N( R#R1tdebugRtostpathtisfileR RR RR(RRR$((s!/usr/share/yum-cli/yumcommands.pyt checkShellArgs         cCs|jjrdSx3|D]+}|jdrtjj|rdSqW|j|jjrcdStd}|jj |t j dS(sVerify that there is at least one enabled repo. :param base: a :class:`yum.Yumbase` object. :param basecmd: the name of the command being checked for :param extcmds: a list of arguments passed to *basecmd* :raises: :class:`cli.CliError`: Ns.rpmsThere are no enabled repos. Run "yum repolist all" to see the repos you have. You can enable repos with yum-config-manager --enable ( RRtendswithRARBtexiststpkgSackRR RRR(Rtpossible_local_filestlfileR!((s!/usr/share/yum-cli/yumcommands.pytcheckEnabledRepos ! t YumCommandcBs_eZdZdZdZdZdZdZdZdZ dZ d Z RS( sAn abstract base class that defines the methods needed by the cli to execute a specific command. Subclasses must override at least :func:`getUsage` and :func:`getSummary`. cCst|_t|_dS(N(tFalsetdone_command_oncethidden(tself((s!/usr/share/yum-cli/yumcommands.pyt__init__s cGs2|js%|jjtj||nt|_dS(sm Output *msg* the first time that this method is called, and do nothing on subsequent calls. This is to prevent duplicate messages from being printed for the same command. :param base: a :class:`yum.Yumbase` object :param msg: the message to be output :param *args: additional arguments associated with the message N(RMR1R2RtINFO_2R+(RORR!targs((s!/usr/share/yum-cli/yumcommands.pyt doneCommands cCsgS(sReturn a list of strings that are the names of the command. The command can be called from the command line by using any of these names. :return: a list containing the names of the command ((RO((s!/usr/share/yum-cli/yumcommands.pytgetNames!scCs tdS(suReturn a usage string for the command, including arguments. :return: a usage string for the command N(tNotImplementedError(RO((s!/usr/share/yum-cli/yumcommands.pytgetUsage*scCs tdS(szReturn a one line summary of what the command does. :return: a one line summary of what the command does N(RU(RO((s!/usr/share/yum-cli/yumcommands.pyt getSummary1scCsdS(s Verify that various conditions are met so that the command can run. :param base: a :class:`yum.Yumbase` object. :param basecmd: the name of the command being checked for :param extcmds: a list of arguments passed to *basecmd* N((RORRR$((s!/usr/share/yum-cli/yumcommands.pytdoCheck8scCsdtdgfS(sExecute the command :param base: a :class:`yum.Yumbase` object. :param basecmd: the name of the command being executed :param extcmds: a list of arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage is Nothing to do(R(RORRR$((s!/usr/share/yum-cli/yumcommands.pyt doCommandBscCstS(sEReturn whether a transaction set must be set up before the command can run :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise (R+(RORRR$((s!/usr/share/yum-cli/yumcommands.pytneedTsRs cCsdS(sAReturn the cache requirements for the remote repos. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: Type of requirement: read-only:past, read-only:present, read-only:future, write twrite((RORRR$((s!/usr/share/yum-cli/yumcommands.pytcacheRequirementns( t__name__t __module__t__doc__RPRSRTRVRWRXRYRZR\(((s!/usr/share/yum-cli/yumcommands.pyRK s     tInstallCommandcBs;eZdZdZdZdZdZdZRS(sUA class containing methods needed by the cli to execute the install command. cCsddddgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command tinstalls install-ns install-nas install-nevra((RO((s!/usr/share/yum-cli/yumcommands.pyRT~scCs tdS(sbReturn a usage string for this command. :return: a usage string for this command s PACKAGE...(R(RO((s!/usr/share/yum-cli/yumcommands.pyRVscCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command s,Install a package or packages on your system(R(RO((s!/usr/share/yum-cli/yumcommands.pyRWscCs5t|t|t|||t||dS(sVerify that conditions are met so that this command can run. These include that the program is being run by the root user, that there are enabled repositories with gpg keys, and that this command is called with appropriate arguments. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(RR"R%RJ(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRXs  cCs)|j|td|j|d|S(sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage sSetting up Install ProcessR(RSRt installPkgs(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRYs(R]R^R_RTRVRWRXRY(((s!/usr/share/yum-cli/yumcommands.pyR`ys    t UpdateCommandcBs;eZdZdZdZdZdZdZRS(sTA class containing methods needed by the cli to execute the update command. cCs ddgS(sReturn a list containing the names of this command. This command can by called from the command line by using any of these names. :return: a list containing the names of this command tupdates update-to((RO((s!/usr/share/yum-cli/yumcommands.pyRTscCs tdS(sbReturn a usage string for this command. :return: a usage string for this command s [PACKAGE...](R(RO((s!/usr/share/yum-cli/yumcommands.pyRVscCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command s+Update a package or packages on your system(R(RO((s!/usr/share/yum-cli/yumcommands.pyRWscCs%t|t|t||dS(svVerify that conditions are met so that this command can run. These include that there are enabled repositories with gpg keys, and that this command is being run by the root user. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(RR"RJ(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRXs  cCsB|j|td|j|d|dk}tj||S(sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage sSetting up Update Processt update_tos update-to(RSRt updatePkgsRt remove_txmbrs(RORRR$tret((s!/usr/share/yum-cli/yumcommands.pyRYs (R]R^R_RTRVRWRXRY(((s!/usr/share/yum-cli/yumcommands.pyRcs    tDistroSyncCommandcBs;eZdZdZdZdZdZdZRS(sZA class containing methods needed by the cli to execute the distro-synch command. cCs ddgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command sdistribution-synchronizations distro-sync((RO((s!/usr/share/yum-cli/yumcommands.pyRTscCs tdS(sbReturn a usage string for this command. :return: a usage string for this command s [PACKAGE...](R(RO((s!/usr/share/yum-cli/yumcommands.pyRVscCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command s?Synchronize installed packages to the latest available versions(R(RO((s!/usr/share/yum-cli/yumcommands.pyRWscCs%t|t|t||dS(suVerify that conditions are met so that this command can run. These include that the program is being run by the root user, and that there are enabled repositories with gpg keys. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(RR"RJ(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRX s  cCsB|j|tdd|j_|j|}tj||S(sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage s/Setting up Distribution Synchronization Processi(RSRRt obsoletestdistroSyncPkgsRRg(RORRR$Rh((s!/usr/share/yum-cli/yumcommands.pyRYs   (R]R^R_RTRVRWRXRY(((s!/usr/share/yum-cli/yumcommands.pyRis     tcCst|jdt|jt|}t|jdt|j}t|j}|jdkr|t|jd7}nxWd|fd|fd|ffD]4\}}||j|d|||cd7tj|S|dkrWj|Str/ |dkrvj|S|dkrj|S|dkrj|dt}tj|S|dkrj |S|dkrj |dt }|\}}} } x'| D]} j j | j| jqWx]|D]U} t} x-jj| jD]}| j|jqcWj j| j| q>Wj jd d d j|gfS|d/krt|dkrddgfSj |d gdt }|\}}} } |d.ks5t|dkrBddgfS|d } |d k}xkjjd|dD]P}| rd|jkrqrn| j|j_| j j|jtj _!qrWj jd dd j|dgfS|dkrRx8jjd|D]!}d|jkr|j`qqWd dd j|gfS|d0kr=j |dt }|\}}} } |sddgfS|dk}xY|D]Q} xHjj| j D]1}| rd|jkrqn| j|j_qWqW|r d dd j|gfSd dd j|gfSn|d1krt|dkrhddgfSj |d gdt }|\}}} } | d.kst| dkrddgfS| d } |dk}j |ddt }x.|dD]"} |j j| j| jt"qW|rWx-|d D]} | j#| _$tj _!q2Wnj jd dd j|dgfS|d kr"j |d gdt }|\}}} } |d.krdd!gfSx#|D]} d.| _$tj _!qWj jd d"d j|gfS|d2kr8j |dt }|\}}} } | shddgfS|d$k}xw| D]o} d jt%| j&}xNj j'|D]:} | r| j$d.k rqn| j#| _$tj _!qWq{Wj j|rd d%d j|gfSd d&d j|gfSn|d'krfd(}x*j j(j)D]}j j*|qfWx,jD]!}d|jkr|j`qqWj+j,jj-d)tfd*t ff}xT|D]L\}}j+j.|} | d.krqn|r)t| _/n|| qWx6j+j0D]%} | j|krbqGn|| qGWj jd d+gfS|d,kr/ j |dt }|\}}} } x!| D]} j j1| j#qWx!|D]} j j*| jqWj jd d-d j|gfSnd.S(3sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage RRR2RaRRs mark-installR)isMarked install: t,s mark-packagessmark-packages-forceiisNo group or package givensNo group matchedtpatternst group_membersMarked packages: sunmark-packagessUnMarked packages: smark-packages-syncsmark-packages-sync-forcesMarked packages-sync-force: sMarked packages-sync: s mark-groupssmark-groups-forcesNo environment or group givensNo environment matchedsMarked groups: s unmark-groupssNo groups matchedsUnMarked groups: smark-groups-syncsmark-groups-sync-forcesMarked groups-sync-force: sMarked groups-sync: s mark-convertcs~|js dSg}xNjj|D]:}d|jkrAq&n|j|j_|j|jq&Wjj |j|dS(NR( RR<t searchNamesRtgroupidRRRqRt add_group(tgrpt pkg_namesRy(R(s!/usr/share/yum-cli/yumcommands.pyt _convert_grps tcoreRs&Converted old style groups to objects.s mark-removesMarked remove: N(s mark-packagessmark-packages-force(smark-packages-syncsmark-packages-sync-force(s mark-groupssmark-groups-force(smark-groups-syncsmark-groups-sync-force(2RRtreturnGroupSummarytreturnGroupListsR+treturnGroupInfot installGroupsRRgt removeGroupst_groupReturnGroupsRLRtadd_environmentt environmentidt allgroupsRR<RR8taddRqRRtsaveR-R#RtreturnPackagesRtgidRRtchangedtievgrptevgidt environmentRt grp_namest return_groupsRRt del_grouptcompstcompilet simplePkgListt return_groupRt get_groupstdel_environment(RORRR$RRhtgRGtigrpstgrpstievgrpstevgrpstevgrpRRRytforceRR Rt special_gidstforce_installed((Rs!/usr/share/yum-cli/yumcommands.pyRYs&                                                              cCsN|j||\}}|dkr(tS|jdsF|jdrJtStS(sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise RR2RRRR(slistsinfosremovessummary(RRLRR+(RORRR$R((s!/usr/share/yum-cli/yumcommands.pyRZs  cCs,|j||\}}|dkr(tStS(sdReturn whether a transaction set for removal only must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a remove-only transaction set is needed, False otherwise R(sremove(RR+RL(RORRR$R((s!/usr/share/yum-cli/yumcommands.pyRs  cCsN|j||\}}|dkr(dS|jdsF|jdrJdSdS( sAReturn the cache requirements for the remote repos. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: Type of requirement: read-only:past, read-only:present, read-only:future, write RR2Rsread-only:pastRRR[(slistsinfossummary(RR(RORRR$R((s!/usr/share/yum-cli/yumcommands.pyR\s  (R]R^R_RRTRVRWRRRXRYRZRR\(((s!/usr/share/yum-cli/yumcommands.pyRxs"       9  tMakeCacheCommandcBsDeZdZdZdZdZdZdZdZRS(sWA class containing methods needed by the cli to execute the makecache command. cCsdgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command t makecache((RO((s!/usr/share/yum-cli/yumcommands.pyRTscCsdS(sbReturn a usage string for this command. :return: a usage string for this command Rl((RO((s!/usr/share/yum-cli/yumcommands.pyRVscCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command sGenerate the metadata cache(R(RO((s!/usr/share/yum-cli/yumcommands.pyRWscCst|dS(s$Verify that conditions are met so that this command can run; namely that there is an enabled repository. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(RJ(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRX sc Cs|jjtd|jjtdt}|rQ|ddkrQt}ntrx2|jjD]!}d|_|sgd|_qgqgW|j dd|jj |r|jj ddd d n|jj dd d d id d 6dd6dd6dd6}x|jj D]{}xr|j jD]a}||krDq,n||jks,|j| rgq,ntj|j|||d|jq,WqWndtdgfS(sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage s*Making cache files for all metadata files.s=This may take a while depending on the speed of this computeritfasts group:allRtmdtypeR9t cacheonlyiR=s groups.xmltgroup_gzspkgtags.sqlitetpkgtagssupdateinfo.xmlRsprestodelta.xmlt prestodeltatcachedsMetadata Cache Created(R R@RRLR+Rtsorttmetadata_expiretmdpolicyRtdoSetupt populateSackRtrepoXMLt fileTypest retrievedRtrepo_gen_decompresst retrieveMDtcache(RORRR$R0R t fname_maptMD((s!/usr/share/yum-cli/yumcommands.pyRYs:       cCstS(sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise (RL(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRZQs ( R]R^R_RTRVRWRXRYRZ(((s!/usr/share/yum-cli/yumcommands.pyR.s    ;t CleanCommandcBsMeZdZdZdZdZdZdZdZdZ RS(sSA class containing methods needed by the cli to execute the clean command. cCsdgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command tclean((RO((s!/usr/share/yum-cli/yumcommands.pyRTascCsdS(sbReturn a usage string for this command. :return: a usage string for this command s<[headers|packages|metadata|dbcache|plugins|expire-cache|all]((RO((s!/usr/share/yum-cli/yumcommands.pyRViscCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command sRemove cached data(R(RO((s!/usr/share/yum-cli/yumcommands.pyRWpscCst|||t|dS(syVerify that conditions are met so that this command can run. These include that there is at least one enabled repository, and that this command is called with appropriate arguments. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(R?RJ(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRXws cCsd|j_|j|S(sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage i(RRAtcleanCli(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRYs cCstS(sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise (RL(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRZs cCsdS(sAReturn the cache requirements for the remote repos. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: Type of requirement: read-only:past, read-only:present, read-only:future, write sread-only:past((RORRR$((s!/usr/share/yum-cli/yumcommands.pyR\s( R]R^R_RTRVRWRXRYRZR\(((s!/usr/share/yum-cli/yumcommands.pyRD\s     tProvidesCommandcBsDeZdZdZdZdZdZdZdZRS(sVA class containing methods needed by the cli to execute the provides command. cCs ddgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command tprovidest whatprovides((RO((s!/usr/share/yum-cli/yumcommands.pyRTscCsdS(sbReturn a usage string for this command. :return: a usage string for this command t SOME_STRING((RO((s!/usr/share/yum-cli/yumcommands.pyRVscCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command s*Find what package provides the given value(R(RO((s!/usr/share/yum-cli/yumcommands.pyRWscCst|||dS(s7Verify that conditions are met so that this command can run; namely that this command is called with appropriate arguments. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(R5(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRXscCs*|jjdtj||j|S(sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage sSearching Packages: (R R@RRRH(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRYs cCsdS(sAReturn the cache requirements for the remote repos. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: Type of requirement: read-only:past, read-only:present, read-only:future, write sread-only:past((RORRR$((s!/usr/share/yum-cli/yumcommands.pyR\s( R]R^R_RTRVRWRXRYR\(((s!/usr/share/yum-cli/yumcommands.pyRGs    tCheckUpdateCommandcBsDeZdZdZdZdZdZdZdZRS(sZA class containing methods needed by the cli to execute the check-update command. cCsdgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command s check-update((RO((s!/usr/share/yum-cli/yumcommands.pyRTscCsdS(sbReturn a usage string for this command. :return: a usage string for this command s [PACKAGE...]((RO((s!/usr/share/yum-cli/yumcommands.pyRVscCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command s#Check for available package updates(R(RO((s!/usr/share/yum-cli/yumcommands.pyRWscCst|dS(s.Verify that conditions are met so that this command can run; namely that there is at least one enabled repository. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(RJ(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRXscs6tjdg|}jjddd}tr,j|}jjsijj t j rj|}|j|_|j |_ nt |}t|jdkri} jjd} | r'xQt|jD]=} | jjdkr| jr| | | j| jf}!j%td| jj%td| jg}"|s|r"|"j%td|g7}"n|!r\|!j&d>k r\|"j%td|!j&g7}"n|!r|!j'dr|!j'd}#|"j%tddj(t)|#g7}"n|!r*|!j'dr*xgt)|!j'dD]O}$|!j'd|$}#|"j%tdd|$dj(t)|#fg7}"qWn|!r|"j%tdt*j+|!j!j%td|j%td |g7}"nt,| d!r| j-}%n | j.}%|%r|"j%td"dj(|%g7}"n|r| j/n| jr[|"j%td#| jg7}"|r| jj j!}&|"j%td$t*j+|&g7}"qn.| j0r|"j%td%| j0g7}"n|r| j/r|% r| j/d}'t| j/dkr|'d&t| j/d7}'n|"j%td"|'g7}"nt1j2j3| j4s%td'}(n$t1j5| j4j6}(t*j+|(}(| j7d(krktd)|(}nA| j7std*|(}n%|| j7}td+||(f}|"j%td,|g7}"| jr |"j%td-dj(| jg7}"n| j8r9 |"j%td.dj(| j8g7}"n|ra |"j%td/|g7}"n| j9r |"j%td0| j9g7}"njj:d1d2j(tt;j<|"qW| rw |rw ttd3})d}*d}+d},x|D]\}}-\}}}|)t|kr, t|})n|*t|-krM t|-}*n|+|t|krv |t|}+n|,t|kr t|},q q W|dkr jj=|)d}.nWttd4|+kr jj=|)ttd4d}.njj=|)|+d}.|.|*kr* |.}*n*|.|*8}.|)|.d7})|*|.|.d7}*t>td3|)}/t>td5|*|*}0|dkr jj:d6|/|0njj:d7|/|0td4x|D]\}}-\}}}|dkr! jj:d6t>||)t>|-|*|*q n|r? t>||,d8t}njj:d9t>||)t>|-|*|*||q Wndd:t<t?j@d;|tgfS(?sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage cs:d}x$|jjD]}||j7}qWj|S(Ni(tsackRt packagesizet format_number(R RhRy(R(s!/usr/share/yum-cli/yumcommands.pyt _repo_sizescs=x6|D].}|jj|dtdtkrtSqWtS(NR(R)(RR*R+RL(R Rtpat(R(s!/usr/share/yum-cli/yumcommands.pyt _repo_matchs   cSsttjd|tS(Ns%d(RtlocaletformatR+(tnum((s!/usr/share/yum-cli/yumcommands.pyt _num2ui_num!siiR=tdisabledtenabledcSs |jS(N(tlower(RM((s!/usr/share/yum-cli/yumcommands.pyt)sRmtgreenRtredtnormalRls: is+%st*sRepo-id : sRepo-name : sRepo-status : sRepo-revision: tcontentsRepo-tags : s, tdistrosRepo-distro-tags: s[%s]: %ssRepo-updated : sRepo-pkgs : sRepo-size : t _orig_baseurlsRepo-baseurl : sRepo-metalink: s Updated : sRepo-mirrors : s (%d more)tUnknownisNever (last: %s)sInstant (last: %s)s%s second(s) (last: %s)sRepo-expire : sRepo-exclude : sRepo-include : sRepo-excluded: sRepo-filename: s%s s srepo idtstatuss repo names%s %ss%s %s %stlefts %s %s %s%ss repolist: s%d(sallRxsenabled(RlRlRlN(AR#tmapR+R1RPRRQRR;RGRRt RepoErrorRR0tvaluesR7RtFG_COLORRRLRqRRRtexcludeRnR!t _excludesR.tmetalinkt metalink_datatrepomdt timestampR<RRt fmtKeyValFilltrevisionttagsR-RttimetctimethasattrRtbaseurlturlst mirrorlistRARBRFtmetadata_cookietstattst_mtimeR8t includepkgstrepofileR2RRRRRtRu(1RORRR$RqRsRwtargtverboseR Rt enabled_repost on_ehibegt on_dhibegton_hiendttot_numtcolstehibegtdhibegthiendt ui_enabledt ui_endis_widtui_numtui_excludes_numt force_showRytui_sizeRvtexcludesR3tpidRptmdtstmdtoutRRtbaseurlsttsturltlasttid_lentnm_lentst_lentui_lentrnameRttxt_ridttxt_rnam((Rs!/usr/share/yum-cli/yumcommands.pyRYs "        *       1       '      "        '              cCstS(sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise (RL(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRZ s cCsdS(sAReturn the cache requirements for the remote repos. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: Type of requirement: read-only:past, read-only:present, read-only:future, write sread-only:past((RORRR$((s!/usr/share/yum-cli/yumcommands.pyR\# s( R]R^R_RTRVRWRYRZR\(((s!/usr/share/yum-cli/yumcommands.pyRks     t HelpCommandcBsSeZdZdZdZdZdZedZdZ dZ RS(sRA class containing methods needed by the cli to execute the help command. cCsdgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command R ((RO((s!/usr/share/yum-cli/yumcommands.pyRT4 scCsdS(sbReturn a usage string for this command. :return: a usage string for this command tCOMMAND((RO((s!/usr/share/yum-cli/yumcommands.pyRV< scCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command sDisplay a helpful usage message(R(RO((s!/usr/share/yum-cli/yumcommands.pyRWC scCsgt|dkr(|jtjn;t|dksM|d|jkrc|jtjndS(s?Verify that conditions are met so that this command can run; namely that this command is called with appropriate arguments. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* iiN(R#R RRR (RORRR$((s!/usr/share/yum-cli/yumcommands.pyRXJ s   % cCsX|jd}y|j}Wnttfk r?d}nXy|j}Wnttfk rod}nXd}|dk r|d||f7}n|dk r|d|7}n|dkr|dkrtd|}n|j}t|dkrTt|dkr$|td7}n|td 7}|d j|jd7}n|S( NiRls%s %ss %ssNo help available for %siis aliases: s alias: s, ( RTRVtAttributeErrorRURRWRR#R-(tcommandtcanonical_nameR Rt help_outputt command_names((s!/usr/share/yum-cli/yumcommands.pyR Z s.      cCsJ|d|jkr@|j|d}|jj|j|ndgfS(sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage i(R R1R2R (RORRR$R((s!/usr/share/yum-cli/yumcommands.pyRY~ scCstS(sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise (RL(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRZ s ( R]R^R_RTRVRWRXt staticmethodR RYRZ(((s!/usr/share/yum-cli/yumcommands.pyR. s    $ tReInstallCommandcBsDeZdZdZdZdZdZdZdZRS(sWA class containing methods needed by the cli to execute the reinstall command. cCsdgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command t reinstall((RO((s!/usr/share/yum-cli/yumcommands.pyRT scCsdS(sbReturn a usage string for this command. :return: a usage string for this command s PACKAGE...((RO((s!/usr/share/yum-cli/yumcommands.pyRV scCs5t|t|t|||t||dS(sVerify that conditions are met so that this command can run. These include that the program is being run by the root user, that there are enabled repositories with gpg keys, and that this command is called with appropriate arguments. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(RR"R%RJ(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRX s  cCs#|j|td|j|S(sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage sSetting up Reinstall Process(RSRt reinstallPkgs(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRY scCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command sreinstall a package(R(RO((s!/usr/share/yum-cli/yumcommands.pyRW scCstS(sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise (RL(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRZ s ( R]R^R_RTRVRXRYRWRZ(((s!/usr/share/yum-cli/yumcommands.pyR s     tDowngradeCommandcBsDeZdZdZdZdZdZdZdZRS(sWA class containing methods needed by the cli to execute the downgrade command. cCsdgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command t downgrade((RO((s!/usr/share/yum-cli/yumcommands.pyRT scCsdS(sbReturn a usage string for this command. :return: a usage string for this command s PACKAGE...((RO((s!/usr/share/yum-cli/yumcommands.pyRV scCs5t|t|t|||t||dS(sVerify that conditions are met so that this command can run. These include that the program is being run by the root user, that there are enabled repositories with gpg keys, and that this command is called with appropriate arguments. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(RR"R%RJ(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRX s  cCs#|j|td|j|S(sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage sSetting up Downgrade Process(RSRt downgradePkgs(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRY scCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command sdowngrade a package(R(RO((s!/usr/share/yum-cli/yumcommands.pyRW scCstS(sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise (RL(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRZ s ( R]R^R_RTRVRXRYRWRZ(((s!/usr/share/yum-cli/yumcommands.pyR s     tVersionCommandcBsDeZdZdZdZdZdZdZdZRS(sUA class containing methods needed by the cli to execute the version command. cCsdgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command Rs((RO((s!/usr/share/yum-cli/yumcommands.pyRT0 scCsdS(sbReturn a usage string for this command. :return: a usage string for this command s[all|installed|available]((RO((s!/usr/share/yum-cli/yumcommands.pyRV8 scCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command s9Display a version for the machine and/or available repos.(R(RO((s!/usr/share/yum-cli/yumcommands.pyRW? scCs!d}|r|d}n|d.kr2|d}nd}d}|jjtj}i}|d/krg}|dkrd}q|td}ntjj}xI|D]A} t|| j || <|| j r|| j |j qqW|dkr5t dGHxt|D]} dG| GHqWddgfS|dkrJx|D]} | |kr`qHnt dG| GHt dGH|sxt|| D]} dG| GHqWqHiid6id6} || } |j| } |j| | | | d| dg} |j| }|d |d f}|j| t| d|qHWddgfS|jd rt|rtx|D]}d|krd|krt|ds File doesn't exist: %scss|]}|jVqdS(N(tstrip(t.0tn((s!/usr/share/yum-cli/yumcommands.pys sidt releasevertbasearchRtwarns%s %s/%ss Installed:is%s %ssGroup-Installed:is Available:sGroup-Available:RoRs(s grouplists groupinfoRsnogroups-installedsnogroups-availables nogroups-alls installedsallsgroup-installeds group-alls availablesallsgroup-availables group-all(Rsnogroups-installedsnogroups-availables nogroups-all(s installedsallsgroup-installeds group-allN(sgroup-installeds group-all(s availablesallsgroup-availables group-all(sgroup-availables group-all(.R1RPRRQR#RtconfigtreadVersionGroupsConfigRtpkglisttrun_with_packagesRdtrun_with_package_namesRRt_group_names2aipkgst_calcDataPkgColumnsRt_displayPkgsFromNamesR+RRRARBRFR Rtopent readlinestbasenametrangeRRtyumvarR<t simpleVersionthistoryRRtend_rpmdbversiont_rpmdb_warn_checksRRGRwt fmtColumnstzip(RORRR$tvcmdRRRtgconfRtpkgnameRxRtpkg_names2pkgsRtdgrpRvtndgrptreltbaRtlastdbvRRpRoR{R|tline((s!/usr/share/yum-cli/yumcommands.pyRYF s                             "  %1 cCsNd}|r|d}n|jjtj}|dkrD|rDtS|dkS( sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise RiRRR=sgroup-availables group-all(s availablesallsgroup-availables group-all(R1RPRRQR+(RORRR$RR((s!/usr/share/yum-cli/yumcommands.pyRZ s  cCsdS(sAReturn the cache requirements for the remote repos. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: Type of requirement: read-only:past, read-only:present, read-only:future, write sread-only:present((RORRR$((s!/usr/share/yum-cli/yumcommands.pyR\ s( R]R^R_RTRVRWRYRZR\(((s!/usr/share/yum-cli/yumcommands.pyR+ s    tHistoryCommandcBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZRS(sUA class containing methods needed by the cli to execute the history command. cCsdgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command R((RO((s!/usr/share/yum-cli/yumcommands.pyRT scCsdS(sbReturn a usage string for this command. :return: a usage string for this command sC[info|list|packages-list|summary|addon-info|redo|undo|rollback|new]((RO((s!/usr/share/yum-cli/yumcommands.pyRV scCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command s(Display, or use, the transaction history(R(RO((s!/usr/share/yum-cli/yumcommands.pyRW sc CsYitd6td6}idd6dd6dd6dd6}xt|dkrt}x\|djdd jd D];}||krqqnt}||d}|| ||p sisRollback to transaction %u(RLR#R+tpopRRRRRRRtaltered_lt_rpmdbtaltered_gt_rpmdbRtYumMergedHistoryTransactiontmergeRRRRR-RR ( RORR$R+RRtmobjRR!R ((s!/usr/share/yum-cli/yumcommands.pyt_hcmd_rollbackM s@"     0       cCs|jjdS(N(Rt_create_db_file(RORR$((s!/usr/share/yum-cli/yumcommands.pyt _hcmd_newu scCsdG|jjGHtj|jjj}dGtjd|tGH|jj}|dkrmt dGdGHdS|jj }|jj dd}t dG|j GHt dGtj|jGHt dGtj|jGHt d GHt d Gtjd |d tGHt d Gtjd |dtGHt dGtjd |dtGHt dGtjd |dtGHt dGtjd |dtGHt dGtjd |dtGHdS(Ns File :s Size :s%ds Transactions:it1s Begin time :s End time :s Counts :s NEVRAC :s%6dtnevracs NEVRA :tnevras NA :Rns NEVR :tnevrs rpm DB :R<s yum DB :tyumdb(Rt_db_fileRARtst_sizeRtRuR+RRRt _pkg_statsRRRRRt end_timestamp(RORR$Rvttrans_Ntcountsttrans_1((s!/usr/share/yum-cli/yumcommands.pyt _hcmd_statsx s&  """""cCs|d}|sd}nxrt|jjd|D]U}|jj|dtdkr_q5ndG|GdG|jj|rdGHq5dGHq5WdS(NiRtcreatesSyncing rpm/yum DB data for:s...sDone.sFAILED.(RRR<RRtpkg2pidRLt sync_alldb(RORR$tipkg((s!/usr/share/yum-cli/yumcommands.pyt _hcmd_sync s  " cCsd}|rJ|d|krJ|jjtddj|tjn|rw|dd krwt|t|n=tj |j j tj s|jjtdtjndS(!sZVerify that conditions are met so that this command can run. The exact conditions checked will vary depending on the subcommand that is being called. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* RR2Rtrepeattredotundotnewtrollbacktaddons addon-infotstatst statisticstsynctsynchronizepkgtpkgsspkg-lists pkgs-listtpackages package-listR8s packages-listspkg-infos pkgs-infos package-infos packages-infois%Invalid history sub-command, use: %s.s, s(You don't have access to the history DB.N(slistsinfossummarysrepeatR)R*snewR,R-s addon-infoR.R/R0R1spkgsspkg-lists pkgs-listR3s package-listspackagess packages-listspkg-infos pkgs-infos package-infos packages-info(srepeatR)R*R,snew( R RRR-RRRR"RARRRR(RORRR$R((s!/usr/share/yum-cli/yumcommands.pyRX s"    c Csd}|r|d}ntr"nz|dkr@|j|}n\|dkr^|j|}n>|dkr||j|}n |dkr|j|}n|dkr|j|}n|dkr|j||}n|dkr|j||}n|dkr|j||}n|dkr<|j ||}n`|d kr]|j ||}n?|d!kr~|j ||}n|d"kr|j |}n|d#krdd|fgfS|S($sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage RiR2RR-s addon-infoRyR2spkg-lists pkgs-listR3s package-listR8s packages-listR*R)R(R,R+R.R/R0t synchronizespkg-infos pkgs-infos package-infos packages-infos history %s(saddons addon-info(spkgspkgsspkg-lists pkgs-listspackages package-listspackagess packages-list(sredosrepeat(sstatss statistics(ssyncR4(spkg-infos pkgs-infos package-infos packages-infoN(RLthistoryListCmdthistoryInfoCmdthistorySummaryCmdthistoryAddonInfoCmdthistoryPackageListCmdR R RRR"R'thistoryPackageInfoCmdR(RORRR$RRh((s!/usr/share/yum-cli/yumcommands.pyRY sB              cCs#d}|r|d}n|dkS(sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise RiR(R)R*R,(srepeatsredosundosrollback((RORRR$R((s!/usr/share/yum-cli/yumcommands.pyRZ s  cCs-d}|r|d}n|d kr)dSdS( sAReturn the cache requirements for the remote repos. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: Type of requirement: read-only:past, read-only:present, read-only:future, write RiR(R)R*R,R[sread-only:past(srepeatsredosundosrollback((RORRR$R((s!/usr/share/yum-cli/yumcommands.pyR\ s   (R]R^R_RTRVRWR R RRR"R'RXRYRZR\(((s!/usr/share/yum-cli/yumcommands.pyR s    (     1 tCheckRpmdbCommandcBsDeZdZdZdZdZdZdZdZRS(sYA class containing methods needed by the cli to execute the check-rpmdb command. cCs ddgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command tchecks check-rpmdb((RO((s!/usr/share/yum-cli/yumcommands.pyRT scCsdS(sbReturn a usage string for this command. :return: a usage string for this command s[dependencies|duplicates|all]((RO((s!/usr/share/yum-cli/yumcommands.pyRV scCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command sCheck for problems in the rpmdb(R(RO((s!/usr/share/yum-cli/yumcommands.pyRW sc Cskd}|r|}nd}d}|jd|dtd|ddrTd }n|d ||fgfS( sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage R=cSst|jGHdS(N(Rt__str__(RM((s!/usr/share/yum-cli/yumcommands.pyt_out2 siRRtchkcmdtheadercSsdS(N(R(RM((s!/usr/share/yum-cli/yumcommands.pyR{7 sis%s %s(RRL(RORRR$R?R>trc((s!/usr/share/yum-cli/yumcommands.pyRY s    cCstS(sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise (RL(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRZ; s cCsdS(sAReturn the cache requirements for the remote repos. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: Type of requirement: read-only:past, read-only:present, read-only:future, write sread-only:past((RORRR$((s!/usr/share/yum-cli/yumcommands.pyR\F s( R]R^R_RTRVRWRYRZR\(((s!/usr/share/yum-cli/yumcommands.pyR; s     tLoadTransactionCommandcBsDeZdZdZdZdZdZdZdZRS(s^A class containing methods needed by the cli to execute the load-transaction command. cCs dddgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command sload-transactionsload-tssts-load((RO((s!/usr/share/yum-cli/yumcommands.pyRTV scCsdS(sbReturn a usage string for this command. :return: a usage string for this command R((RO((s!/usr/share/yum-cli/yumcommands.pyRV^ scCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command s&load a saved transaction from filename(R(RO((s!/usr/share/yum-cli/yumcommands.pyRWe scsfd}d}|s0tjg}n|d}tjj|rI|jtd|ttjd|}d}t } x|D]} j | } | ddk rqn| d} | dj } |dkrt jjdtd}n| |kr td} nd } yDt| d j }d |}t| |j }|d7}Wn qnXidd 6dd 6}x+| |D]}|j}|||qWd }x7| |D]+}|j}||rqnd}PqWd|| f} | std}t|}|dkr<d}nt||}td}t|}|dkrxd}nt||}dG|GdG|GdGtdGHt} ntjd|d t}d||f}tjd|d t}d||f}d| ||tjj| fGHqWdtd|t|fgfS|jtd|j|d td|tjjfgfS(sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage cs|jdstSy|jddjjd\}}t|j}t|jjd}|tjkrj|}n%|tj krj |}nt SWnt SXtS(Nsmbr:t:iR~R( RR+RRtintttupleRt TS_INSTALLtgetInstalledPackageObjectt TS_AVAILABLEtgetPackageObjectRL(tltpkgtupt current_stateR(R(s!/usr/share/yum-cli/yumcommands.pyt _pkg_availz s(cSse|jdsdS|td}|d krB|dcd7 [-- install|cmd] ((RO((s!/usr/share/yum-cli/yumcommands.pyRV scCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command s3Simple way to swap packages, instead of using shell(R(RO((s!/usr/share/yum-cli/yumcommands.pyRW scCs5t|t|t|||t||dS(sVerify that conditions are met so that this command can run. These include that the program is being run by the root user, that there are enabled repositories with gpg keys, and that this command is called with appropriate arguments. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(RR"R'RJ(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRX s  c Csid|kr6|jd}|| }||d}n|d }|d}|oS|scddgfS|d|jkrdg|}n|d|jkrdg|}n|j}|j}xy||fD]k} dj| |_| |_|j|j} | ddkr| dd |dj| fgfSqW||_||_dd |dj|fgfS( sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage s--iRtiRRaR~is%s %s(tindexR Rt cmdstringR-t parseCommandst doCommands( RORRR$tofftrextcmdstiextcmdstocmdstolineRtcmdret((s!/usr/share/yum-cli/yumcommands.pyRY- s0           (  (R]R^R_RTRVRWRXRY(((s!/usr/share/yum-cli/yumcommands.pyRs s     tRepoPkgsCommandcBsMeZdZdZdZdZdZdZdZdZ RS(sRA class containing methods needed by the cli to execute the repo command. cCsddddgS(sReturn a list containing the names of this command. This command can be called from the command line by using any of these names. :return: a list containing the names of this command s repo-pkgss repo-packagessrepository-pkgssrepository-packages((RO((s!/usr/share/yum-cli/yumcommands.pyRTf scCsdS(sbReturn a usage string for this command. :return: a usage string for this command sK [pkg(s)]((RO((s!/usr/share/yum-cli/yumcommands.pyRVo scCs tdS(shReturn a one line summary of this command. :return: a one line summary of this command sJTreat a repo. as a group of packages, so we can install/remove all of them(R(RO((s!/usr/share/yum-cli/yumcommands.pyRWv scCs5t|t|t|||t||dS(sVerify that conditions are met so that this command can run. These include that the program is being run by the root user, that there are enabled repositories with gpg keys, and that this command is called with appropriate arguments. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* N(RR"R4RJ(RORRR$((s!/usr/share/yum-cli/yumcommands.pyRX} s  cCspd}|d}|d}|d}t}|sEt}dg}nd} i dd6dd 6d d 6d d 6d d 6d d6d d6dd6dd6} | j||}trn|dkrtj|||d|S|dkrtj|||d|S|dkrlxC|D];} |jd| d|} || || t| 7} qW| r]dtdd| fSn|dkrxC|D];} |j d| d|} || || t| 7} qW| r]t j |dtdd| fSns|dkrnxI|D]A} |j d| dtd|} || || t| 7} qW| r]t j |dtdd| fSn|d2kr|r|j j } nxI|D]A} |jd| d|d |} || || t| 7} qW|r| |_ n| r]dtd!d"| fSnN|d3kr|r3|j j } nxC|D];} |jd| d |} || || t| 7} q:W|r| |_ n| r]dtd&d'| fSn|d(kr|r|j j } nxj|D]b} y"|jd| d|d |} Wntjjk rqnX|| || t| 7} qW|rS| j |_ n| rodtd!d"| fSxC|D];} |jd| d |} || || t| 7} qvW|r| |_ n| r]dtd&d'| fSnw|dkrWxC|D];} |jd| d|} || || t| 7} qW| r]dtd)d*| fSn|dkr2x|D]} |jd| d|} xg| D]^}|jj|j}x@t|D]2}|j|krqn| |jd+|7} PqWqW|| || t| 7} qjW| r]dtd,d-| fSn+|d krFx|D]} |jd| d|} x| D]}|jj|jg}d4}x[t|D]M}|j|krqn|r|j|dr|j|q|g}qW|rMx0|D](}|j|jkrqn|g}PqWt|dkrM|j|}qMnx|D]}|j\}}}}}|j|jr| |jd+|7} qT|j |jr| |j d+|7} qT|j!j|j| j|| |j"d+|7} qTWqkW|| || t| 7} qEW| r]dtd.d/| fSndt#d0|gfSdt#d1gfS(5sExecute this command. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: the command line arguments passed to *basecmd* :return: (exit_code, [ errors ]) exit_code is:: 0 = we're done, exit 1 = we've errored, exit with error string 2 = we've got work yet to do, onto the next stage cSsx|D]}||_qWdS(N(trepopkg(ttxmbrsRttxmbr((s!/usr/share/yum-cli/yumcommands.pyt_add_repopkg2txmbrs s iiiRRRsremove-or-reinstallserase-or-reinstallsremove-or-syncs erase-or-syncserase-or-distro-syncsremove-or-distro-syncs%erase-or-distribution-synchronizations&remove-or-distribution-synchronizationRdRs update-tos upgrade-toRRR2Ratpatterns%d package to installs%d packages to installs%d package to updates%d packages to updateRes reinstall-oldsreinstall-installedtrepoid_installs%d package to reinstalls%d packages to reinstalls reinstall-newsreinstall-availablesmove-tos%d package to move tos%d packages to move toRs%d package to removes%d packages to removeRs%d package to remove/reinstalls%d packages to remove/reinstalls%d package to remove/syncs%d packages to remove/syncsNot a valid sub-command of %ss Nothing to do(s reinstall-oldsreinstall-installed(s reinstall-newsreinstall-availablesmove-toN($RLR+RRRYRRaR#RRdRRgt _not_found_atcopyRRRtReinstallRemoveErrorRRGtsearchPkgTupleRKRRRRqRtverEQRRrtbestPackagesFromListRRRaRR(RORRR$RRRRRtnoargsRvRRRt onot_found_aRR2RytapkgsttoinstRtaRR|R3((s!/usr/share/yum-cli/yumcommands.pyRY s@                                                                cCsOd}t|dkr%|d}n|dkrKtj|||dStS(sGReturn whether a transaction set must be set up before this command can run. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: True if a transaction set is needed, False otherwise RaiR2Ri(sinfoslist(R#RR\R+(RORRR$R((s!/usr/share/yum-cli/yumcommands.pyRZis   cCsOd}t|dkr%|d}n|dkrKtj|||dSdS(sAReturn the cache requirements for the remote repos. :param base: a :class:`yum.Yumbase` object :param basecmd: the name of the command :param extcmds: a list of arguments passed to *basecmd* :return: Type of requirement: read-only:past, read-only:present, read-only:future, write RaiR2RiR[(sinfoslist(R#RR\(RORRR$R((s!/usr/share/yum-cli/yumcommands.pyR\zs   ( R]R^R_RTRVRWRXRYRZR\(((s!/usr/share/yum-cli/yumcommands.pyRa s    tUpdateinfoCommandcBs#eZidd6dd6dd6dd6dd6dd6dd 6Zd Zd Zd Zd ZdZdZdZ dZ i dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6Z xe j D]Zee etj||dSid d 6d d6dd 6dd 6}dG|GHxdD]}|| krqpn||}|dkrt| dkr| jd}|dkr|d|}qnd|| ||fGH|dkrpt| dkrpd}xFt| d|D]/}|| ||pId|df}d|GHq0WqpqpWtj||i|_dS(Ncsjjd|dS(Ns%s(R1R2(RM(R(s!/usr/share/yum-cli/yumcommands.pyRNsRRiiRRRlt newpackagetbugfixt enhancements New PackagetSecuritytBugfixt EnhancementsUpdates Information Summary:R~s %*u %s notice(s)cSs,idd6dd6dd6dd6j||S( Ntzz1tCriticaltzz2t Importanttzz3tModeratetzz4tLow(R(R((s!/usr/share/yum-cli/yumcommands.pyt _sev_sort_keys   Rt?s %*u %s %s notice(s)(RssecurityRR(RssecurityRR( RRR#RRRSRRR(RORRRRRRxR!RNR t sev_countsRRRKRytsevtmaxsizetTtsizetoutTRtsnRRR((Rs!/usr/share/yum-cli/yumcommands.pytsummary_show_pkgssZ"   !             c csx|jD]}|ddkr&q nxa|dD]U}xL|dD]@}|d|d|dpcd|d |d f}||fVqBWq1Wq WdS( NRRRR8RqRrRvRmRsRt(tnotices(RORRtupkgRyRK((s!/usr/share/yum-cli/yumcommands.pyt _get_new_pkgs"stbugzillat bugzillastbzstbzRtsectcvetcvesRt newpackagess new-packagess new-packageR+c s9||jkr|j|}nd|rL|ddkrL|d}|d }n7|rn|d|jkrnd}n|r}d}nd}|dkr|jd ||jS|dkr|jd ||jS|dkr|jd ||jS|dkrEd}|rtj|}ntj |d|d |dgfS|dkrd}|rotj|}ntj |d|d |dgfS|dkrd}|rtj|}ntj |d|d |dgfS|dkr5fd}tj j |d|d |dgfSdS(NiRR2Rsremove-pkgs-tssexclude-updatess exclude-allscheck-running-kernelisupdateinfo listsupdateinfo infosupdateinfo summaryR~s donecsjjd|dS(Ns%s(R1R2(RM(R(s!/usr/share/yum-cli/yumcommands.pyRNos(slistsinfossummarysremove-pkgs-tssexclude-updatess exclude-allscheck-running-kernel(Rt _cmd2filtt doCommand_liRRRRRt _args2filtersRgRRRSRT(RORRR$t subcommandtfiltersRN((Rs!/usr/share/yum-cli/yumcommands.pyRY>sX                c Cst}g}x[t|j|ddD];\} } |r`tj|| d|  r`q.n| d} | |kr|q.nttt|jj| g} |dkr| r|j | q.n|dkr| r|j | q.n|j j | } | s q.n|dkrB| dj | drB|j | q.n|j | |j | | | dfq.W||||di||dS(NRcSs |ddS(Nii((RM((s!/usr/share/yum-cli/yumcommands.pyR{ysiRRR(s installedsupdates(RRRRt_match_sec_cmdRtreversedR<RRRGRtverLERR(RORRR$RR!t show_pkgst done_pkgsRxRRKRtipkgsR2((s!/usr/share/yum-cli/yumcommands.pytdoCommand_li_newts2    '  #  cCsd}d}t|dkrwd}|d|jkrP|j|jd}n|}|rw|tjkrwd}qwn|||fS(Nii(RR#RR Rt_update_info_types_(ROR$t filt_typeR((s!/usr/share/yum-cli/yumcommands.pyt_parse_extcmdss c sn|jd}tj|j|j|\}}d|r|ddkr|jddkr|j|\}}qndkr|j||||d|dgfS|_tj |jit rnidkr!tj |}tj |n<dkr?tj |}ndkr]tj |}nfd }g} xt|D]} x||| D]\} } i} | \| d <| d <| d <| d <| d<| d dkrd| ds       "       &     o=<< kzkNBjM<K<BCDnGHL^*W1