ó
l‚z]c           @` s1  d  Z  d d l m Z m Z m Z m Z d d l m Z d d l m	 Z	 d d l
 Z
 d d l m Z d d l m Z d d	 l m Z m Z d d
 l m Z m Z d d l m Z m Z d d l m Z m Z d d l m Z m Z d d l m Z m  Z  d d l! m" Z" d d l# m$ Z$ m% Z% d d l& m' Z' d d l( m) Z) m* Z* m+ Z+ m, Z, d d l- m. Z. m/ Z/ d d l0 m1 Z1 d d l2 m3 Z3 d d l4 m5 Z5 d d l6 m7 Z7 d d l8 m9 Z9 d d l: m; Z; d d l< m= Z= m> Z> d d l? m@ Z@ e	 eA ƒ ZB d „  ZC d d1 d2 d „ ZE d „  ZF eG d d „ ZH d  „  ZI d! d d" „ ZJ e d# ƒ eG d$ „ ƒ ZK d% „  ZL d& „  ZM d' „  ZN e d( ƒ eG d eG eO eO eG d eG eG d) „	 ƒ ZP d* „  ZQ e d+ ƒ d eG d, „ ƒ ZR d eG d d- „ ZS d. „  ZT eA d/ k r-d d0 lU mU ZU eU eV eJ e
 jW eX e
 jY d ƒ ƒ ƒ ƒ n  d S(3   u,  
Handle the planning of installs and their execution.

NOTE:
    conda.install uses canonical package names in its interface functions,
    whereas conda.resolve uses package filenames, as those are used as index
    keys.  We try to keep fixes to this "impedance mismatch" local to this
    module.
i    (   t   absolute_importt   divisiont   print_functiont   unicode_literals(   t   defaultdict(   t	   getLoggerNi   (   t
   IndexedSet(   t   concatv(   t   DEFAULTS_CHANNEL_NAMEt   UNKNOWN_CHANNEL(   t   contextt   stack_context_default(   t
   itervaluest	   text_type(   t   env_varst   time_recorder(   t   LAST_CHANNEL_URLSt   _supplement_index_with_prefix(   t   PrefixSetupt   UnlinkLinkTransaction(   t   diff_for_unlink_link_precs(   t   CondaIndexErrort   PackagesNotFoundError(   t   History(   t   FETCHt   LINKt   SYMLINK_CONDAt   UNLINK(   t   Channelt   prioritize_channels(   t   Dist(   t   LinkType(   t   ChannelMatch(   t   PrefixGraph(   t   PackageRecord(   t   normalized_version(   t	   MatchSpect   dashlist(   t   human_bytesc         C` s…   d } t  | d ƒ t  | d d d f ƒ xR |  D]J \ } } | | j d | j | j f } | rs | | 7} n  t  | ƒ q3 Wd  S(	   Nu       %-27s|%17su   packageu   buildu   -i   i   (   u   packageu   buildu   -----------------(   t   printt   namet   versiont   build(   t   dists_extrast   fmtt   prect   extrat   line(    (    s)   lib/python2.7/site-packages/conda/plan.pyt   print_dists-   s    !c   -      ` s
  |  j  d ƒ } d d g } | rB | j d | ƒ | j d ƒ n  | r… | j d t t d „  | Dƒ ƒ d d ƒƒ | j d ƒ n  | rÈ | j d	 t t d
 „  | Dƒ ƒ d d ƒƒ | j d ƒ n  t d j | ƒ ƒ ˆ d  k ró t j ‰ n  d „  } ‡ f d †  ‰  |  j  t	 ƒ rt d ƒ g  } xw |  t	 D]k }	 t
 |	 t ƒ sPt ‚ d t |	 d ƒ }
 ˆ  |	 j j ƒ } | r|
 d | 7}
 n  | j |	 |
 f ƒ q5Wt | ƒ | rt |  t	 ƒ d k rt d „  |  t	 Dƒ ƒ } t d> d d ƒ t d d d t | ƒ ƒ qn  t d „  ƒ ‰ t d „  ƒ ‰ t d „  ƒ ‰ t d „  ƒ } i  } x¬ |  j  t g  ƒ D]˜ }	 t
 |	 t ƒ sˆt ‚ |	 d } | |	 ƒ ˆ | d <|	 d d |	 d ˆ | d <|	 | | d <t j | | <d  j |	 j  d! ƒ p÷d? ƒ ˆ | d <qmWxŸ |  j  t g  ƒ D]‹ }	 t
 |	 t ƒ s7t ‚ |	 d } | |	 ƒ ˆ | d" <|	 d d |	 d ˆ | d" <|	 | | d" <d  j |	 j  d! ƒ p™d@ ƒ ˆ | d" <qW‡ f d# †  ˆ Dƒ } ‡ f d$ †  ˆ Dƒ } xF | D]> } x5 ˆ ˆ ˆ | f D]! } | | d  d  d% … | | <q÷WqÞWt ƒ  } t ƒ  } t ƒ  } i  } i  } t } ˆ r9t } t d& „  ˆ Dƒ ƒ d } t d' „  ˆ j ƒ  Dƒ ƒ } t d( „  ˆ j ƒ  Dƒ ƒ } t d) „  ˆ j ƒ  Dƒ ƒ } t d* „  ˆ j ƒ  Dƒ ƒ } t ‡  f d+ †  ˆ j ƒ  Dƒ ƒ } t ‡  f d, †  ˆ j ƒ  Dƒ ƒ } xˆ D]} d- | | f | | <| re| | c d. | 7<n  ˆ | d" rŠ| | c d/ | 7<n  t | j  | t j ƒ ƒ }  |  t j k rºd n d0 |  }  | | k sÜ| | k rò| | c |  7<q.n  d1 | | | <| r| | c d2 | 7<n  ˆ | d rB| | c d3 | 7<n  | | c |  7<| | d" }! | | d }" |! j  d4 ƒ }# |" j  d4 ƒ }$ |# d  k s¤|$ d  k r±d }# }$ n  yn t |" j ƒ d5 k rèt |! j ƒ d5 k }% |% }& n6 t |! j ƒ }' t |" j ƒ }( |' |( k  }% |' |( k }& Wn5 t  k
 rV|! j |" j k  }% |! j |" j k }& n X|! j! |" j! k }) |! j! |" j! k  }* t j" r´|$ |# k  r´|& s¤|% r´|* r´| j# | ƒ q.|% rÊ| j# | ƒ q.|$ |# k  rù|& sé|% rù|) rù| j# | ƒ q.|& r| j# | ƒ q.|) s%| j# | ƒ q.| j# | ƒ q.Wn  d6 }+ dA ‰ ‡  ‡ ‡ ‡ ‡ f d7 †  }, | r¡t d8 ƒ x. t | ƒ D] } t |, | | | ƒ ƒ q}Wn  | rât d9 ƒ x. t | ƒ D] } t |, | | | ƒ ƒ q¾Wn  | r/	t d: ƒ x: t | ƒ D]) } t |, | | |+ | | | ƒ ƒ qÿWn  | r|	t d; ƒ x: t | ƒ D]) } t |, | | |+ | | | ƒ ƒ qL	Wn  | rÉ	t d< ƒ x: t | ƒ D]) } t |, | | |+ | | | ƒ ƒ q™	Wn  | rù	|  j  t$ ƒ rù	t d= ƒ t |  d ƒ n  t d ƒ d  S(B   Nu   PREFIXu    u   ## Package Plan ##
u     environment location: %su     removed specs: %sc         s` s   |  ] } t  | ƒ Vq d  S(   N(   R   (   t   .0t   s(    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>@   s    t   indenti   u     added / updated specs: %sc         s` s   |  ] } t  | ƒ Vq d  S(   N(   R   (   R1   R2   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>D   s    u   
c         S` s[   |  j  d ƒ r |  d S|  j  d ƒ r7 t |  d ƒ j S|  j  d ƒ rW t |  d ƒ j St S(   Nu   schannelu   urlu   channel(   t   getR   t   canonical_nameR	   (   t   rec(    (    s)   lib/python2.7/site-packages/conda/plan.pyt   channel_strK   s    c         ` s0   ˆ  t  k r d Sˆ  d  k r, |  t k r, d S|  S(   Nu    (   t   Falset   NoneR   (   R2   (   t   show_channel_urls(    s)   lib/python2.7/site-packages/conda/plan.pyt   channel_filtT   s
    u,   
The following packages will be downloaded:
u   %15su   sizeu     i   c         s` s   |  ] } | d  Vq d S(   u   sizeN(    (   R1   R-   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>i   s    u    u   -i<   i+   u   Total: %14sc           S` s
   t  d ƒ S(   Nu    (   u    u    (   t   list(    (    (    s)   lib/python2.7/site-packages/conda/plan.pyt   <lambda>n   t    c           S` s
   t  d ƒ S(   Nu    (   u    u    (   R<   (    (    (    s)   lib/python2.7/site-packages/conda/plan.pyR=   o   R>   c           S` s
   t  d ƒ S(   Nu    (   u    u    (   R<   (    (    (    s)   lib/python2.7/site-packages/conda/plan.pyR=   p   R>   c           S` s
   t  d ƒ S(   N(   NN(   R<   R9   (    (    (    s)   lib/python2.7/site-packages/conda/plan.pyR=   q   R>   u   nameu   versionu   buildu   ,u   featuresi    c         ` s$   h  |  ] } ˆ  | d  s | ’ q S(   i    (    (   R1   t   p(   t   packages(    s)   lib/python2.7/site-packages/conda/plan.pys	   <setcomp>„   s   	 c         ` s$   h  |  ] } ˆ  | d  s | ’ q S(   i   (    (   R1   R?   (   R@   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <setcomp>…   s   	 iÿÿÿÿc         s` s   |  ] } t  | ƒ Vq d  S(   N(   t   len(   R1   R?   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>”   s    c         s` s   |  ] } t  | d  ƒ Vq d S(   i    N(   RA   (   R1   R?   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>•   s    c         s` s   |  ] } t  | d  ƒ Vq d S(   i   N(   RA   (   R1   R?   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>–   s    c         s` s   |  ] } t  | d  ƒ Vq d S(   i    N(   RA   (   R1   R?   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>—   s    c         s` s   |  ] } t  | d  ƒ Vq d S(   i   N(   RA   (   R1   R?   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>˜   s    c         3` s%   |  ] } t  ˆ  | d  ƒ ƒ Vq d S(   i    N(   RA   (   R1   R?   (   R;   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>™   s    c         3` s%   |  ] } t  ˆ  | d  ƒ ƒ Vq d S(   i   N(   RA   (   R1   R?   (   R;   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>š   s    u   {pkg:<%s} {vers[0]:<%s}u    {channels[0]:<%s}u    [{features[0]:<%s}]u    (%s)u   {vers[1]:<%s}u    {channels[1]:<%s}u    [{features[1]:<%s}]u   priorityu   customu    --> c         ` sU   g  ˆ | D] } ˆ  | ƒ ^ q } ˆ |  j  d | d d ˆ | d | d ˆ | ƒ S(   Nt   pkgu   :t   verst   channelst   features(   t   format(   R2   RB   t   ct   chans(   R;   RD   RE   t   leadR@   (    s)   lib/python2.7/site-packages/conda/plan.pyRF   Ö   s    # u/   
The following NEW packages will be INSTALLED:
u)   
The following packages will be REMOVED:
u)   
The following packages will be UPDATED:
uI   
The following packages will be SUPERSEDED by a higher-priority channel:
u,   
The following packages will be DOWNGRADED:
u3   
The following empty environments will be CREATED:
u       (    (    u       (%   R4   t   appendR%   t   sortedR'   t   joinR9   R
   R:   R   t
   isinstanceR"   t   AssertionErrorR&   t   channelR5   R0   RA   t   sumR   R   R   t   hardlinkR   t   sett   TrueR8   t   maxt   valuest   strR)   R#   t	   TypeErrort   build_numbert   channel_priorityt   addR   (-   t   actionst   indexR:   t   specs_to_removet   specs_to_addt   prefixt   builderR7   t   disp_lstR-   R.   t   schannelt	   num_bytest   recordst	   linktypesRB   t   newt   removedt   vart   updatedt
   downgradedt	   channeledt   oldfmtt   newfmtt   emptyt   maxpkgt	   maxoldvert	   maxnewvert   maxoldfeaturest   maxnewfeaturest   maxoldchannelst   maxnewchannelst   ltt   P0t   P1t   pri0t   pri1t   newvert   oldvert   N0t   N1t   oldbldt   newbldt   arrowRF   (    (   R;   RD   RE   RI   R@   R:   s)   lib/python2.7/site-packages/conda/plan.pyt   display_actions8   s&   	$	$		

"
*
*#			""
)


*
*
*
c         C` sC   t  | t ƒ s t ‚ t |  k r. g  |  t <n  |  t j | ƒ d  S(   N(   RM   R   RN   R   RJ   (   R[   t   dist(    (    s)   lib/python2.7/site-packages/conda/plan.pyt
   add_unlinkü   s    c         C` s   d  S(   N(    (   t   rt   linkedt   specst   updateR_   (    (    s)   lib/python2.7/site-packages/conda/plan.pyt   add_defaults_to_specs  s    c         ` sv   |  s t  ‚ xI t j D]8 } t | ƒ ‰  t ‡  f d †  |  Dƒ ƒ } | r Pq q W|  } t j d t | ƒ ƒ | d S(   Nc         3` s*   |  ]  } ˆ  j  | j j ƒ r | Vq d  S(   N(   t   matchRO   R(   (   R1   R-   (   t   channel_matcher(    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>  s    u   Multiple packages found:%si    (   RN   R
   RD   R    t   tuplet   logt   warnR%   (   t   precst   chnt   prec_matches(    (   R‹   s)   lib/python2.7/site-packages/conda/plan.pyt   _get_best_prec_match
  s    iÿÿÿÿc         ` sj  t  |  ƒ } t | j ƒ  ƒ } y d „  | j | ƒ Dƒ } Wn! t k
 r^ t d | ƒ ‚ n Xt | |  ƒ t ƒ  } t ƒ  } x | D]w ‰  t ‡  f d †  t | ƒ Dƒ ƒ } | sÃ | j	 ˆ  ƒ q… t
 | ƒ d k rë | j	 t | ƒ ƒ q… | j	 | d ƒ q… W| rt | ƒ ‚ n  t t | ƒ j ƒ }	 t |  |	 ƒ \ }
 } t |  |
 | d | d ƒ } t | ƒ } | S(   Nc         S` s   h  |  ] } t  j | ƒ ’ q S(    (   R$   t   from_dist_str(   R1   t   dist_str(    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <setcomp>!  s   	 u   no such revision: %dc         3` s$   |  ] } ˆ  j  | ƒ r | Vq d  S(   N(   RŠ   (   R1   R-   (   t   spec(    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>*  s    i   i    (    (    (   R   R   t   get_requested_specs_mapt	   get_statet
   IndexErrorR   R   RR   RŒ   RZ   RA   R’   R   R   R!   t   graphR   R   R   (   R_   t   revisionR\   t   ht   user_requested_specst   target_statet   not_found_in_index_specst
   link_precsR   t   final_precst   unlink_precst   stpt   txn(    (   R•   s)   lib/python2.7/site-packages/conda/plan.pyt   revert_actions  s.    		"u   execute_actionsc         C` s#   t  |  | ƒ } t | | | ƒ d  S(   N(   t   _plan_from_actionst   execute_instructions(   R[   R\   t   verboset   plan(    (    s)   lib/python2.7/site-packages/conda/plan.pyt   execute_actions>  s    c         C` s3  d d l  m } m } m } m } m } d |  k rK |  d rK |  d } n | } | |  k rg |  | sm t ‚ |  | } d d | f g }	 |  j d ƒ }
 |
 r« t ƒ  ‚ n  |  j d ƒ p½ d  } |  j d g  ƒ } t
 j d	 j | ƒ ƒ x,| D]$} | |  k rt
 j d
 j | ƒ ƒ qï n  |  | sCt
 j d j | ƒ ƒ qï n  d | k ro|	 j | d | j ƒ  f ƒ n3 | j d ƒ r¢|	 j | d | d j ƒ  f ƒ n  | | k rÒ|	 j | d t |  | ƒ f ƒ n  x> |  | D]2 } t
 j d j | | ƒ ƒ |	 j | | f ƒ qÝWqï Wt |	 | | | | ƒ }	 |	 S(   Ni   (   t   ACTION_CODESt   PREFIXt   PRINTt   PROGRESSt   PROGRESS_COMMANDSu   op_orderu   PREFIXu   %su   UNLINKLINKTRANSACTIONu   ACTIONu   SPECSu    Adding plans for operations: {0}u   action {0} not in actionsu   action {0} has None valueu   _u   %sing packages ...u   RM_u&   Pruning %s packages from the cache ...i   u   %du"   appending value {0} for action {1}(   t   instructionsRª   R«   R¬   R­   R®   RN   R4   t   RuntimeErrorR9   R   t   debugRF   t   traceRJ   t
   capitalizet
   startswitht   lowerRA   t   _inject_UNLINKLINKTRANSACTION(   R[   R\   Rª   R«   R¬   R­   R®   t   op_orderR_   R¨   t   unlink_link_transactiont   axnR‡   t   opt   arg(    (    s)   lib/python2.7/site-packages/conda/plan.pyR¥   D  s>    (

 $$c         ` s  d d l  m } d d l m ‰  d d l m } d d l m ‰ m } m	 ‰ m
 } d d l m }	 d d l m }
 m } t ‡ ‡ f d	 †  t |  ƒ Dƒ d
 ƒ } | d k rÖ| d „  |  ƒ } t ‡  f d †  | j ˆ d ƒ Dƒ ƒ } t ‡  f d †  | j ˆ d ƒ Dƒ ƒ } t | | ƒ \ } } | | ƒ rNt ‡ f d †  | Dƒ ƒ } n d } t ‡ f d †  | Dƒ ƒ } |	 | ƒ } | j ƒ  |
 | | | d | d ƒ } |  j | | | | ƒ f ƒ |  j | | | f ƒ n4 | d k r
|  j d | | d d d | f f ƒ n  |  S(   Ni    (   t   isdiri   (   R   (   t   groupby(   R   t   PROGRESSIVEFETCHEXTRACTR   t   UNLINKLINKTRANSACTION(   t   ProgressiveFetchExtract(   R   R   c         3` s1   |  ]' \ } } | d  ˆ ˆ  f k r | Vq d S(   i    N(    (   R1   t   qR?   (   R   R   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>{  s    iÿÿÿÿc         S` s   |  d S(   Ni    (    (   t   x(    (    s)   lib/python2.7/site-packages/conda/plan.pyR=   }  R>   c         3` s   |  ] } ˆ  | d  ƒ Vq d S(   i   N(    (   R1   t   d(   R   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>~  s    c         3` s   |  ] } ˆ  | d  ƒ Vq d S(   i   N(    (   R1   RÃ   (   R   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>  s    c         3` s   |  ] } ˆ  | Vq d  S(   N(    (   R1   RÃ   (   R\   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>ƒ  s    c         3` s   |  ] } ˆ  | Vq d  S(   N(    (   R1   RÃ   (   R\   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>‰  s    u   INSTALLu   CREATE(    (    (    (    (    (   u   INSTALLu   CREATE(    (    (    (   t   os.pathR¼   t   models.distR   t   _vendor.toolz.itertoolzR½   R¯   R   R¾   R   R¿   t   core.package_cache_dataRÀ   t	   core.linkR   R   t   nextt	   enumerateRŒ   R4   t   _handle_menuinstt   preparet   insert(   R¨   R\   R_   R¹   R‡   R¼   R½   R¾   R¿   RÀ   R   R   t   first_unlink_link_idxt   grouped_instructionst   unlink_distst
   link_distsR¡   RŸ   t   pfeR¢   (    (   R   R   R   R\   s)   lib/python2.7/site-packages/conda/plan.pyR¶   s  s0    "(((
(c         C` sä   d d l  m } | s  |  | f St d „  t |  ƒ Dƒ d  ƒ } | d  k	 r} t t |  |  |  | d |  | | d !ƒ ƒ }  n  t d „  t | ƒ Dƒ d  ƒ } | d  k	 rÚ t t | | | d !| |  | | d ƒ ƒ } n  |  | f S(   Ni   (   t   on_winc         s` s*   |  ]  \ } } | j  d  k r | Vq d S(   u   menuinstN(   R(   (   R1   RÁ   RÃ   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>   s    c         s` s*   |  ]  \ } } | j  d  k r | Vq d S(   u   menuinstN(   R(   (   R1   RÁ   RÃ   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>©  s    (   t   common.compatRÓ   RÉ   RÊ   R9   RŒ   R   (   RÐ   RÑ   RÓ   t   menuinst_idx(    (    s)   lib/python2.7/site-packages/conda/plan.pyRË   —  s     
u   install_actionsc      
   ` s'  t  i d d 6d d 6d t ƒd d l m ‰ d d	 l m } d d
 l m } d d l m	 ‰  d d l
 m ‰ |	 rÎ | ‡  f d †  |	 Dƒ ƒ } | ‡  f d †  | Dƒ ƒ } | ‡ f d †  |	 Dƒ ƒ } nd t r(t t ƒ }	 | ‡  f d †  |	 Dƒ ƒ } | d „  d „  | Dƒ Dƒ ƒ p"t j } n
 d  } } t d „  | Dƒ ƒ } d d l m } | j j ƒ  | |  | | d | ƒ} | rŸd „  t | ƒ Dƒ | _ n  | j d | d | ƒ } | j |  } t |  ƒ } | d j ‡ f d †  | j Dƒ ƒ | d j ‡ f d †  | j Dƒ ƒ | SWd  QXd  S(   Nu   trueu   CONDA_ALLOW_NON_CHANNEL_URLSu   falseu   CONDA_SOLVER_IGNORE_TIMESTAMPSt   stack_callbacki    (   t   basenamei   (   R   (   t   Solver(   R   (   R   c         3` s   |  ] } ˆ  | ƒ j  Vq d  S(   N(   R5   (   R1   t   url(   R   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>Ä  s    c         3` s   |  ] } ˆ  | ƒ Vq d  S(   N(    (   R1   t   cn(   R   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>Å  s    c         3` s   |  ] } ˆ  | ƒ Vq d  S(   N(    (   R1   RÙ   (   R×   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>Æ  s    c         3` s   |  ] } ˆ  | ƒ Vq d  S(   N(    (   R1   RÙ   (   R   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>Ë  s    c         s` s   |  ] } | r | Vq d  S(   N(    (   R1   t   subdir(    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>Í  s    c         s` s   |  ] } | j  Vq d  S(   N(   RÛ   (   R1   RG   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>Í  s    c         s` s   |  ] } t  | ƒ Vq d  S(   N(   R$   (   R1   R•   (    (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>Ò  s    (   t
   PrefixDataR^   c         S` s   i  |  ] } | | “ q S(    (    (   R1   R-   (    (    s)   lib/python2.7/site-packages/conda/plan.pys
   <dictcomp>Ù  s   	 t   prunet   ignore_pinnedu   UNLINKc         3` s   |  ] } ˆ  | ƒ Vq d  S(   N(    (   R1   R-   (   R   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>Ý  s    u   LINKc         3` s   |  ] } ˆ  | ƒ Vq d  S(   N(    (   R1   R-   (   R   (    s)   lib/python2.7/site-packages/conda/plan.pys	   <genexpr>Þ  s    (   R   R   RÄ   R×   t   _vendor.boltons.setutilsR   t
   core.solveRØ   t   models.channelR   RÅ   R   R   R   R
   t   subdirsR9   RŒ   t   core.prefix_dataRÜ   t   _cache_t   clearR   t   _indext   solve_for_transactiont   prefix_setupst   get_blank_actionst   extendR¡   RŸ   (   R_   R\   R‡   t   forcet
   only_namest   always_copyt   pinnedt   update_depsRÝ   t   channel_priority_mapt	   is_updatet   minimal_hintR   RØ   t   channel_namesRD   Râ   RÜ   t   solverR£   t   prefix_setupR[   (    (   R   R   R×   s)   lib/python2.7/site-packages/conda/plan.pyt   install_actions´  s@    


$$c      	   C` s•   d d l  m } d d l m } m } m } m } m } m } m	 } m
 }	 m }
 m } | t ƒ } |  | | <| |	 | | | | | | |
 f	 | d <| S(   Ni    (   R   i   (
   t   CHECK_EXTRACTt   CHECK_FETCHt   EXTRACTR   R   R«   t   RM_EXTRACTEDt
   RM_FETCHEDR   R   u   op_order(   t   collectionsR   R¯   R÷   Rø   Rù   R   R   R«   Rú   Rû   R   R   R<   (   R_   R   R÷   Rø   Rù   R   R   R«   Rú   Rû   R   R   R[   (    (    s)   lib/python2.7/site-packages/conda/plan.pyRé   â  s    F
u   execute_planc         C` s    t  |  ƒ } t | | | ƒ d S(   uS   
    Deprecated: This should `conda.instructions.execute_instructions` instead
    N(   t   _update_old_planR¦   (   t   old_planR\   R§   R¨   (    (    s)   lib/python2.7/site-packages/conda/plan.pyt   execute_planî  s    c         C` sv  d d l  m } m } d d l m } d d l m } | d k rK | } n  t j	 d |  ƒ i d d 6| j
 d 6| d 6} xö |  D]î \ }	 }
 t j	 d	 |	 |
 ƒ | d d k	 rø |	 | k rø | d c d 7<t d
 ƒ j | |
 ƒ j | d d f ƒ n  | |	 } t | ƒ r| | |
 ƒ n  | d d k	 r€ |	 | k r€ | d | d k r€ d | d <t d ƒ j d ƒ q€ q€ Wd S(   u.  Execute the instructions in the plan

    :param plan: A list of (instruction, arg) tuples
    :param index: The meta-data index
    :param verbose: verbose output
    :param _commands: (For testing only) dict mapping an instruction to executable if None
    then the default commands will be used
    i   (   t   commandsR®   (   R
   (   R   u   executing plan %su   iu   prefixu   indexu    %s(%r)u   progress.updateu   maxvalu   progress.stopN(   R¯   R   R®   t   base.contextR
   RÅ   R   R9   R   R±   t   root_prefixR   t   infot	   dist_namet   callable(   R¨   R\   R§   t	   _commandsR   R®   R
   R   t   statet   instructionR»   t   cmd(    (    s)   lib/python2.7/site-packages/conda/plan.pyR¦   ÷  s(    		

c         C` sŠ   g  } x} |  D]u } | j  d ƒ r( q n  d | k rW d d l m } | d | ƒ ‚ n  | j d d ƒ \ } } | j | | f ƒ q W| S(   u^   
    Update an old plan object to work with
    `conda.instructions.execute_instructions`
    u   #u    i   (   t   ArgumentErroru0   The instruction '%s' takes at least one argument(   R´   t
   exceptionsR
  t   splitRJ   (   Rþ   R¨   R/   R
  R  R»   (    (    s)   lib/python2.7/site-packages/conda/plan.pyRý     s    u   __main__(   t   pprint(    (    (Z   t   __doc__t
   __future__R    R   R   R   Rü   R   t   loggingR   t   sysRß   R   t   _vendor.toolzR   t   base.constantsR   R	   R  R
   R   RÔ   R   R   t	   common.ioR   R   t
   core.indexR   R   RÈ   R   R   Rà   R   R  R   R   t   historyR   R¯   R   R   R   R   Rá   R   R   RÅ   R   t   models.enumsR   t   models.match_specR    t   models.prefix_graphR!   t   models.recordsR"   t   models.versionR#   t   resolveR$   R%   t   utilsR&   t   __name__R   R0   R9   R‚   R„   R8   R‰   R’   R¤   R©   R¥   R¶   RË   RS   Rö   Ré   Rÿ   R¦   Rý   R  t   dictR_   t   intt   argv(    (    (    s)   lib/python2.7/site-packages/conda/plan.pyt   <module>   sd   ""	Ä	
	'		/	$				*		'	