ó
@K7]c           @` sÜ  d  Z  d d l m Z m Z m Z m Z d d l Z d d l m Z d d l	 Z	 d d l
 Z
 d d l m Z m Z m Z m Z d d l Z d d l Z d d l Z d d l m Z m Z d d l 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 m  Z  m! Z! e j" d k Z# d Z$ d „  Z% d „  Z& d Z' i d d 6d d 6d d 6d d 6d d 6d d 6d d 6Z( e d d ƒ Z) d „  Z* d  „  Z+ d! e, f d" „  ƒ  YZ- e. d# „ Z/ d$ „  Z0 e- ƒ  j1 Z1 d S(%   u'   
Module to store conda build settings.
i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t
   namedtuple(   t   abspatht
   expandusert   joint
   expandvarsi   (   t   root_dirt   root_writable(   t   binstar_upload(   t   get_default_variant(   t   cc_platformt   cc_conda_buildt   subdirt   url_path(   t   get_build_folderst   rm_rft
   get_loggert   get_conda_operation_locksu   win32u   conda-buildc         C` s&   t  |  d ƒ r" |  j t j ƒ  ƒ S|  S(   Nu   decode(   t   hasattrt   decodet   syst   getfilesystemencoding(   t   strin(    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   python2_fs_encode    s    c         C` sJ   t  |  ƒ } t j j | ƒ sF y t j | ƒ WqF t k
 rB qF Xn  d  S(   N(   R   t   ost   patht   isdirt   makedirst   OSError(   R   t   encpath(    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _ensure_dir$   s    iÿ   u   linux-64u   linux-cos5-x86_64u   linux-cos6-x86_64u   linux-32u   linux-cos5-x86u   linux-cos6-x86u   osx-64u   osx-109-x86_64u   win-64u
   win-x86_64u   win-32u   win-x86u   ConfigSettingu   name, defaultc        E   C` sÜ  t  d t ƒ t  d t ƒ t  d t ƒ t  d g  ƒ t  d t ƒ t  d t ƒ t  d t ƒ t  d t ƒ t  d	 t ƒ t  d
 d  ƒ t  d d  ƒ t  d g  ƒ t  d t ƒ t  d t ƒ t  d d ƒ t  d t ƒ t  d t ƒ t  d d  ƒ t  d t ƒ t  d t ƒ t  d t ƒ t  d t ƒ t  d d ƒ t  d t ƒ t  d d  ƒ t  d d  ƒ t  d t j d d ƒ j ƒ  d k ƒ t  d t ƒ t  d  t j d! ƒ ržt	 t
 t t j d! ƒ ƒ ƒ ƒ n d  ƒ t  d" t ƒ t  d# t ƒ t  d$ t ƒ t  d% t j d% d& ƒ j ƒ  d k ƒ t  d' t j d' d& ƒ j ƒ  d k ƒ t  d( t j d( d& ƒ j ƒ  d k ƒ t  d) t j d) d& ƒ j ƒ  d k ƒ t  d* d  ƒ t  d+ t ƒ t  d, d  ƒ t  d- d  ƒ t  d. d  ƒ t  d/ g  ƒ t  d0 g  ƒ t  d1 t ƒ t  d2 d3 ƒ t  d4 d  ƒ t  d5 d  ƒ t  d6 d  ƒ t  d7 d8 ƒ t  d9 d  ƒ t  d: t ƒ t  d; d< ƒ t  d= d  ƒ t  d> d  ƒ t  d? d@ ƒ t  dA t ƒ t  dB t j dB g  ƒ ƒ t  dC t j dC t ƒ ƒ t  dD t ƒ t  dE t ƒ t  dF d  ƒ t  dG g  ƒ t  dH d  ƒ t  dI dO ƒ t  dM t j dN d  ƒ ƒ gA S(P   Nu   activateu   anaconda_uploadu   force_uploadu   channel_urlsu   dirtyu   include_recipeu   no_download_sourceu   override_channelsu   skip_existingu   tokenu   useru   labelsu   verboseu   debugu   timeouti„  u   set_build_idu   disable_pipu   _output_folderu   prefix_length_fallbacku   _prefix_lengthu   long_test_prefixu   lockingu   max_env_retryi   u   remove_work_diru   _host_platformu
   _host_archu   filename_hashingu   trueu   keep_old_worku   _src_cache_rootu	   cache_diru   copy_test_source_filesu	   trim_skipu   use_channeldatau   error_overlinkingu   falseu   enable_staticu   error_overdependingu   no_rewrite_stdout_envu   indexu   build_is_hostu	   _platformu   _archu   _target_subdiru   variant_config_filesu   exclusive_config_filesu   ignore_system_variantsu   hash_lengthi   u   append_sections_fileu   clobber_sections_fileu	   bootstrapu   git_commits_since_tagi    u   passwordu   signu	   sign_withu   gpgu   identityu   config_fileu
   repositoryu   pypitestu   verifyu   ignore_verify_codesu   exit_on_verify_erroru   merge_build_hostu   _merge_build_hostu
   stats_fileu
   extra_depsu   _pip_cache_diru   compression_tupleu   .tar.zstu   zstdu   zstd:compression-level=22u   conda_pkg_formatu
   pkg_format(   u   .tar.zstu   zstdu   zstd:compression-level=22(   t   Settingt   TrueR   t   Falset   Nonet   DEFAULT_PREFIX_LENGTHR   t   gett   lowerR   R   R   (    (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _get_default_settingsA   s’    6c         ` s   ‡  f d †  } | S(   Nc          ` s2   t  t ƒ } | j d j ˆ  j ƒ ƒ ˆ  |  | Ž  S(   Nu¥   WARNING: attribute {} is deprecated and will be removed in conda-build 4.0.  Please update your code - file issues on the conda-build issue tracker if you need help.(   R   t   __name__t   warnt   format(   t   argst   kwt   log(   t   func(    s1   lib/python2.7/site-packages/conda_build/config.pyt   func_wrapperÉ   s    (    (   R0   R1   (    (   R0   s1   lib/python2.7/site-packages/conda_build/config.pyt"   print_function_deprecation_warningÈ   s    t   Configc           B` sé  e  Z e Z Z e Z e Z dR d  „ Z d „  Z d „  Z	 e
 d „  ƒ Z e j d „  ƒ Z e
 d „  ƒ Z e j d „  ƒ Z e
 d „  ƒ Z e
 d „  ƒ Z e j d	 „  ƒ Z e
 d
 „  ƒ Z d „  Z e
 d „  ƒ Z e
 d „  ƒ Z e j d „  ƒ Z e
 d „  ƒ Z e j d „  ƒ Z e
 d „  ƒ Z e j d „  ƒ Z e
 d „  ƒ Z e j d „  ƒ Z e
 d „  ƒ Z e j d „  ƒ Z e
 d „  ƒ Z e j d „  ƒ Z e
 d „  ƒ Z e j d „  ƒ Z e
 d „  ƒ Z e
 e d „  ƒ ƒ Z e j e d „  ƒ ƒ Z e
 e d „  ƒ ƒ Z e j e d „  ƒ ƒ Z e
 e d  „  ƒ ƒ Z e j e d! „  ƒ ƒ Z e
 e d" „  ƒ ƒ Z e j e d# „  ƒ ƒ Z e
 e d$ „  ƒ ƒ Z  e  j e d% „  ƒ ƒ Z  d& „  Z! d' „  Z" d( „  Z# d) „  Z$ d* „  Z% e& d+ „ Z' e
 d, „  ƒ Z( e( j d- „  ƒ Z( e
 d. „  ƒ Z) e) j d/ „  ƒ Z) e
 d0 „  ƒ Z* e
 d1 „  ƒ Z+ e
 d2 „  ƒ Z, e
 d3 „  ƒ Z- e
 d4 „  ƒ Z. d5 „  Z/ e
 d6 „  ƒ Z0 e
 d7 „  ƒ Z1 e
 d8 „  ƒ Z2 e
 d9 „  ƒ Z3 d: „  Z4 d; „  Z5 d< „  Z6 d= „  Z7 d> „  Z8 e
 d? „  ƒ Z9 e
 d@ „  ƒ Z: e
 dA „  ƒ Z; e
 dB „  ƒ Z< e
 dC „  ƒ Z= e
 dD „  ƒ Z> e
 dE „  ƒ Z? e
 dF „  ƒ Z@ e
 dG „  ƒ ZA e
 dH „  ƒ ZB e
 dI „  ƒ ZC eC j dJ „  ƒ ZC e
 dK „  ƒ ZD e
 dL „  ƒ ZE eF dM „ ZG dN „  ZH dO „  ZI dP „  ZJ dQ „  ZK RS(S   c         K` sW   t  t |  ƒ j ƒ  | p i  |  _ |  j |   |  j rS t j j |  j ƒ |  _ n  d  S(   N(	   t   superR3   t   __init__t   variantt   set_keyst   _src_cache_rootR   R   R   (   t   selfR6   t   kwargs(    (    s1   lib/python2.7/site-packages/conda_build/config.pyR5   ×   s
    	c         C` sZ   | j  | t |  | ƒ r' t |  | ƒ n | ƒ } t |  | | ƒ | | k rV | | =n  d  S(   N(   R'   R   t   getattrt   setattr(   R9   R:   t   attrt   defaultt   value(    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _set_attribute_from_kwargsß   s    0c         ` sf  ‡ f d †  ‰  ‡  ‡ f d †  } x d D] } | ˆ j  | ƒ q( Wˆ j d t ˆ d	 d
 ƒ ƒ ˆ _ ˆ j d d  ƒ } ˆ j d d  ƒ } | r½ t j j t j j t j j	 | ƒ ƒ ƒ ˆ _
 n  | ró t j j t j j t j j	 | ƒ ƒ ƒ ˆ _ n t ˆ d d  ƒ ˆ _ x* t ƒ  D] } ˆ j ˆ | j | j ƒ qWx* ˆ j ƒ  D] \ } } t ˆ | | ƒ qBWd  S(   Nc         ` sÀ   ˆ  j  |  d  ƒ } | sŽ |  d k r- d }  n* |  d k rB d }  n |  d k rW d }  n  d |  j ƒ  } t j | ƒ r… t j | ƒ n | } n. t | t ƒ r¼ t | ƒ d k r¼ | d	 } n  | S(
   Nu   pythonu   pyu   numpyu   npyu   r_baseu   ru   CONDA_i   i    (   t   popR%   t   upperR   t   getenvt
   isinstancet   listt   len(   t   langR>   t   versiont   var(   R:   (    s1   lib/python2.7/site-packages/conda_build/config.pyt   envæ   s    			'!c         ` sd   ˆ  | ˆ j  j | ƒ ƒ } | r` d t | ƒ k rS d j | d | d f ƒ } n  | |  | <n  d  S(   Nu   .i    i   (   R6   R'   t   strR   (   R6   RG   R?   (   RJ   R9   (    s1   lib/python2.7/site-packages/conda_build/config.pyt   set_langö   s
     u   perlu   luau   pythonu   numpyu   r_baseu   build_idu	   _build_idu    u	   cache_diru   crootu   _croot(   u   perlu   luau   pythonu   numpyu   r_base(   R6   RA   R;   t	   _build_idR%   R   R   R   t   normpathR   R8   t   _crootR)   R@   t   nameR>   t   itemsR<   (   R9   R:   RL   RG   t   source_cachet   crootR?   RP   (    (   RJ   R:   R9   s1   lib/python2.7/site-packages/conda_build/config.pyR7   å   s"    	!0c         C` s   |  j  p t j d d ƒ d S(   u_   Always the native (build system) arch, except when pretending to be some
        other platformu   -i   (   t   _archR   t   rsplit(   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   arch  s    c         C` s,   t  t ƒ } | j d ƒ t | ƒ |  _ d  S(   Nuº   Setting build arch. This is only useful when pretending to be on another arch, such as for rendering necessary dependencies on a non-native arch. I trust that you know what you're doing.(   R   R*   R+   RK   RT   (   R9   R?   R/   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRV     s    c         C` s   |  j  p t j d d ƒ d S(   u]   Always the native (build system) OS, except when pretending to be some
        other platformu   -i   i    (   t	   _platformR   RU   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   platform%  s    c         C` sA   t  t ƒ } | j d ƒ | d k r4 t d ƒ ‚ n  | |  _ d  S(   NuÆ   Setting build platform. This is only useful when pretending to be on another platform, such as for rendering necessary dependencies on a non-native platform. I trust that you know what you're doing.u   noarchuC   config platform should never be noarch.  Set host_platform instead.(   R   R*   R+   t
   ValueErrorRW   (   R9   R?   R/   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRX   +  s
    c         C` s   d j  |  j |  j f ƒ S(   u‘   Determines channel to download build env packages from.
        Should generally be the native platform.  Does not preclude packages from noarch.u   -(   R   RX   RV   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   build_subdir6  s    c         C` sS   y, |  j  j d |  j ƒ j d d ƒ d } Wn t k
 rE d } n X|  j pR | S(   Nu   target_platformu   -i   i@   (   R6   R'   RZ   t   splitt
   IndexErrort
   _host_arch(   R9   t   variant_arch(    (    s1   lib/python2.7/site-packages/conda_build/config.pyt	   host_arch<  s
    ,
c         C` s   | |  _  d  S(   N(   R]   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyR_   D  s    c         C` s   |  j  d k S(   Nu   noarch(   t   host_platform(   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   noarchH  s    c         C` s   |  j  t k s t |  _  n  d  S(   N(   RX   R   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   reset_platformL  s    c         C` s   d j  |  j t |  j ƒ g ƒ S(   Nu   -(   R   RX   RK   RV   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyR   P  s    c         C` s/   |  j  p. |  j j d |  j ƒ j d d ƒ d S(   Nu   target_platformu   -i   i    (   t   _host_platformR6   R'   RZ   R[   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyR`   T  s    	c         C` s   | |  _  d  S(   N(   Rc   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyR`   Y  s    c         C` sŽ   |  j  j d |  j ƒ } |  j d k r3 |  j } nK | d j |  j t |  j ƒ g ƒ k r~ d j |  j t |  j ƒ g ƒ } n  t j | | ƒ S(   Nu   target_platformu   noarchu   -(   R6   R'   RZ   R`   R   RK   R_   t   SUBDIR_ALIASES(   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   host_subdir]  s    '$c         C` sW   t  j | | ƒ } | j d d ƒ } | d |  _ t | ƒ d k rS | d |  _ n  d  S(   Nu   -i   i    (   Rd   R'   RU   R`   RF   R_   (   R9   R?   t   values(    (    s1   lib/python2.7/site-packages/conda_build/config.pyRe   f  s
    c         C` s   |  j  p |  j S(   N(   t   _target_subdirRe   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   target_subdirn  s    c         C` s   | |  _  d  S(   N(   Rg   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRh   r  s    c         C` s   |  j  r |  j  d Sd  S(   Ni    (   t   exclusive_config_filesR%   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   exclusive_config_filev  s    	c         C` sL   t  |  j ƒ d k r$ t d ƒ ‚ n  | d  k r< g  |  _ n | g |  _ d  S(   Ni   uY   Cannot set singular exclusive_config_file if multiple exclusive_config_files are present.(   RF   Ri   RY   R%   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRj   |  s    c         C` s   |  j  r |  j  S|  j S(   N(   R8   RS   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   src_cache_root‡  s    c         C` s   | |  _  d  S(   N(   R8   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRk   ‹  s    c         C` s©   |  j  sœ t j d ƒ } t j d ƒ } | rE t t | ƒ ƒ |  _  qœ | ri t t t | ƒ ƒ ƒ |  _  qœ t r„ t	 t
 d ƒ |  _  qœ t t d ƒ ƒ |  _  n  t |  j  ƒ S(   u1   This is where source caches and work folders liveu   CONDA_BLD_PATHu   root-diru	   conda-bldu   ~/conda-bld(   RO   R   RC   R   R'   R   R   R   R
   R   R	   R   (   R9   t   _bld_root_envt   _bld_root_rc(    (    s1   lib/python2.7/site-packages/conda_build/config.pyRS     s    	c         C` s   | |  _  d S(   uB   Set croot - if None is passed, then the default value will be usedN(   RO   (   R9   RS   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRS   Ÿ  s    c         C` s   |  j  p |  j S(   N(   t   _output_folderRS   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   output_folder¤  s    c         C` s   | |  _  d  S(   N(   Rn   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRo   ¨  s    c         C` s   t  j j |  j |  j ƒ S(   u`   This is the core folder for a given build.
        It has the environments and work directories.(   R   R   R   RS   t   build_id(   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   build_folder¬  s    c         C` s   |  j  j d t |  ƒ d ƒ S(   Nu   lua(   R6   R'   R   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt	   CONDA_LUA³  s    c         C` s   | |  j  d <d  S(   Nu   lua(   R6   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRr   ¸  s    c         C` s;   |  j  j d t |  ƒ d ƒ } t d j | j d ƒ ƒ ƒ S(   Nu   pythonu    u   .(   R6   R'   R   t   intR   R[   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   CONDA_PY½  s    c         C` s4   t  | ƒ } d j | d | d f ƒ |  j d <d  S(   Nu   .i    i   u   python(   RK   R   R6   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRt   Ã  s    c         C` s;   |  j  j d t |  ƒ d ƒ } t d j | j d ƒ ƒ ƒ S(   Nu   numpyu    u   .(   R6   R'   R   Rs   R   R[   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt	   CONDA_NPYÉ  s    c         C` s4   t  | ƒ } d j | d | d f ƒ |  j d <d  S(   Nu   .i    i   u   numpy(   RK   R   R6   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRu   Ï  s    c         C` s   |  j  j d t |  ƒ d ƒ S(   Nu   perl(   R6   R'   R   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt
   CONDA_PERLÕ  s    c         C` s   | |  j  d <d  S(   Nu   perl(   R6   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRv   Ú  s    c         C` s   |  j  j d t |  ƒ d ƒ S(   Nu   r_base(   R6   R'   R   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   CONDA_Rß  s    c         C` s   | |  j  d <d  S(   Nu   r_base(   R6   (   R9   R?   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRw   å  s    c         C` s‚   | j  d ƒ s* | d k ro t j d k ro t j j t j j | d ƒ ƒ r] t | d ƒ } q~ t | d ƒ } n t | d ƒ } | S(   Nu   winu   noarchu   win32u   python_d.exeu
   python.exeu
   bin/python(   t
   startswithR   RX   R   R   t   isfileR   (   R9   t   prefixRX   t   res(    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _get_pythonê  s    *!c         C` s:   | j  d ƒ r' t | d d d ƒ } n t | d ƒ } | S(   Nu   winu   Libraryu   binu   perl.exeu   bin/perl(   Rx   R   (   R9   Rz   RX   R{   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt	   _get_perlô  s    c         C` s   |  j  j d t |  ƒ d ƒ } | r; | d d k r; d n d } | j d ƒ rq t | d d d j | ƒ ƒ } n t | d	 j | ƒ ƒ } | S(
   Nu   luai    u   2u   luajitu   winu   Libraryu   binu   {}.exeu   bin/{}(   R6   R'   R   Rx   R   R,   (   R9   Rz   RX   t   lua_vert   binary_nameR{   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _get_luaü  s    "!c         C` s|   | j  d ƒ s* | d k rf t j d k rf t | d d ƒ } t j j | ƒ sx t | d d ƒ } qx n t | d d ƒ } | S(   Nu   winu   noarchu   win32u   Scriptsu   R.exeu   binu   R(   Rx   R   RX   R   R   R   t   exists(   R9   Rz   RX   R{   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _get_r  s    *c         C` sa   | j  d ƒ rK t | d d ƒ } t j j | ƒ s] t | d d ƒ } q] n t | d d ƒ } | S(   Nu   winu   Scriptsu   Rscript.exeu   binu   Rscript(   Rx   R   R   R   R   (   R9   Rz   RX   R{   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _get_rscript  s    c   	      C` s:  |  j  r6|  j s | r6t j j | ƒ s8 t d ƒ ‚ g  t |  j ƒ D] } t j j | ƒ ^ qH } t	 g  | D]% } | | j
 d ƒ  | k rp | ^ qp ƒ } |  j r½ | r½ | d |  _ q6t t j |  j ƒ ƒ d k rä |  j n d } | d t t t j ƒ  d ƒ ƒ } | |  _ | r6t j | |  j ƒ q6n  d  S(   NuO   package name should not be a absolute path, to preserve croot during path joinsu   _iÿÿÿÿi    u    iè  (   t   set_build_idRM   R   R   t   isabst   AssertionErrorR   RS   t   basenamet   sortedt   rfindt   dirtyRF   t   listdirt   work_dirRK   Rs   t   timet   shutilt   move(	   R9   t   package_namet   resett   fldrt   folder_basenamesRq   t   build_folderst   old_dirRp   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   compute_build_id  s    .(-$	c         C` s   |  j  S(   uê   This is a per-build (almost) unique id, consisting of the package being built, and the
        time since the epoch, in ms.  It is appended to build and test prefixes, and used to create
        unique work folders for build and test.(   RM   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRp   -  s    c         C` sJ   | j  d ƒ j  d ƒ } t j j | ƒ s7 t d ƒ ‚ t | ƒ |  _ d  S(   Nu   /u   \uL   build_id should not be an absolute path, to preserve croot during path joins(   t   rstripR   R   R…   R†   R   RM   (   R9   RM   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRp   4  s    c         C` s   |  j  S(   N(   t   _prefix_length(   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   prefix_length;  s    c         C` s   | |  _  d  S(   N(   R˜   (   R9   t   length(    (    s1   lib/python2.7/site-packages/conda_build/config.pyR™   ?  s    c         C` s   t  |  j d ƒ S(   Nu   _h_env(   R   Rq   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _short_host_prefixC  s    c         C` sg   |  j  t |  j ƒ } d } t t j | t | ƒ ƒ d ƒ } |  j | | |  j   } t |  j | ƒ S(   Nu
   _placeholdi   (   R™   RF   R›   Rs   t   matht   ceilt   max(   R9   t   placeholder_lengtht   placeholdert   repeats(    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _long_host_prefixG  s
    #c         C` s+   |  j  r |  j } n t |  j d ƒ } | S(   uÄ   The temporary folder where the build environment is created.  The build env contains
        libraries that may be linked, but only if the host env is not specified.  It is placed on
        PATH.u
   _build_env(   t   _merge_build_hostt   host_prefixR   Rq   (   R9   Rz   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   build_prefixO  s    	c         C` s   t  r |  j S|  j S(   u“   The temporary folder where the host environment is created.  The host env contains
        libraries that may be linked.  It is not placed on PATH.(   t   on_winR›   R¢   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyR¤   Z  s    c         C` s   t  |  j d ƒ S(   Nu	   _test_env(   R   Rq   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _short_test_prefixb  s    c         C` s^   |  j  t | ƒ } d } t t j | t | ƒ ƒ d ƒ } | | | |  j   } t | | ƒ S(   Nu
   _placeholdi   (   R™   RF   Rs   Rœ   R   Rž   (   R9   t   base_prefixRŸ   R    R¡   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   _long_prefixf  s
    #c         C` s+   t  s |  j r |  j S|  j |  j ƒ d  S(   u:   The temporary folder where the test environment is creatediþÿÿÿ(   R¦   t   long_test_prefixR§   R©   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   test_prefixm  s    c         C` s   |  j  |  j |  j ƒ S(   N(   t
   python_binR¥   RX   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   build_pythonv  s    c         C` s   |  j  |  j |  j ƒ S(   N(   R|   R¤   R`   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   host_pythonz  s    c         C` s   |  j  |  j |  j ƒ S(   N(   R¬   R«   R`   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   test_python~  s    c         C` s   |  j  | | ƒ S(   N(   R|   (   R9   Rz   RX   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyR¬   ‚  s    c         C` s   |  j  | | ƒ S(   N(   R}   (   R9   Rz   RX   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   perl_bin…  s    c         C` s   |  j  | | ƒ S(   N(   R€   (   R9   Rz   RX   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   lua_binˆ  s    c         C` s   |  j  | | ƒ S(   N(   R‚   (   R9   Rz   RX   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   r_bin‹  s    c         C` s   |  j  | | ƒ S(   N(   Rƒ   (   R9   Rz   RX   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   rscript_binŽ  s    c         C` s    t  |  j d ƒ } t | ƒ | S(   uI   Path to the info dir in the build prefix, where recipe metadata is storedu   info(   R   R¤   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   info_dir‘  s    
c         C` s    t  |  j d ƒ } t | ƒ | S(   ua   Path to the conda-meta dir in the build prefix, where package index json files are
        storedu
   conda-meta(   R   R¤   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   meta_dir˜  s    
c         C` s    t  |  j d ƒ } t | ƒ | S(   u2   Where packages that fail the test phase are placedu   broken(   R   RS   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt
   broken_dir   s    
c         C` s#   t  |  j |  j ƒ } t | ƒ | S(   u!    Dir where the package is saved. (   R   RS   Re   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   bldpkgs_dir§  s    
c         C` s4   t  |  j |  j ƒ t  |  j t ƒ t  |  j d ƒ h S(   u.    Dirs where previous build packages might be. u   noarch(   R   RS   Re   R   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   bldpkgs_dirs®  s    !c         C` s    t  |  j d ƒ } t | ƒ | S(   u6   Where tarballs and zip files are downloaded and storedu	   src_cache(   R   Rk   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt	   src_cache¶  s    
c         C` s    t  |  j d ƒ } t | ƒ | S(   u,   Where local clones of git sources are storedu	   git_cache(   R   Rk   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt	   git_cache½  s    
c         C` s    t  |  j d ƒ } t | ƒ | S(   u+   Where local clones of hg sources are storedu   hg_cache(   R   Rk   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   hg_cacheÄ  s    
c         C` s    t  |  j d ƒ } t | ƒ | S(   u/   Where local checkouts of svn sources are storedu	   svn_cache(   R   Rk   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt	   svn_cacheË  s    
c         C` s    t  |  j d ƒ } t | ƒ | S(   u6   Where the source for the build is extracted/copied to.u   work(   R   Rq   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyRŒ   Ò  s    
c         C` s)   |  j  p t |  j d ƒ } t | ƒ | S(   Nu	   pip_cache(   t   _pip_cache_dirR   Rq   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   pip_cache_dirß  s    
c         C` s   | |  _  d  S(   N(   R½   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyR¾   å  s    c         C` s    t  |  j d ƒ } t | ƒ | S(   uT   The temporary folder where test files are copied to, and where tests start executionu   test_tmp(   R   Rq   R!   (   R9   R   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   test_diré  s    
c         C` s   |  j  |  j k S(   N(   Re   RZ   (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   subdirs_sameð  s    c      
   C` sL  | rÕ t  |  d ƒ rÕ |  j rG t j j |  j ƒ r t |  j ƒ q nH xE |  j |  j |  j	 |  j
 g D]% } t j j | ƒ rf t | ƒ qf qf Wt j j t j j |  j d ƒ ƒ rt t j j |  j d ƒ ƒ qn. t d |  j d |  j d |  j
 d |  j	 d ƒ	 xB t |  j |  j ƒ D]+ } t j j | j ƒ rt | j ƒ qqWd  S(   Nu   dirtyu   prefix_filesu)   
Leaving build/test directories:
  Work:
u	   
  Test:
u:   
Leaving build/test environments:
  Test:
source activate u   
  Build:
source activate u   

(   R;   Rp   R   R   R   Rq   R   RŒ   R¿   R¥   R«   Ry   R   t   printR   t   lockingR¸   t	   lock_file(   R9   t   remove_foldersR   t   lock(    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   cleanô  s&    	%$"		c         C` s"   x |  j  D] } t | ƒ q
 Wd  S(   N(   R¸   R   (   R9   t   folder(    (    s1   lib/python2.7/site-packages/conda_build/config.pyt
   clean_pkgs  s    c         C` sO   t  j  |  ƒ } t  j |  j ƒ | _ t |  d ƒ rK t  j |  j ƒ | _ n  | S(   Nu   variants(   t   copyt   deepcopyR6   R   t   variants(   R9   t   new(    (    s1   lib/python2.7/site-packages/conda_build/config.pyRÉ     s
    c         C` s   d  S(   N(    (   R9   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt	   __enter__  s    c         C` s`   t  |  d ƒ rL | d  k rL t  |  d ƒ rL t t ƒ j d ƒ |  j ƒ  n |  j d t ƒ d  S(   Nu   dirtyu   keep_old_workuh   --dirty flag and --keep-old-work not specified. Removing build/test folder after successful build/test.
RÄ   (   R;   R%   R   R*   t   infoRÆ   R$   (   R9   t   e_typet   e_valuet	   traceback(    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   __exit__  s    ,N(L   R*   t
   __module__t   __file__t   __path__t   __package__t   __doc__R%   R5   R@   R7   t   propertyRV   t   setterRX   RZ   R_   Ra   Rb   R   R`   Re   Rh   Rj   Rk   RS   Ro   Rq   R2   Rr   Rt   Ru   Rv   Rw   R|   R}   R€   R‚   Rƒ   R$   R–   Rp   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¼   RŒ   R¾   R¿   RÀ   R#   RÆ   RÈ   RÉ   RÍ   RÒ   (    (    (    s1   lib/python2.7/site-packages/conda_build/config.pyR3   Ò   s¾   
		2			
				
	
										c         K` sW   |  s t  d | ƒ }  n |  j ƒ  }  | r: |  j |   n  | rS |  j j | ƒ n  |  S(   uO   Always returns a new object - never changes the config that might be passed in.R6   (   R3   RÉ   R7   R6   t   update(   t   configR6   R:   (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   get_or_merge_config&  s    c         C` sµ   |  j  d ƒ p! |  j  d ƒ p! d } g  } x„ | D]| } t j j | ƒ r  t j j | ƒ s‘ t j j t j j t j j t j ƒ  | ƒ ƒ ƒ } n  t	 | ƒ } n  | j
 | ƒ q1 W| S(   Nu   channelu   channels(    (   R'   R   R   R   R…   RN   R   R   t   getcwdR   t   append(   R-   t   channel_urlst   final_channel_urlst   url(    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   get_channel_urls5  s    $6(2   R×   t
   __future__R    R   R   R   RÉ   t   collectionsR   Rœ   R   t   os.pathR   R   R   R   RŽ   R   R   t   conda_interfaceR	   R
   R   RË   R   R   R   R   R   t   utilsR   R   R   R   RX   R¦   t   conda_buildR   R!   R&   Rd   R"   R)   R2   t   objectR3   R%   RÜ   Râ   RS   (    (    (    s1   lib/python2.7/site-packages/conda_build/config.pyt   <module>   sH   """"		
	‡	
ÿ ÿ V	