~Z>l?Z?de@fd YZAdS( i(t defaultdictt namedtupleN(tglobal_settings(t DebugValues(t _ActionPlan(tmediator_impl_matches(tPKG_OP_DEHYDRATEtPKG_OP_REHYDRATEt MSG_ERRORt MSG_WARNINGtMSG_INFOt ImagePlanc BseZdZdZdZdZdZeedZ dZ dZ dZ e d Ze d Ze d Zd Ze d Ze dZe dZe dZedZeeeedZdZedZeeeedZedZdZdZdZdZ eeeeee!i"eedZ#eeeeee!i"dZ$eeeeee!i"dZ%dZ&dZ'd Z(e e(e'Z)ee!i"d!Z*ee!i"d"Z+d#Z,d$Z-d%Z.e!i"d&Z/ed'Z0ed(Z1ed)Z2eee!i"d*Z3d+Z4d,Z5ee!i"d-Z6ed.Z7eee!i"d/Z8eee!i"d0Z9d1Z:d2Z;d3Z<d4Z=d5Z>e?d6Z@e?d7ZAd8ZBd9ZCd:ZDd;ZEed<ZFd=ZGd>ZHd?ZIed@ZJee!i"dAZKee!i"dBZLedCZMedDZNdEZOdFZPdGZQdHZRdIZSe?dJZTe?dKZUe?e!i"dLZVe?dMZWdNZXdOZYdPZZdQZ[e?dRZ\dSZ]dTZ^dUZ_e?dVZ`dWZadXZbe?dYZce?dZZded[Zeed\Zfd]Zgd^Zhd_Zid`ZjdaZkdbZldcZmddZndeZodfZpdgZqdhZrdiZsdjZtdkZudlZvdmZwdnZxe?eeeedoZye?e!ize!izee!i"dpZ{e?dqZ|RS(rs7ImagePlan object contains the plan for changing the image... there are separate routines for planning the various types of image modifying operations; evaluation (comparing manifests and building lists of removal, install and update actions and their execution is all common codeiiiicCs8||_||_||_||_t|_h|_d|_d|_d|_ d|_ d|_ d|_ d|_d|_h|_h|_d|_|i|_|i|_d|_h|_h|_h|_t|_d|_|djoti|}n|i|jpt|i |dS(Ni(!timaget_ImagePlan__progtrackt_ImagePlan__check_cancelt_ImagePlan__noexecutetsettvalid_directoriest saved_filest _ImagePlan__target_install_countt_ImagePlan__target_update_countt _ImagePlan__target_removal_counttNonet_ImagePlan__directoriest_ImagePlan__symlinkst_ImagePlan__hardlinkst_ImagePlan__licensest_ImagePlan__legacyt_ImagePlan__cached_actionst_ImagePlan__fixupstoperations_pubst list_excludest_ImagePlan__old_excludest_ImagePlan__new_excludest&_ImagePlan__preexecuted_indexing_errort_ImagePlan__match_instt_ImagePlan__match_rmt_ImagePlan__match_updatet_ImagePlan__pkg_actuatorstpdtplandesctPlanDescriptiont_optAssertionErrort_ImagePlan__setup_plan(tselfR topt progtrackt check_cancelt noexecuteR'((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__init__Qs:                         cCs|iitijo d}|Sd|ii}|iitijo|S|d7}x.|iiD] \}}|d||f7}qcW|iio|d|ii}n|i|i jo|d|i|i f}n|ii o$|ddi |ii }n|S( Ns UNEVALUATED: s%s sPackage version changes: s %s -> %s s Actuators: %s s# Variants/Facet changes: %s -> %s s Mediator changes: %ss ( R'tstateR(t UNEVALUATEDt_solver_summarytEVALUATED_PKGSt _fmri_changest _actuatorsR R!t_mediators_changetjoint get_mediators(R-tstoldfmritnewfmri((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__str__s&    cCsM|itititigjpt||_|i|ii |ii f|i_ |iitijo|ii i |dS|ii|ii|ii|_|ii i|x|iiD]s}|i|_|io|io|id7_q|io|id7_q|io|id7_qqWdS(Ni(R3R(R4R6t EVALUATED_OKR+R't_ImagePlan__update_avail_spaceR t avoid_set_gettobsolete_set_gett_new_avoid_obstlinkedt init_planRt _new_variantst _new_facetsR!t setup_plant pkg_planst origin_fmritdestination_fmriRRR(R-tplantpp((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt __setup_plans,         cCs|iititigjp#td|iititif|iitijodS|ii|iijot i |ii n|ii o|ii i nti|i_dS(Ns%s not in [%s, %s](R'R3R(tPREEXECUTED_OKR@R+R tversiontCURRENT_VERSIONt api_errorstImageFormatUpdateNeededtroott transporttshutdown(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytskip_preexecutes   cCs |iiS(N(R'R3(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyR3scCs |iiS(sRReturns a constant value indicating the type of operation planned.(R'R*(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt planned_opscCs |iiS(sGet the proposed fmri changes.(R'R7(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt plan_descscCs|iS(s)Return a pointer to the plan description.(R'(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytdescribescCs |iiS(s&get the (approx) number of bytes added(R't _bytes_added(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt bytes_addedscCs |iiS(s9get the (approx) number of bytes needed in download cache(R't _cbytes_added(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt cbytes_addedscCs |iiS(s0get the (approx) number of bytes space available(R't _bytes_avail(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt bytes_availscCs |iiS(s3get the (approx) number of download space available(R't _cbytes_avail(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt cbytes_availscCs0|i}||_|dj o ||_ndS(sPrivate helper function that must be called at the end of every planning operation to ensure final plan state is set and any general post-plan work is performed.N(R'R3RR7(R-tpdstatet fmri_changesR'((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt __finish_plans   c Csg}|dj o)g}|D]} || dq~} nd} xti|ti|D]|\} } | | jo|i| | fq^n|dj p|o5| djp | | jo|i| | fqq^q^W||i_|S(sGiven an installed set of packages, and a proposed vector of package changes determine what, if any, changes should be made to the image. This takes into account different behaviors during operations like variant changes, and updates where the only packages being updated are linked image constraints, etc.iN(RR t_ImagePlan__dicts2fmrichangest_ImagePlan__fmris2dicttappendR't_li_pkg_updates( R-tinstalled_dicttvectortli_pkg_updatest new_variantst new_facetsRet fmri_updatest_[1]tftaffectedtatb((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__vector_2_fmri_changess  )    cCs|iidt|i_dS(sTPrivate helper method used to mark the start of a planned operation.tstringN(R tget_last_modifiedtTrueR't _image_lm(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt __plan_op%scCs |dj o tii|}|in|iii}|djo tii|}|in|i|ii i ||jodt t fSt |i |pt |i|}t | ot |i|}||jpt|||fS(sXMerge any new facets settings with (possibly changing) inherited facets.N(RtpkgtfacettFacetst_clear_inheritedR tcfgtfacetstupdateREtinherited_facetstFalsetboolt _cmp_valuest _cmp_priorityt_cmp_all_valuesR+(R-Rot old_facetst facet_changetmasked_facet_change((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__merge_inherited_facets+s    cCss|i|\}}}|p|p|oUt|i_||i_|iii|i_||i_ ||i_ ||i_ n|ii |||_ t|iiidd}|o |ii|ii|n|djo t}nt|}|djo t}nt|||B}||_|o |i i|ii|n||||fS(s`Private helper function used to determine new facet and variant state for image.tpropertyt dehydratedN(t"_ImagePlan__merge_inherited_facetsRyR't_varcets_changeRGR RRt _old_facetsRHt _facet_changet_masked_facet_changeRR!Rt get_propertyR Ritget_dehydrated_exclude_funcRR(R-RnRot dehydratet rehydrateRRtold_dehydrated((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__evaluate_excludesWs8                 cCst}y||SWnstij od}|iiidto |ndtijo |n|p |nt}||SXdS(sRun the solver, and if it fails, optionally retry the operation once while relaxing installed parent dependencies.t latest_mdtPKG_REQUIRE_SYNCN( RRStPlanCreationExceptionR REtinsynctostenvironRy(R-t solver_cbtretry_wo_parent_depstignore_inst_parent_depste((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt __run_solvers   c Cs6t|tp |g}n|ii}|i|i||id|d|dt\}} t} x$|iD]} | t| O} quWx| i D]} |t i jo| |ijp#|t i jo'| |ijo| i | qn|i i|| i||fqW|i||| dS(sAdd a single actuator to the solver 'solver_inst' and update the plan. 'trigger_fmri' is pkg which triggered the operation and is only used in the plan. 'trigger_op' is the name of the operation which triggered the change, 'exec_op' is the name of the operation which should be performed. 'values' contains the fmris of the pkgs which should get changed.t pub_rankstinstalled_pkgstraise_not_installedN(t isinstancetlistR tget_publisher_rankst_ImagePlan__match_user_fmristMATCH_INST_STEMSRRtvaluestcopytpkgdefstPKG_OP_UNINSTALLtremoveR&taddtpkg_nametadd_triggered_op( R-t trigger_fmrit trigger_optexec_opRt solver_instRkRt matched_valst unmatchedttriggered_fmristmtt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__add_actuators,       c cstitig}|ididpdSy8|ididd}|ididd}Wntj odSX||jp ||jodSx[|idD]J}yti i |dd Wnti i j o qnX||fVqWdS( s7Read and decode pkg actuator data from action 'action'.tnamespkg.additional-Nt-iitvaluet build_releases5.11( Rt PKG_OP_UPDATERtattrst startswithtsplittKeyErrortattrlistR|tfmritPkgFmrit IllegalFmri(R-tactionR.tsupported_exec_opsRRRr((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__decode_pkg_actuator_attrss$ c Csxh}td}|o|idjodSti|ii}|ii}|i|i||id|d|dt \}} t } x"|D]} | t || O} qWx| D]} t | t i ipt i i| dd} nxw|ii|iii| t iiigD]E} x<|i| |D](\}}|i| |||||q@Wq'WqWdS( sCheck the manifests for the pkgs specified by 'fmris' and add them to the solver instance specified by 'solver_inst'. 'op' defines the trigger operation which called this function.signore-pkg-actuatorsttrueNRRRRs5.11(RtlowerR RhR tgen_installed_pkgsRRtMATCH_INST_VERSIONSRRRR|RRt get_catalogtIMG_CATALOG_INSTALLEDtget_entry_actionstcatalogtCatalogtSUMMARYt%_ImagePlan__decode_pkg_actuator_attrst_ImagePlan__add_actuator(R-tfmrisR.Rttrigger_entriestignoreRkRRRtpfmrisRRrRtRtefmri((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__set_pkg_actuatorss:       cCsx|iD]\}}}}xr|iiD]d\}}|o|i|jp|o|i|jo*||jo|ii|i||q)q)Wq WdS(s Add pkg actuators to PlanDescription. Skip any changes which would have been triggered by an actuator but were also requested explicitly by the user to avoid confusion. N(R&R'R7Rtadd_pkg_actuator(R-t user_pkgsttftpRRtbeforetafter((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__add_pkg_actuators_to_pd!s   c  s4i|\}} } i|} p&|p| pp| p |dj pgi_dSiitiii  |oi i|i n t |o@i i|i dd d\} | _nho niiho ih n f d}  }i| d|\}}i_oi ni |d|dd |d |i_it|i_td o|ii_ndS( sUse the solver to determine the fmri changes needed to install the specified pkgs, sync the specified image, and/or change facets/variants within the current image.NRRt reject_setcsii}ii}ot}g}ntiiiii |iii i }oi t i |n|i|ddiddd|dd\}}|||fS(NRntexcludesRt relax_allRt exact_installtinstalled_dict_tmp(R RBtget_frozen_listRt pkg_solvert PkgSolverRtIMG_CATALOG_KNOWNREt parent_fmrisR t_ImagePlan__set_pkg_actuatorsRRt solve_installR!(Rt avoid_sett frozen_listtsolvert new_vectort new_avoid_obs( t inst_dictR-t li_sync_opRRtvariantsRnRRRk(s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyRes8       RRmRnRoReRM(t_ImagePlan__evaluate_excludest_ImagePlan__any_reject_matchesRR'R7R RR RhRtmatch_user_stemst MATCH_ALLRRR#t get_variantsRt_ImagePlan__run_solverRDt!_ImagePlan__vector_2_fmri_changest#_ImagePlan__add_pkg_actuators_to_pdtstrR5Rtget_trim_errorst_solver_errors(R-RmRRoRnt pkgs_instt reject_listReRRRt uninstallt referencesRRRR(( RRRnRR-RRRRRks:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__plan_install_solver.sT         **     c CsL|i|id|d|d|d|d|d||itidS(sDetermine the fmri changes needed to install the specified pkgs, sync the image, and/or change facets/variants within the current image.RmRRoRnRRN(t_ImagePlan__plan_opt_ImagePlan__plan_install_solvert_ImagePlan__finish_planR(R6(R-RmRRoRnRR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__plan_installs  cCsR|i|id|d|d|d|d|d|dt|itidS( sDetermine the fmri changes needed to install exactly the specified pkgs, sync the image, and/or change facets/variants within the current image.RmRRoRnRRRN(R R RyRR(R6(R-RmRRoRnRR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__plan_exact_installs  cCs@||i_||i_||i_||i_||i_dS(N(R't _backup_bet_backup_be_namet_new_bet _be_activatet_be_name(R-t backup_betbackup_be_nametnew_bet be_activatetbe_name((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytset_be_optionss     cCs||i_dS(N(R't _update_index(R-R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__set_update_indexscCs |iiS(N(R'R(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__get_update_indexscCs|id|d|dS(sODetermine the fmri changes needed to install the specified pkgsRRN(t_ImagePlan__plan_install(R-RR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt plan_installscCs|id|d|dS(sWDetermine the fmri changes needed to install exactly the specified pkgsRRN(t_ImagePlan__plan_exact_install(R-RR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytplan_exact_installsc Cst}|ii|ii}t|ig}g}|i}|ii}|i|i d|x |ii D]}|ii |dt } || |\}} | p!|i |i |d8}qtn|i||fxn|i||D]Z} xE| D]=} |oPn| idjo| | ijo t }PqqW|oPqqW|d8}|i |i qtW|i|i |i||fS(Ntgoaltignore_excludesitdepend(RR RRt frozensett DEPENDENCYR tcount_installed_pkgst plan_startt PLAN_PKGPLANRt get_manifestRytplan_add_progressRiRRRt plan_donet plan_all_done( R-t get_mattrst use_solvertcattcat_infoRetpttrem_pkgsRrRtmattrstacttattr((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__get_attr_fmri_changessF        csiiiig}D]3}|jp||jo ||q#q#~ifdDfd}i|S(s|The following optimizations only work correctly if only facets are changing (not variants, uninstalls, etc).c3s*x#|]}|jo |VqqWdS(N((t.0Rr(Ro(s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys .s c s8|tfd|ididDfS(Nc3s2x+|]$}||jo |VqqWdS(N((R9Rr(RRo(s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys ;s Rtpatterns(Rt gen_facetsR!(RR0(RRoR-tchanged_facets(s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt get_fattrs3s   (R'RRHtextendt!_ImagePlan__get_attr_fmri_changes(R-RqRrR=((RRoR-R<s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__facet_change_fastpaths    )  cs+iifd}i|S(s|The following optimizations only work correctly if only variants are changing (not facets, uninstalls, etc).csdg}xQ|ididD]4\}}||jo t}n|i|q"W||fS(NRR:(t gen_variantsR!RyRi(RR0tmvarstvarianttpvals(R-t nvariants(s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt get_vattrsJs    (R'RGR?(R-RF((RER-s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__variant_change_fastpathDs c Csg}|iiD]}||iq~}|p|o |}qPtiSng}|iiD];}|i|jo%|io|iio||iqdqd~}t|t|}|oti d|n|S(sReturn publishers that have repositories configured. 'publishers' is an optional list of publisher prefixes to limit the returned results to. A PlanCreationException will be raised if any of the publishers specified do not exist, if any of the specified publishers have no configured repositories, or if all known publishers have no configured repositories.t no_repo_pubs( R tgen_publisherstprefixtmisctEmptyIt repositorytoriginsRRSR( R-t publishersRqRtall_pubst_[2]tpubtconfigured_pubstunconfigured_pubs((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__get_publishers_with_repos^s -  .  cCs|i|id|}|p|itidSg}|iid|D]}|||fqR~}|o|id|n|id||dj pt |itid|dS(NROtpubsRRRe( R t%_ImagePlan__get_publishers_with_reposRR(R6R RRRR+(R-RORRVRqRrRe((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__plan_common_hydration~s /cCs|i|dtdS(sDehydrate packages for given publishers. If no publishers are specified, packages for all publishers with configured repositories will be dehydrated.RN(t!_ImagePlan__plan_common_hydrationRy(R-RO((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytplan_dehydratescCs|i|dS(sRehydrate packages for given publishers. If no publishers are specified, packages for all dehydrated publishers with configured repositories will be rehydrated.N(RY(R-RO((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytplan_rehydratesc sCidfd}i\}}i}|o |dSiiip |dSo|o |dSt}|o% pti \}no%| pti \}n|o |dSdj pti t i ddS(sZDetermine the fmri changes needed to change the specified facets/variants.c s6idddditidS(NRoRnRRe(R RR(R6((RoR-ReRnR(s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytplan_install_solvers  NRe(R RRRR RERRyR+t!_ImagePlan__facet_change_fastpatht#_ImagePlan__variant_change_fastpathRR(R6( R-RoRnRR\RRR R0((RoR-ReRnRs:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytplan_change_varcetss6  c CsG|i|it|i_||i_|iii}|i }|i |i h}x~|iii D]j}|i |i x{dD]s}||ii|jo|ii||dj od|ii|d|t get_actionsRmRnRoRpRJR(R-targsttaggedt revert_dictt revert_dirsR3ttag_setRrRR6Rtt tag_partsRqt revertpathst overlaypathsRt needs_changet needs_deletet uncheckedtcheckedtunRN((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt plan_revertHs           6                 c Cs|tiijo ggfStii|ii|}yti|i}Wntj oggfSX|titii |ijo ggfSg}t i ti ||D]B}tii|||i jo|tii||qq~}g}g} x|D]}tii|otii| o| i|i|xti|D]i\} } } ti| i|joqmnx7| | D]+} | i|itii| | qWqmWq|i|i|qW|| fS(N(RRRR:R RUtstattst_devtOSErrortdirnametfnmatchtfiltertlistdirt_ImagePlan__get_directoriestisdirtislinkRit_ImagePlan__gen_del_acttwalk(R-Rtpatterntdir_loctmy_devRqRttpathsRRtdirpathtdirnamest filenamesR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__gen_matching_actss:  % E' %c Cs|ii}tii||}ti|}tti |i }ti |i o&ti i idti|d|Sti|i o)ti iid|ddddd|Sti iid|ddddd|SdS(NttargetRtmodetownerRUtgrouptbin(R RUR|RKtrelpathRtlstattoctRtS_IMODEtst_modetS_ISLNKtactionsRct LinkActiontreadlinktS_ISDIRt directorytDirectoryActionRt FileAction(R-RtrootdirtpubpathtpstatR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt __gen_del_acts   cCs~|i|i|i}|i|oh|i|i||i\}|_tt g}|i D]}|D] }||qsqi~}n1g}|ii dt D] }||q~}|o |i |idt|ng} xw|D]o} g} g} td} t}t}t| }ti}x|ii| |dt dt D]\}}}}|o)t }td} t}| i|n&| o|otd} t}n| i||||fq^W|ii|||tdh| id 6| d 6x| D]\}}}}|oO|o t}n|o t}nt}|ii|||d |inx+|D]#}|ii||td |qWx+|D]#}|ii||td |qWx+|D]#}|ii||td|qWq W| pqng}| D]}|dj o ||q/q/~} | i| | fqW|o|i|in| p|it i!dS|i |i"dt| x| D]\}}|i#|i"|ii$|dt }t%i&|i}|i'|||g|i(|i)|i*|ii+i|qW|i|i"|i,|it i!dS(s.Determine the changes needed to fix the image.torderedR#tOKtverboseRtERRORtWARNINGs%(pkg_name)-70s %(result)7sRtresults %ss ERROR: %ss WARNING: %ss %sNR$(-R RR RRR RR$tsortedRRRRyR)tPLAN_PKG_VERIFYRt_RR RttimeRRRiR R'tadd_item_messaget get_pkg_stemtdistinguished_nameRR-RR(R6t PLAN_PKG_FIXR,R+RmRnRoRpR R!RJR.(R-RR3R~RqRRrtproposed_fixesRQtrepairstpfmritentriest needs_fixRtfailedtmsg_typetffmrit timestampR6terrorstwarningstpinfotinfoRt_[3]RRRRN((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytplan_fix&s    ')                2  cCs)|ig|i_ti|i_dS(s\Create a plan that doesn't change the package contents of the current image.N(R R'R7R(R6R3(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt plan_noops  cCs.tg}|D]}||i|fq~S(N(tdictR(t fmri_listRqRr((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt __fmris2dictscCsSg}t|i|iD]+}||i|d|i|dfq!~S(N(RRiRkR(tolddicttnewdictRqRt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__dicts2fmrichangesscCs*|itijpt|iiiS(s.Check if evaluated imageplan suggests a reboot(R3R(t MERGED_OKR+R'R8treboot_advised(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyRscCs-|iitijpt|iiiS(s.Check if evaluated imageplan requires a reboot(R'R3R(RR+R8t reboot_needed(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyRscCs'|iitijpt|iiS(s(True if boot archive needs to be rebuilt(R'R3R(RR+t_need_boot_archive(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytboot_archive_neededscCs |iiS(sReturns a list of strings for all FMRIs evaluated by the solver explaining why they were rejected. (All packages found in solver's trim database.)(R'tget_solver_errors(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyRscCsA|o t|Sd}x"|iiD]}|d|7}q%W|S(Nts %s -> %s (RR'R7(R-tfulltoutputR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytget_plans  ccsp|iitijptt|ii}x!|iiD]}|i |q?Wx|D] }|Vq]WdS(s7Generates all the fmris which will be in the new image.N( R'R3R(R6R+RR RRJtupdate_pkg_set(R-tfmri_setRR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytgen_new_installed_pkgss ccsh|iitijptxD|iiD]6}|io&|ipt|i|ifVq*q*WdS(sjGenerates fmri-manifest pairs for all packages which are being installed (or fixed, etc.).N(R'R3R(R6R+RJRLtdestination_manifest(R-R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__gen_only_new_installed_infos   ccs{|iitijptxW|iiD]I}|io9|i|ijo&|ipt|i|ifVq*q*WdS(s[Generates fmri-manifest pairs for all the packages which are being removed.N( R'R3R(R6R+RJRKRLtorigin_manifest(R-R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__gen_outgoing_infos  cCs|i||id|S(sXGenerates actions of type 'atype' from the packages in the future image.t implicit_dirs(t#_ImagePlan__gen_star_actions_bytypeR(R-tatypeR ((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt gen_new_installed_actions_bytypes cCs|i||i|d|S(sPGenerates actions of type 'atype' from packages being installed.R (t9_ImagePlan__gen_star_actions_bytype_from_extant_manifestst'_ImagePlan__gen_only_new_installed_info(R-R R R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt%gen_only_new_installed_actions_bytypescCs|i||i|d|S(svGenerates actions of type 'atype' from packages being removed (not necessarily actions being removed).R (Rt_ImagePlan__gen_outgoing_info(R-R R R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytgen_outgoing_actions_bytypesc cs2|iitijpt|o*|djo t}qNtiii }nx|D]}|i i |dt }|o t }nxJ|i|d|iD]0}|o|i|idn||fVqW|oLxI|i|iD]1} | |jo|d| dd|fVqqWqXqXWdS(sGenerate installed actions of type 'atype' from the package fmris emitted by 'generator'. If 'implicit_dirs' is True, then when 'atype' is 'dir', directories only implicitly delivered in the image will be emitted as well.RR$RRtimplicitRN(R'R3R(R6R+RR|RRRR R+RyRRR!RRtget_directories( R-R t generatorR tdaRRtdirsR6td((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__gen_star_actions_bytype s*      c cs|iitijpt|o*|djo t}qNtiii }nx|D]\}}|o t }nxG|i |d|D]0} |o|i | i dn| |fVqW|oIxF|i|D]1} | |jo|d| dd|fVqqWqXqXWdS(sGenerate installed actions of type 'atype' from the package manifests emitted by 'generator'. 'excludes' is a list of variants and facets which should be excluded from the actions generated. If 'implicit_dirs' is True, then when 'atype' is 'dir', directories only implicitly delivered in the image will be emitted as well.RRRRRN(R'R3R(R6R+RR|RRRRRRRR( R-R RRR RRRRR6R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt/__gen_star_actions_bytype_from_extant_manifests+s*       cCsq|idjoZtd|iddtD}|i|iiiddddg||_n|iS( s/ return set of all directories in target image css0x)|]"}tii|didVqWdS(iRN(RRtnormpathR(R9R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys Ts RR t/tvarsvar/sadmsvar/sadm/installN( RRRRRyRR timgdirtrstrip(R-R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__get_directoriesMs   cCs=|idjo&td|idD|_n|iS(s- return a set of all symlinks in target imagecss&x|]\}}|idVqWdS(RN(R(R9RtR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys es RcN(RRRR(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__get_symlinksas cCs=|idjo&td|idD|_n|iS(s. return a set of all hardlinks in target imagecss&x|]\}}|idVqWdS(RN(R(R9RtR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys ns RbN(RRRR(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__get_hardlinksjs cCs=|idjo&td|idD|_n|iS(s- return a set of all licenses in target imagecss&x|]\}}|idVqWdS(tlicenseN(R(R9RtR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys ws R$N(RRRR(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__get_licensesss cCs=|idjo&td|idD|_n|iS(s3 return a set of all legacy actions in target imagecss&x|]\}}|idVqWdS(R|N(R(R9RtR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s tlegacyN(RRRR(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt __get_legacy|s cCstd|D}td|D}t|djp&t|djot|djodSt|t|jot|djodSt|djpt|ddidjod|dfSxd|D]%}d|dijo d|fSqW|diihd d 6d d 6d d 6d|fSntid}t |d|}t |d|}||jo%t dt ||DodSd|fS(ssCheck whether multiple action types within a namespace group deliver to a given name in that space.css x|]}|diVqWdS(iN(R(R9Rt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s css x|]}|diVqWdS(iN(R(R9Rt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s iitnothingRtfixupRt0755RRURRtkeycss-x&|]\}}|d|djVqWdS(iN((R9totn((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s terrorN(R(N(R(N( RRRR+RRRtoperatort itemgetterRtalltzip(RtoactionstntypestotypesRttsort_key((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__check_inconsistent_typess09  cCsCt|djp*t|t|jo djno4t|djotd|DodSdSt|t|joZtd|DodSt|djptd|DodSd|dfS|id d |id d t|t|jo%td t||DodSt|d jod}}x|D]\}}|idjo3|iiddjod|ijo |}ql|idjo#|iiddjo |}qlqlW|o<|o5t i |ddg}|od|t i fSdSnd|fS(sCheck whether we deliver more than one action with a given key attribute value if only a single action of that type and value may be delivered.iicss/x(|]!}|diiddjVqWdS(iRRN(RRk(R9Rt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s Rcss/x(|]!}|diiddjVqWdS(iRRN(RRk(R9Rt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s css&x|]}d|dijVqWdS(RiN(R(R9Rt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s R(R)R+cSst|dS(i(R(R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytscSst|dS(i(R(R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyR8scss-x&|]\}}|d|djVqWdS(iN((R9R,R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s iRRRRRR.N(soverlayN(soverlayN(snothingN(snothingN(soverlayN( RtanyRtsortR1R2RRRkR t#_ImagePlan__find_inconsistent_attrsRSt InconsistentActionAttributeError(RR3t overlayableRR6tignoredR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__check_duplicate_actionssL=        cst}g}xti|dD]\}didjoddijoq"n||joq"ndi|d}| p d|jo|i|q"ntfd|Dp|i|q"ndidjpdidjodiid|diidjondiid |diid jp-diid |diid jo|i|q"n|i |fq"W|S( s0Find all the problem Action pairs. 'ignore' is an optional list of attributes to ignore when checking for inconsistent attributes. By default, all attributes listed in the 'unique_attrs' property of an Action are checked. iiRRc3s>x7|]0}|dijo|jo |VqqWdS(iN(t unique_attrs(R9R(ta1R(s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys 3s RcRbRdsmediator-versionsmediator-implementation( Rt itertoolst combinationsRRt differencesRR9RkRi(RRtseentproblemsta2tdiffs((RARs:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__find_inconsistent_attrs s0  (   (--- cCsti|}ti|}t|t|jo d|fS| o | odSt|t|jodS|ddidjod|dfSx1|D]%}d|dijo d|fSqWd SdS( slCheck whether we have non-identical actions delivering to the same point in their namespace.R.NR(iRR)R(snothingN(snothingN(R R;RRRR(RR3t nproblemst oproblemsRt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__check_inconsistent_attrsJs cCs|ii|d\}}}|djoUti|i}|o|g}g}ng}|g}|||f|i| s c3s7x0|])}ii|ii|jVqWdS(N(RRk(R9Rt(toactR6(s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s N(RiRR+RkRtranget refcountabletglobally_identicalRRRRaR1R@RyR(R-tnewtoldtnsR+RR3tunmatched_old_actionsRwtnext_keyRtmatchedtanameRqtopfmri((RRRR6s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt __fast_check sz                 c Cslx|iD]\}}|i|g}|ii|iit|djot|djoq nt|tjo0|i||i ||t i |oq qntt d|Ddjpt tt d|Ddjpt |dd} | i o:| io0|i||i||t i|oq qq | io0|i||i||t i|oq qq q Wx|iD]\}}|ii|iit|djoqn||joqntd|Doqn|dd} | i o:| io0|i||ig|t i|oqqdqqWdS(sZCheck all the newly installed actions for conflicts with existing actions.iicss x|]}|diVqWdS(iN(R(R9Rt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys  s css x|]}|diVqWdS(iN(R(R9Rt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys  s icss&x|]}|didjVqWdS(iRN(R(R9Rt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys 6 s N(t iteritemsRkR R,R{Rttypetintt_ImagePlan__process_conflictst$_ImagePlan__check_inconsistent_typesRStInconsistentActionTypeErrorRR+RRt#_ImagePlan__check_duplicate_actionstDuplicateActionErrort$_ImagePlan__check_inconsistent_attrsR<R9( R-RRR}RRnR+RR3Rw((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__check_conflicts sb   &   **            cCsOd}t}x6|iD](\}}t|tjo ti}n|}x|iD]\}}t|djoq^n||gdj o|i|q^n|ddi oC|ddi o1ti |gdj o|i|q^qCq^|ddi o-ti |gdj o|i|q^q^q^WqW|S(swReturn the keys in the namespace dictionary ('nsd') which map to actions that conflict with each other.cWsdS(N(R(R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytnoopG siiN( RRRRR RRRRRRRR(tnsdRtbad_keysRtkey_dictt type_funcR+R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt_check_actionsB s4         cCs/x(|iiD]}|i|iq WdS(s_Now that we're done reading the manifests, we can clear them from the pkgplans.N(R'RJtclear_dest_manifesttclear_origin_manifest(R-R((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__clear_pkg_plansc s  cCsotdo|idSg}|i}|i|itd|iD}|p|i|i|idStd|ii D}||}tg}|i i D]$}|i o|t |i qq~}tid} ttiiid| } tdti| | D} |i|i|ii|i} |ii} |iitj}ti}x| iD]\}}|i|itd|Doqn|i |i!||i"}|i |i#||i$}|o|i%|||nt&i't(i(| i)d d t(i*i+i,}z|~}|i-|i-tti.|i/|i/}|i0||t1| ||||t|i/}|i0||t2| ||||B|WdQX|i3|||||qW~|i| i4|i5|i|i|ot6i7|ndS( s%Find all instances of conflicting actions. There are three categories of conflicting actions. The first involves the notion of a 'namespace group': a set of action classes which install into the same namespace. The only example of this is the set of filesystem actions: file, dir, link, and hardlink. If more than one action delivers to a given pathname, all of those actions need to be of the same type. The second category involves actions which cannot be delivered multiple times to the same point in their namespace. For example, files must be delivered exactly once, as must users, but directories or symlinks can be delivered multiple times, and we refcount them. The third category involves actions which may be delivered multiple times, but all of those actions must be identical in their core attributes. s"broken-conflicting-action-handlingNcssx|]}t|VqWdS(N(R(R9R<((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s cssx|]}t|VqWdS(N(R(R9R<((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s RR+css+x$|]\}}|t|fVqWdS(N(R(R9RR}((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s cssx|]}|i VqWdS(N(R(R9tc((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s itaccess(8Rt_ImagePlan__clear_pkg_plansR R)R{RRR-R RR'RJRLRR/t attrgetterRR|Rttypest itervaluesRRBtgroupbyR,t _load_actdictt_get_stripped_actions_filet_load_conflicting_keystweakreftWeakValueDictionaryRR1t_ImagePlan__seedRR!RR t_ImagePlan__fast_checkt contextlibtclosingtmmaptfilenot ACCESS_READt__exit__t __enter__Rtchaintiterkeyst_ImagePlan__update_actRRyt_ImagePlan__check_conflictstcloset_ImagePlan__evaluate_fixupsRStConflictingActionErrors(R-RnR3t new_fmrist old_fmrist gone_fmrisRqRtchanging_fmristkfRtnamespace_dictRRtconflict_clean_imageRRR}RRRQtmsfRi((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__find_all_conflictsk s~     *    &         cCstii|i}|i|S(saThis is the default function used by get_actions when the caller provides no key.(R|RRRcR(RR6t attr_name((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytdefault_keyfunc scCs |iS(sPKeyfunc used in evaluate when calling get_actions for hardlinks.(tget_target_path(RR6((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pythardlink_keyfunc scCs|djo |i}n||f|ijo|i||fSh}xE|i|D]4\}}|||}|i|gi|qXW||i||f<|i||fS(sReturn a dictionary of actions of the type given by 'name' describing the target image. If 'key' is given and not None, the dictionary's key will be the name of the action type's key attribute. Otherwise, it's a callable taking an action as an argument which returns the key. This dictionary is cached for quick future lookups.N(RRRRRfRi(R-RR+RR6RR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyR s   cCs<|o*|ii|d|p |iid|StiSdS(sReturn manifest for pfmriR$tintentN(R R+R'RRRRS(R-RRR$((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__get_manifest s  c Cs|iod St}|i|i|i|i|i|i|oh|i|d }|o9|i|ijo d}q|i dt }n|i dt }nB|i|d }|i|jo|i dt }nd }h|i i d6|d6|d6|d6}ddi g}|D]0}||d j o|d |||fq4q4~} |o d | fS|o | d fSd Sd S( s[Return intent strings (or None). Given a pair of fmris describing a package operation, this routine returns intent strings to be passed to originating publisher describing manifest operations. We never send publisher info to prevent cross-publisher leakage of info.tunknowntanarchyt operationtold_fmritnew_fmrit references(%s)t;s%s=%sN(NN(NN(RRRRR#R$R%Rkt get_publishertget_fmriRyR'R*R:( R-RRtenabled_publisherst_ImagePlan__match_intentRRRqR+R<((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__create_intent! s>       7  cCs|djo|iii}nA|djo|iii}n!|djo|iii}nt|o|||told_intnew_int max_itemst same_excludesRNRRe((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__evaluate_pkg_plans sr )            c(s|ii o0|ii o"|ii ott|iiStt}tt}xti|i d|i dD]\}}|i i d}|pq{n|i i d}|ot i i|d}n|i i d}|p|pq{n|i i d} ||i| ||f||i di|||||fq{W|ii} t} x|iD]\}} d} }} }}}|iii |}| i |}|o@|i d }|i d } |i d }|i d }nU|djoG|o@|i d }|i d } |i d }|i d }nxt| d tiD]\}}}| djo||joqtqn|djot||pqtqn|}|p d}n| djo|}|} n|djo|}|}n=|o5d|jo(ti|d}|o |}q]nPqtW|oA||i d jpt||i d  o| i|nh||<|o|||d %s css*x#|]}x|D] }|VqWqWdS(N((R9Rwtmed_link((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys 1s N(saddedschanged(+R'R9RR7RRt_cfg_mediatorsRBRRRRkR|RQtVersionRRTRRfRtmedtcmp_mediationsRtparse_mediator_implementationRdRURaReRRjRfRgRRiRKt EmptyDictRR_RVRRRjRi((R-tmediated_removed_pathstprop_mediatorstmediated_installed_pathsRtRRdtmed_vertmed_implt med_priorityRrtchanged_mediatorsRtmed_ver_sourcetmed_impl_sourcet med_impl_vert mediationt cfg_mediationt opt_prioritytopt_vertopt_implRutimpl_vert act_removalsRutptypeRqRrt prop_med_vert prop_med_implt cfg_med_vert cfg_med_implt new_med_vert new_med_implRwRRxRZRyRq((R^s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__mediate_linksM sX                                         '       )               4c sE|ii}x.|iiD] i|iiqWx|D]joqDn|i}iddjo|idd |d=niddjo+|idd |idd |d=n|o|s N(R'R`RfRfRRkRjRRRyR9RiR9RR(R-RgRrt new_mediation((RpRRgs:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__finalize_mediationcs^                     c?!Csh|i}|iid+joh|i_n|iio0t|ii}|pt|i_ qxn t|i_ xu|ii D]g}|i o|i o|i d7_ q|i o|id7_q|i o|id7_qqWg|i_|i|i|iii}|i_t}x|ii D]}|i|ix|iD]w\}}|idjo|i |ii|id|ii'i-D]*}||iijo|ii|=q q Wx>|ii&i-D]*}||iijo|ii|=qJqJWt.i/|i_0|i1|i|i2p|i3n|i|i4t5dd}h}h}d}xt6|iiD]\}}|d+joqn|i|i4t7}|i8idjo3t9i:i;|i8id |i<jo t}n|i8idjp|i8idjoQt9i:i;|i8id }|i8idjo|i=}n |i>}||jot}|i8iid} | |iijo|i8iid } |i8iid } |ii| id }|o|i }n|ii| id }|d+j o| |jo t7}n|d+j ot!| | o t7}qqq`nu|i8idjo'|i8id|i?jo t}n;|i8idjo'|i8id|i@jo t}n|pEd+|ii|d|iQijo+|iQid|jo|iQid}$||$iR}%|ii|%i8}&tC|&||$iCjptS|iQid |&id jod|#i|&|iQfd+|ii|%|>|>f|iiojo|iioip|>|>fn~q'W|ii ild(tjiqd*|i1|id|ii d+jot|i_ nt.ir|i_0d+S(-sGiven a set of fmri changes and their associated pkg plan, merge all the resultant actions for the packages being updated.itusertusernameRt groupnameRcRbRdsmediator-versionsmediator-implementationRQR`RtdrivertaliasRtConsolidationEntrysidx idcSs#t|to t|S|SdS(s#handle key values that may be listsN(RRR&(tv((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pythashifyFs RR$R&R|RRYs%s:%sRR\Rtcontentcssx|]}|dVqWdS(iN((R9Rt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys &s Rcssx|]}|dVqWdS(iN((R9Rt((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys *s RVRdRUicss&x|]}|id|fVqWdS(RN(R(R9R;((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys ns iR+treverseRLN(sremoval_actionssinstall_actionssupdate_actions(sR R'RfRR thas_boot_archivettupletget_ramdisk_filelistRRRJRKRLRRRRVR)tPLAN_ACTION_MERGERRgR`RR,tgen_removal_actionsRt removed_usersRtremoved_groupsRiRRktget_short_versionRRRUt _rm_aliasestgen_update_actionst added_userst added_groupsRRfRRdtgen_install_actionsRiR(RR3R-t nothingtodot_ImagePlan__find_all_conflictstPLAN_ACTION_CONSOLIDATERRaRyRbRRRRt_ImagePlan__get_symlinkst_ImagePlan__get_hardlinkst_ImagePlan__get_licensest_ImagePlan__get_legacyRRRgRcRRhR8t scan_removalR*RRRRRRRRetidxR+RR^R]t scan_installRRtManifestt set_contentR R!t differenceR>tPLAN_ACTION_MEDIATIONt_ImagePlan__mediate_linksRiRt_ImagePlan__finalize_mediationtPLAN_ACTION_FINALIZERRRRt scan_updateR/R0R:RR_R7RRR@(?R-R3tramdisk_prefixesRNRrRfRRbRRdt src_versiontsrc_implRpt cfg_versiontcfg_impltrmRwRt cons_namedt cons_genericRRqRrRtlpatht inst_linkst dest_versiont dest_implRtretfnametplan_posRtRst dest_pkgplanst new_updatest cache_nametindextratkeyvaltnkvRqtnu_srctnu_dsttnu_addtnu_chgtnu_remRQReRgRxRyRt l_refresht l_actionsRt unique_linkst_[4]R;tremsorttaddsorttpairR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__merge_actionssz                                 &                &                 !  $ !   ,      7 &       5     cCs|iititigjoF|iip7|iip*|iidj p|ii p |ii S|iiti jo9|ii p*|iip|iidj p |ii Sdpt d|iidS(s5Test whether this image plan contains any work to do is+Shouldn't call nothingtodo() for state = %dN( R'R3R(R6RR7RGRHRR9RJR@R+(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyRs        c Cs\|iitijpt|ii|iidtjoti |i_t i n|i oti |i_dS|ii|iijot i|iintdo|ii|idt}n|iod}y|iiti|i|ii|iid|id|i}|iosy|i|iiWqt i!j oC}t i"|t#i$t#i%|_&|i'|ii(qXnWn<t i)j o-}t i"|t#i$t#i%|_&nX~n|i*|ii+|ii,jo+t i-|ii+|ii,t.dn|ii/|ii0jo+t i-|ii/|ii0t.dn|ii1i2i3d }}}xD|ii4D]6}|i5\}} || 7}||7}|d 7}qW|ii6|||g} yx|ii4D]}y|i7Wqt i8j o}| i9|qt:j o^}|i;t;i<jot i=|i>n|i;t;i?jot i@|i>nqXqW| ot iA| ny1x*|ii4D]}|iB|i|iCqWWnt:j o^}|i;t;i<jot i=|i>n|i;t;i?jot i@|i>nnFt iDt iEfj o-}|o|iFo|iF|_FnnX|ii1iG|iiHWnti |i_nXti |i_tdoA|ii|idt} tIiJiKd || || ~~ ndS( sInvoke the evaluated image plan preexecute, execute and postexecute execute actions need to be sorted across packages RwNtplandesc_validatetreset_volatilesR/RsDownload cachesRoot filesystemiiR)(LR'R3R(R@R+RzR RxRytPREEXECUTED_ERRORRSRRRPRQRRRTRURtgetstatet update_indexRtupdate_index_dirtindexertIndexerR+RR R tcheck_index_existencetcheck_index_has_exactly_fmristgen_installed_pkg_namestsetIncorrectIndexFileHashtWrapSuccessfulIndexingExceptiont tracebackt format_exct format_stackR"trebuild_index_from_scratchRtIndexingExceptionRAR^RbtImageInsufficentSpaceRR\R`RVtstatstresetRJt get_xferstatstdownload_set_goalt preexecutetPkgLicenseErrorsRiRRRtPermissionsExceptiontfilenametEROFStReadOnlyFileSystemExceptiontPlanLicenseErrorstdownloadRtInvalidDepotResponseExceptiontTransportErrort _autofix_pkgsRWt download_doneR|RKt json_diff( R-tpd_json1tindRtnpkgstnfilestnbytesRtnftnbt lic_errorstpd_json2((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyRs                            c Cs |iitijpt|ii|iidtjoti |i_t i ny%x|ii D]}|i qnWWnAtj o5}|itijot i|innX|i|ii|iijo+t i|ii|iitdn|ioti|i_dS|i}|i|i|i}|p|iin|iipvt i!i"|ii#}t$i%}xO|i&D]=\}}t i!i"||jo|ii'i(|PqqWn|ii'i)|i|ii'i*|ig} yy|i+|i,t-|ii.|i+|i/t-|ii0|i+|i1t-|ii2x=|ii.D]/\}} } |i3| | |i4|i,qW|i5|i,x9|ii6i&D]%\} } t7i8i9| | |iqWg|i_.x=|ii0D]/\}} } |i:| | |i4|i/q3W|i5|i/g|i_0x=|ii2D]/\}} } |i;| | |i4|i1qW|i5|i1|i<|i|i=g|i_2xM|ii o?|ii i>}|i?| i@|iA|iBfd}qW|iiD| |i|iiEp |iiFo,|iiG|iiH|iiI|iiJn|iiK|iiL|iiMtNtOfjo-|iiPiQdd|iR|iiSnWntj o}|itijp|itiTjot i|inr|itiUjot iV|inI|itiWjo5tXiYiZi[}t i\|td|innXWntXiYi]j ogt^i_\}}}ti |i_y|ii'i`|iWnnXt ia|gd|nlt^i_\}}}ti |i_z|ii'i`|iWd|d|XnX|ii'ib|i|iicd|i|idti|i_|iieh|_ftg|_hh|_itg|i_jtg|i_kh|i_lh|i_m|ino|iiotpiq|i|iir|iisd|id|it}yJ|o|iun|p |ivo|iwg| f|inWn txj o ntyizj o(t i{|t|i}t|i~ntj o}~yPtpiq|i|iir|iisd|id|it}|i|iiWn6tj o*}t i{|t|i}t|i~nXt i|t|i}t|i~nX|idj o |iq ndS( sInvoke the evaluated image plan preexecute, execute and postexecute execute actions need to be sorted across packages RwsRoot filesystemNRRsA link targeting itself or part of a link loop was found at '%s'; a file or directory was expected. Please remove the link and try again.R/R(R'R3R(RPR+RzR RxRytEXECUTED_ERRORRSRRJt cacheloadRRRRRRAR\R`RRRt EXECUTED_OKR tset_major_phaset PHASE_EXECUTEt_ImagePlan__is_image_emptyt_remove_fast_lookupst is_liverootRRRRUtzonetlist_running_zonesRR8tset_zonet exec_preptexec_pre_actuatorstactions_set_goalt ACTION_REMOVERRVtACTION_INSTALLRdt ACTION_UPDATERUtexecute_removaltactions_add_progresst actions_doneRRt DriverActiontremove_aliasestexecute_installtexecute_updatetactions_all_donetPHASE_FINALIZERjt postexecuteRiRLRKRtupdate_pkg_installed_stateRR9timage_config_updateRGRHRft_avoid_set_saveRDR*RRRt set_propertyRt save_configtEPERMRRtELOOPR|RRt UnknownActiontActionExecutionErrort ActionErrortsystexc_infotexec_fail_actuatorstInvalidPackageErrorstexec_post_actuatorst_create_fast_lookupst_ImagePlan__save_release_notest _executed_okRRRRt_userst_groupst _usersbynamet _groupsbynameRRRRR+RR!tsetupRtclient_update_indextKeyboardInterruptRt$ProblematicPermissionsIndexExceptiontWrapIndexingExceptionRRRt ExceptionRRRR"(R-RRR3t empty_imageRUtrzonestzRt executed_ppRbRRtaliasesR6texc_typet exc_valuetexc_tbR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytexecutecsd     0                                                               cCs6y|iiitSWntj otSXdS(N(R RtnextRt StopIterationRy(R-((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__is_image_emptys c(Cs-|ptS|id}g}g} g} g} g} g} g}g}g}t}tt|}t}g}x~|D]v}yE|idd}|d}d|jp d|jotii}|i|n=|idp|idotii }n tii }|tiijotii ||}ntii ||}t |}||jo|i|wn|i||i||i||i|i|i|Wqtiij o}|i|qXqW|}~~tt|g}|D]}|tq~}|dj o!|tijpt|}nE|tijo|i|i}n|i|i}|i}x|D]{\} }!xlt||||D]U\}}}}"|"o| |"joqn||!|io||i|!qqWqWh}#x|D]}$t||$}%|%djo| i|$qA|%djo.|$|jo!| i|$t||$fqAx+||$D]}&|#i|&gi|$qWqAWxG|#D]?}!t|#|!djo"| it |!g|#|!qqW|tijo| | } } nY|ti!joHg}'|i|ii"D]}!|!|#jo |'|!qzqz~'} n|p1|o| p#| p| o|p| p| o4t#i$d | d |d | d | d | d| n|o|#St|#i%S(sGiven a user specified list of patterns, return a set of matching package stems. Any versions specified are ignored. 'match_type' indicates how matching should be restricted. The possible values are: MATCH_ALL Matching is performed using all known package stems. MATCH_INST_VERSIONS Matching is performed using only installed package stems. MATCH_UNINSTALLED Matching is performed using uninstalled packages; it is an error for a pattern to match an installed package. Note that patterns starting w/ pkg:/ require an exact match; patterns containing '*' will using fnmatch rules; the default trailing match rules are used for remaining patterns. Exactly duplicated patterns are ignored. Routine raises PlanCreationException if errors occur: it is illegal to specify multiple different patterns that match the same pkg name. Only patterns that contain wildcards are allowed to match multiple packages. 'raise_unmatched' determines whether an exception will be raised if any patterns didn't match any packages. 'raise_not_installed' determines whether an exception will be raised if any pattern matches a package that's not installed. 'return_matchdict' determines whether the dictionary containing which patterns matched which stems or the list of stems is returned. 'universe' contains a list of tuples of publishers and package names against which the patterns should be matched. s Build-ReleaseR]iit*t?spkg:/Rtalready_installedtillegaltmissing_matchestmultiple_matchest multispectunmatched_fmrisN(&RRRRR|Rt glob_matchRRtexact_name_matcht fmri_matchtMatchingPkgFmriRRRRiR,R&RR2RR RR+RRRRt pkg_namesRRRfRtMATCH_UNINSTALLEDtnamesRSRRi((R R:t match_typetraise_unmatchedRtreturn_matchdicttuniversetbreleasetillegalstnonmatcht multimatcht not_installedRDR@tmatchersRRVtwildcard_patternsREt npatternstpattpartstpat_stemtmatcherRtsfmriRRqRqRoRJR1tpkg_pubRRRt matchdictRR;RtRQ((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyRs/               3      ! !%  cksg}g}g} g} g} g} g} t}g}g}g}g}t}tt}g}tt|}ti}|titigjo td|i D}n|i d}t}t}g}xU|D]M}y|i dd}|d}d(}t |djo|d}nd|jp d|jotii}|i|n=|idp|id otii}n tii}|tiijotii||} ntii||} |pn\d|jpd|jp |d jotii||| _ntii||| _t| }!|!|jo|i|wn|i|!|i||o't| id d(o|i|n|i||i| i|i| i|i| Wqtiitii fj o}"|i|"qXqW|}~~tt!|g}#|D]}$|#tqW~#}%t}&t}'h}(|ti"jo(|i#|i$})ti%i&i'g}*n|i#|i(})g}*|i)}+x|)i*D]},xt!|||||D]\}}} }-}.||,| i+pqnxM|)i,|,d |*D]6\}/}0|-o!|/i-|-tii. oq[nx|0D]\}1}2|1i}3|.o|.|3joqnL|tijo|1i+|joqn%|1i+|jo|&i|qn|2d d}4g}5t/}6xh|2i0dti1D]Q}7yti2i3|7}8Wnti2i4j o qAnXt5i6|4joN|8i7djo>|8i ddjo*|5itii|8i ddqAn|8i7djoqAn|8i d}9|9idpqAn|8i d}:t8|:tj};x[|+i9D]M\}<}=|<|9jo4|;o |=|:jp|; o|=|:jo t:}6PqAqAWqAW|6o|'i|qn|%|i;|1i+gi|1|. og|ti"joW|,|joJ|||,dt:jo1||,|3jo |(i;|ti|3n|2d d}4t5i<|4jo|i|1nt5i6|4jo|5||1t |%|>djo|>|jotg}?|%|>D]H}@|?|@t=t>i?g}A|%|>|@D]}1|A|1|jq~Afq~?}Btt:t/gt|Bi jo/x,|BD] }@|B|@o|%|>|@=q`q`WqqqWx|D]}>t |%|>djo|>|jog}C|%|>D]3}@|%|>|@D]}D|D|jo |C|Dqqq~C}Etg}F|ED]!}1||1D]}G|F|Gi+q( q ~F}Hx8|%|>i@D]"}@|@|Hjo|%|>|@=qX qX WqqWh}Ix)|D]!}>t |%|>}J|JdjoM|>|'jo|i|>q |>|&jo| i|>q |i|>q |Jdjod|>|joW| i|>tg}K|%|>D](}L|%|>|LD]}1|K|1iAqJ q8 ~Kfq x=|%|>i9D]+\}M}N|Ii;|Mgi|>|Nfq Wq Wh}Ox|Ii9D]\},}Pg}Q|PD]0\}>}N|>|jo|Q|>t|Nfq q ~Q}Rt/}S|Ro]|R}Tx|PD]H\}>}N|>|jo/|>idp|>ido t:}SPq} q5 q5 Wng}U|PD]0\}>}N|>|jo|U|>t|Nfq q ~U}Vg}W|VD]C\}>}N|>idp|>ido|W|>t|Nfq q ~W}T|To t:}Sn|V}T|Tdd}Xx"|TdD]\}>}Y|X|YM}XqP W|i0|,t/}Z|S oY|XoR|ti"joBo;|dt:jo&tfd|XD}Xt:}Zn|XotB|X|O|,}Y| i|>|(|>fq Wq | itC|,gg}[|TD]\}>}Y|[|>qN ~[q W|tijo|| } }n|p8|p1| p*| o|p| p| p|p| oQ|p g} ntDiEd|d| d|d| d | d!| d"|d#| n|ti"jo'x$|OD]}@tg}\|O|@D]}1|\|1iqS~\}]tBg}^|]D])}>|^|i0|>d$t:fd|>fq}~^dd}_|i0|1i+d(}`d(}a|`|O|@jo d(}`n |`i}ag}b|O|@D]>}1|1|`jp |1i|_jo|1i|ajo |b|1qq~b|O|@|%|>i D]8}d|dD]+}1|1|O|1i+jo|c|1|>fqqqqo~c}e|o t>iFd%}fx|Oi9D]v\}g}dtB|dd&|fd'}h|e|h|joqng}i|dD]$}1|1i|hijo |i|1q2q2~i|O|g|%|>i D]8}d|dD]+}1|1|O|1i+jo|j|1|>fqqqq{~j}en|O|efS()sGiven a user-specified list of patterns, return a dictionary of matching fmris: {pkgname: [fmri1, fmri2, ...] pkgname: [fmri1, fmri2, ...], ... } Constraint used is always AUTO as per expected UI behavior. 'match_type' indicates how matching should be restricted. The possible values are: MATCH_ALL Matching is performed using all known package stems and versions. In this case, 'installed_pkgs' must also be provided. MATCH_INST_VERSIONS Matching is performed using only installed package stems and versions. MATCH_INST_STEMS Matching is performed using all known package versions for stems matching installed packages. In this case, 'installed_pkgs' must also be provided. Note that patterns starting w/ pkg:/ require an exact match; patterns containing '*' will using fnmatch rules; the default trailing match rules are used for remaining patterns. Exactly duplicated patterns are ignored. Routine raises PlanCreationException if errors occur: it is illegal to specify multiple different patterns that match the same pkg name unless exactly one of those patterns contained no wildcards. Only patterns that contain wildcards are allowed to match multiple packages. FMRI lists are trimmed by publisher, either by pattern specification, installed version or publisher ranking (in that order) when match_type is not MATCH_INST_VERSIONS. 'raise_not_installed' determines whether an exception will be raised if any pattern matches a package that's not installed. 'reject_set' is a set() containing the stems of packages that should be excluded from matches. css(x!|]}|i|ifVqWdS(N(RR(R9Rr((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s s Build-ReleaseR]iiR>R?spkg:/Rtlatestt match_latestt info_neededtmetadatatstatesRR%RtrequireRs5.11RRsvariant.Rspkg://s//c3s-x&|]}|ijo |VqqWdS(N(R,(R9R(tinst_pub(s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pys s RERCRARBRDtwrong_publisherstwrong_variantst rejected_patsiRQR+iN(GRRRRKReR RRRRRRRRR|RRFRRRGRHRIRRQtMatchingVersionRaRRRiRiR,R&t VersionErrorR2RRRRRR'RRRLRtentries_by_versionR'tCONSTRAINT_AUTORRkRLRRRRtPKG_STATE_RENAMEDRRRRyRftPKG_STATE_OBSOLETEtreduceR/tor_RiRRRRSRR(kR R:RMRRRRRRRSRTRURDtexclpatstwrongpubtwrongvarRVRRVtversionsRWt renamed_fmristobsolete_fmristinstalled_pubsRQt latest_patsRERXRYRZR[tpat_verR\RR]RRqRqRoRit rejected_varst rejected_pubsR1RbRRRQRRtverRRrRctfpubRdtren_depst omit_packagetastrRttatnametatvaluetis_listtvntvvRRQRRtobsoleteRRtrenamed_matchest_[5]tpfttargetsR_R;t_[6]R-RtRR~tlstt_[7]tnwc_pst pub_namedtrel_pst_[8]ttmp_pst_[9]t common_pfmristvststripped_by_publishert_[10]t_[11]t pubs_foundt_[12]tbest_pubtinst_ftinst_vt_[13]t_[14]tflistR R6tpnametplatestt_[15]t_[16]((Rfs:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyt__match_user_fmris^sZ8                         3                       $\% $$ '     6  -  -0    0      $6    0 7 / ;cCs|t|}t}|i}h}t}g}ti||tid|dt\}}ti||tidtdtdt} t|i} t| i} | i | pt xd| | D]X} t | | djpt | | d} |i | gi | |i| qWx|iD]\}}|idd}t |djp|dd jo#|i|id td tn|i|id|d|i|q9Wtg}|D]+}d |jp d |jo ||qq~}||8}xU|D]M}|idd}t |djp|dd jo|i|q!q!W||8}||O}h}xN|D]F}|i tii|ddid td tti|qWxT|iD]F\}}t |djo|i ||fq|i||R?Rs5.11t multiversionstunmatched_wildcardstversion_mismatchtversionless_uninstalled(RRR RRRRRyRitissubsetR+RRfRiRRRRRRR|RRRRjRStFreezePkgsException(R tpatstfreezesRtinstalled_version_mismatchesRRRR tinstalled_stems_dicttstems_of_fmri_matcheststems_of_stems_matcheststemtbad_patt full_fmriRYRZRqRtstemsRRtR((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytfreeze_pkgs_matchasv        $B $     (}Rkt __module__t__doc__RRRRKRRR2R?R,RXRR3RYRZR[R]R_RaRcRRyRR RRRRRRRRKRLR RR!Rt_ImagePlan__set_update_indext_ImagePlan__get_update_indexRR R"R?R]R^RWRYRZR[R_RwRRyRRRRRRRRt staticmethodRhRgRRRRRRRRRRRR RRRRRRRRR;RRjRRRRRRRRRRRRRRRRORR!R"RpRAR4R5R R&RRRRRRR:RRReRR(((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pyR Es -     #  ,4 " -  '  v      7 &    I  @X 8  {         !  8P<   v ' G k N!    8  2     V  L  C  (Bt collectionsRRRRRRBRR/RRR R@RRRt pkg.clientRtloggert pkg.actionsR|tpkg.actions.driverRRt pkg.catalogtpkg.client.api_errorstclientRStpkg.client.indexerRtpkg.client.linkedimage.zonet linkedimageRtpkg.client.pkg_solverRtpkg.client.pkgdefsRtpkg.client.pkgplanRmtpkg.client.plandescR(t pkg.digestRtpkg.fmrit pkg.manifestRRtpkg.miscRKt pkg.mediatorRdRbtpkg.search_errorst search_errorsRt pkg.versiontpkg.client.debugvaluesRRRRRRR R tobjectR (((s:/usr/lib/python2.6/vendor-packages/pkg/client/imageplan.pytsJ                  (