σ Ύ[/\c@@s°ddlmZddlmZddlZddlmZddlZddlZddl m Z ddl m Z ddl mZejdƒZd e jfd „ƒYZdS( i(tabsolute_import(tunicode_literalsN(tchain(tcommands(t OptionParser(t_udnftInstallCommandcB@sΊeZdZiejd6ejd6ejd6ZdZde ej ƒƒZ e dƒZ ed„ƒZd „Zd „Zd „Zd „Zd „Zd„Zd„Zd„Zd„ZRS(uUA class containing methods needed by the cli to execute the install command. u install-nu install-nau install-nevraualternative-for({})uinstallu localinstallu,install a package or packages on your systemc C@s8|jddddtdƒdtjdtdƒƒdS( Nupackagetnargsu+tmetavaruPACKAGEtactionthelpuPackage to install(t add_argumentRRtParseSpecGroupFileCallback(tparser((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyt set_argparser1s cC@si|jj}t|_t|_t|_t|_tj|j |jƒ|j j setj |j ƒndS(uΔVerify that conditions are met so that this command can run. That there are enabled repositories with gpg keys, and that this command is called with appropriate arguments. N( tclitdemandstTruetsack_activationtavailable_repost resolvingt root_userRt _checkGPGKeytbasetoptst filenamest_checkEnabledRepo(tselfR((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyt configure7s      c C@s;g}g}g}|jƒ}|jj|j|jjjƒƒ|jjdgkr­|jjsm|jj r­|j |jjƒ|jj j r­t jjtdƒƒ‚q­ng}|jjrΨ|jjdgkrΨt jjrΙy>t jjj|jƒ}|j|jjd|jj j ƒWqΥt jjk rΕ}|jrcx!|jD]}|j|ƒqIWn|jr”x%|jD]}|jd|ƒqvWn|j} | rΖtjt jjj| ƒƒqΖqΥXqΨ|jj}n|jjr*|r*|j|jjƒ|jj j r6t jjtdƒƒ‚q6n |j ƒ}|r||r||j|ƒ|jj j r§t jjtdƒƒ‚q§n+|r§|jjdgkr§|j!|ƒn|jjdgkrΞ|j"|ƒ}nt#|ƒdksψt#|ƒdksψ|r7|jj j r7t jj$tdƒddj%|ƒd |ƒ‚ndS( Nu localinstalluNothing to do.tstrictu@iuUnable to find a matchtpkg_specu tpackages(&t_get_nevra_forms_from_commandRt _populate_update_security_filterRRtsacktquerytcommandt grp_specst pkg_specst_log_not_valid_rpm_file_pathstconfRtdnft exceptionstErrorRt WITH_MODULEStmodulet module_baset ModuleBasetinstallt MarkingErrorstno_match_group_specstappendterror_group_specstmodule_debsolv_errorstloggerterrortformat_modular_solver_errorsRt_inform_not_a_valid_combinationt_install_filest_install_groupst_install_packagestlentPackagesNotAvailableErrortjoin( Rterr_pkgsterrsterror_module_specst nevra_formstskipped_grp_specsR.tete_specR5((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pytrunEsX "-! &      9cC@s?g|jjD].}|t|jjƒƒkr |j|^q S(N(RR$tlistRCtkeys(RR$((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyR zscC@sdtd„|ƒ}xKt|jj|ƒD]4}tdƒ}tj||jjj j |ƒƒq(WdS(NcS@sd|S(Nu@((tg((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pytsuNot a valid rpm file path: %s( tmapRRR&RR6tinfoRtoutputttermtbold(RR%t group_namestpkgtmsg((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyR'€s cC@sCx<|D]4}tdƒ}tj||jjjj|ƒƒqWdS(NuNot a valid form: %s(RR6twarningRRNRORP(RtformstformRS((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyR9†s  cC@sΓg}|jjj}x§|jj|jjd|d|jjjƒD]x}y|jj|d|ƒWqCt j j k rΊt dƒ}t j||jjjj|jƒƒ|j|ƒqCXqCW|S(NRtprogressuNo match for argument: %s(RR(Rtadd_remote_rpmsRRRNRWtpackage_installR)R*t MarkingErrorRR6RMRORPtlocationR3(RR@RRRRS((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyR:‹s %cC@s{|jjdtƒy5|jj|t|jjjƒd|jjjƒWn,tj j k rv|jjjrw‚qwnXdS(Nt arch_filterR( Rt read_compsRtenv_group_installttupleR(tgroup_package_typesRR)R*R+(RR%((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyR;™s c C@s‡|jjjƒjd|jj|ƒƒ}|rƒtdƒ}tj|j|dj t t g|D]}|j ^q^ƒƒƒƒƒndS(Ntprovidesu/There are following alternatives for "{0}": {1}u, ( RR"R#tfiltermtalternatives_providetformatRR6RMR?tsortedtsettname(RRR#RStalt((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyt_report_alternatives£s  cC@sΒg}|jjj}x¦|jjD]˜}y |jj|d|d|ƒWq"tjjk rΉt dƒ}t j ||jj j j|ƒƒ|jj|ƒ|j|ƒ|j|ƒq"Xq"W|S(NRRUuNo match for argument: %s(RR(RRR&R0R)R*RZRR6RMRNRORPt_report_icase_hintRiR3(RRCRARRRS((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyR<¬s  " (uinstallu localinstall(t__name__t __module__t__doc__thawkeyt FORM_NAMEtFORM_NAt FORM_NEVRARCRcR_RItaliasesRtsummaryt staticmethodRRRGR R'R9R:R;RiR<(((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyR%s"      5     (t __future__RRtloggingt itertoolsRRntdnf.exceptionsR)tdnf.cliRtdnf.cli.option_parserRtdnf.i18nRt getLoggerR6tCommandR(((s</usr/lib/python2.7/site-packages/dnf/cli/commands/install.pyts