Ñò ¾[c @s|dZddkZddkZddkZddkZddklZddkTddki Z dei fd„ƒYZ dS(s< A shell implementation for the yum command line interface. iÿÿÿÿN(tErrors(t*tYumShellcBs°eZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„ZRS(s Interactive yum shell. cCsçtii|ƒ||_d|_d|_|id7_t|_dg|_ t |i ƒdjo|i d|_ nddddd d d d g|_ |i |iiiƒ|_tid ƒ|_tidƒ|_g|_dS(Ns> it-s Leaving Shelltrepot repositorytexittquittrunttst transactiontconfigsyum.clisyum.verbose.cli(tcmdtCmdt__init__tbasetprompttresultt identcharstFalset from_filet resultmsgstlentextcmdstfiletshell_specific_commandstyum_cli_commandstkeyst commandlisttloggingt getLoggertloggertverbose_loggert_shell_history_cmds(tselfR((s/usr/share/yum-cli/shell.pyR%s      cCs)|iiipdS|ii|ƒdS(N(Rtconfthistory_recordR!tappend(R"tcmds((s/usr/share/yum-cli/shell.pyt_shell_history_add_cmds9scCstg}|djo|Syti|ƒ}WnBtj o6}|iid|ƒ|iotid‚qpnX|S(s@split the input using shlex rules, and error or exit accordinglysScript Error: %ssFatal error in script, exitingN( tNonetshlextsplitt ValueErrorRtcriticalRRt YumBaseError(R"t input_stringtinputste((s/usr/share/yum-cli/shell.pyt _shlex_split?s  cCsŽyt|idƒ}Wn'tj otid|iƒnX|iƒ}|iƒt|_x|D]}|i |ƒqfW|i dƒtS(Ntrs!Error: Cannot open %s for readingtEOF( topenRtIOErrortsysRt readlinestclosetTrueRtonecmd(R"tfdtlinestline((s/usr/share/yum-cli/shell.pytscriptOs    cCsct|ƒdjo|iƒddjon2|i|ƒ\}}}||ijoI|g}|iiidd|ƒ|d|jo|idƒtSn|djodS||i_ |ii i ddƒ|i_ |i |ii ƒ|i_ |iiidd|ii ƒ|i |ii ƒy|iiƒWntij onX|iiƒdS(Nit#targsttshells (Rtstript parselineRRtpluginsRtdo_helpRt cmdstringtreplaceR1R&R't parseCommandsRR-t doCommands(R"R=R R@txargs((s/usr/share/yum-cli/shell.pytdefault\s**     cCsdS(N((R"((s/usr/share/yum-cli/shell.pyt emptylinewscCsgtii|||||ƒ}xB|iiD]4}|i|ƒo|djo|i|ƒq+q+W|S(NRB(R R t completenamesRRt startswithR%(R"ttextR=tbegidxtendidxtrettcommand((s/usr/share/yum-cli/shell.pyRNzs  cCsxd}|d jod|}nD|d jod|}n)|djod |}n|iiƒ|ii|ƒdS( Ns Shell specific arguments: config - set config options repository (or repo) - enable/disable/list repositories transaction (or ts) - list, reset or run the transaction set run - run the transaction set exit or quit - exit the shell R R s× %s arg list: lists the contents of the transaction reset: reset (zero-out) the transaction solve: run the dependency solver on the transaction run: run the transaction RRsÜ %s arg [option] list: lists repositories and their status. option = [all] name/id glob enable: enable repositories. option = repository id disable: disable repositories. option = repository id R sÐ %s arg [value] args: debuglevel, errorlevel, obsoletes, gpgcheck, assumeyes, exclude If no value is given it prints the current value. If value is given it sets that value. (s transactionsts(srepos repository(Rt shellUsageR tinfo(R"targtmsg((s/usr/share/yum-cli/shell.pyRFs    cCsdg|_tS(Ns Leaving Shell(RR9(R"R=((s/usr/share/yum-cli/shell.pytdo_EOF¨s cCsdg|_tS(Ns Leaving Shell(RR9(R"R=((s/usr/share/yum-cli/shell.pytdo_quit¬s cCsdg|_tS(Ns Leaving Shell(RR9(R"R=((s/usr/share/yum-cli/shell.pytdo_exit°s cCs|i|ƒdS(N(tdo_transaction(R"R=((s/usr/share/yum-cli/shell.pytdo_ts´scCs6|i|ƒ\}}}|d jo#|iiti|iiƒƒnë|djo|iiƒnÍ|djo—y|ii ƒ\}}Wn,t i j o}|i i d|ƒtSX|djo(x;|D]}|i i d|ƒqÏWq2|iitidƒn)|djo|id ƒS|id ƒdS( NtlisttresettsolvesError building transaction: %sis Error: %ssSuccess resolving dependenciesRRAR (slistN(RDR(R tlogt logginglevelstINFO_2RtlistTransactiont closeRpmDBtbuildTransactionRR-RR,Rtdo_runRF(R"R=R R@tcodetmsgsR0RX((s/usr/share/yum-cli/shell.pyR\·s*      cCsµ|i|ƒ\}}}|djoâ|i|ƒ}|p/|iitid|t|ii|ƒƒq±|d}yt |ƒ}Wn*t j o|i i d||ƒdSXt |ii||ƒ|djoti|ƒq±|djoti|ƒq±n«|djoÄ|i|ƒ}|p/|iitid|t|ii|ƒƒq±|d}|iƒtjo|i i d ||ƒtSt|iƒ}t |ii||ƒ|djod|i_q±nÚ|djo¿|id d ƒ}|i|ƒ}|pGd|}|d it|ii|ƒƒ}|iiti|ƒtSt |ii||ƒ|iiod|i_nd|i_|iiƒn|idƒdS(Nt debuglevelt errorlevels%s: %sis(Value %s for %s cannot be made to an inttgpgcheckt repo_gpgcheckt obsoletest assumeyess Value %s for %s is not a Booleantexcludet,t s%s: R (RjRk(RlRmRnRo(Rp(RDR1R RaRbRctgetattrRR#tintR+RR,tsetattrt setDebugLevelt setErrorLeveltlowertBOOLEAN_STATESRR(tupRHtjointpkgSackReRF(R"R=R R@toptstvaltvalueRX((s/usr/share/yum-cli/shell.pyt do_configÔsX         "  cCs|i|ƒdS(N(tdo_repo(R"R=((s/usr/share/yum-cli/shell.pyt do_repository sc Cs¶|i|ƒ\}}}|d jo|i|ƒ}|p dg}n|iddƒ||i_|i|iiƒy|iiƒWnti j oq²X|ii ƒn|djo |i|ƒ}xá|D]î}y#|ii |ii i |ƒ}WnOtij o}|ii|ƒqÕtij o}|ii|ƒqÕXxd|D]\}y|iid|ƒWqWtij o-}|iidƒ|ii i|ƒtSXqWWd|i_qÕWnè|djoÍ|i|ƒ}x§|D]Ÿ}y|ii i|ƒ} WnOtij o}|ii|ƒqîtij o}|ii|ƒqîXx+| D]#} |ii i | } | iƒqfWqîW|ii iƒn|id ƒdS( NR^tenableditrepolisttenabletthisreposDisabling RepositorytdisableR(slistN(RDR(R1tinsertRR&R'RIRR-RJR|trepost enableRepot ConfigErrorRR,t RepoErrort doRepoSetupt disableRepoRRzR8t buildIndexesRF( R"R=R R@R&R‰RtchangedR0toffrepostrepoidR†((s/usr/share/yum-cli/shell.pyR sb       cCs+|i|ƒ\}}}|GH|GH|GHdS(N(RD(R"R=R R@((s/usr/share/yum-cli/shell.pytdo_testNsc Cst|iiƒdjory^|iiƒ\}}|djo)x!|D]}|iid|ƒqEWtS|iiƒ}Wn‡ti j o}|iid|ƒq‹t j o}|iidƒq‹t j o-}|i djo|iidƒq‡q‹X|d jo|i idƒnY|djo|i id ƒn"|djo|i id ƒn|i itid ƒ|iiƒndS( Niis Error: %ss Exiting on user canceli s Exiting on Broken Pipeiÿÿÿÿs(Transaction encountered a serious error.s.There were non-fatal errors in the transactionsTransaction didn't startsFinished Transaction(iiiÿÿÿÿ(RRttsInfoRfRR,Rt doTransactionRR-tKeyboardInterruptR5terrnoR RVRaRbRcRe(R"R=RhRiRXt returnvalR0((s/usr/share/yum-cli/shell.pyRgTs2    (t__name__t __module__t__doc__RR'R1R>RLRMRNRFRYRZR[R]R\R€R‚RR“Rg(((s/usr/share/yum-cli/shell.pyRs&       '      6  A ( R›R6R R)RtyumRt yum.constantstyum.logginglevelsRbR R(((s/usr/share/yum-cli/shell.pyts