Ñò
—à"Ic           @   sÙ  d  Z  d d k l Z d Z d d k Z d d k Z d d k Z d d k Td d k l	 Z	 d d k
 l Z d d k l Z d d	 k l Z d d
 k l Z d d k l Z l Z l Z d d k l Z d d k l Z d d k l Z d d k l Z e i d j  o- h d d 6d d 6d d 6d d 6d d 6Z n* h d d 6d d 6d d 6d d 6d d 6Z h	 h d d 6d d 6d d 6d d 6d d 6d 6h d d 6d d 6d  d 6d d 6d d 6d! 6h d" d 6d" d 6d# d 6d$ d 6d% d 6d& 6e d' 6h d" d 6d" d 6d( d 6d) d 6d% d 6d* 6h d d 6d d 6d d 6d d 6d d 6d+ 6h d" d 6d" d 6d, d 6d$ d 6d% d 6d- 6h d d 6d d 6d d 6d d 6d d 6d. 6h d" d 6d" d 6d# d 6d$ d 6d% d 6d/ 6Z d2 Z d0 e	 f d1 „  ƒ  YZ d S(3   sF   distutils.command.install

Implements the Distutils 'install' command.iÿÿÿÿ(   t   logs=   $Id: install.py 62788 2008-05-06 22:41:46Z christian.heimes $N(   t   *(   t   Command(   t   DEBUG(   t   get_config_vars(   t   DistutilsPlatformError(   t
   write_file(   t   convert_patht
   subst_varst   change_root(   t   get_platform(   t   DistutilsOptionError(   t	   USER_BASE(   t	   USER_SITEs   2.2s   $baset   purelibt   platlibs   $base/Include/$dist_namet   headerss   $base/Scriptst   scriptst   datas   $base/Lib/site-packagess/   $base/lib/python$py_version_short/site-packagess3   $platbase/lib/python$py_version_short/site-packagess0   $base/include/python$py_version_short/$dist_names	   $base/bint   unix_prefixs   $base/lib/pythons   $base/include/python/$dist_namet	   unix_homes	   $usersites4   $userbase/include/python$py_version_short/$dist_names   $userbase/bins	   $userbaset	   unix_usert   nts4   $userbase/Python$py_version_nodot/Include/$dist_names   $userbase/Scriptst   nt_usert   macs.   $userbase/$py_version_short/include/$dist_namet   mac_usert   os2t   os2_homet   installc           B   s†  e  Z d  Z dH dI dJ d dG d e f dK d dG d d f dL dM dN d dG d d f dO dP dQ dR dS dT dU dV dW g Z d d% d( d g Z h d d  6Z d, „  Z d- „  Z	 d. „  Z
 d/ „  Z d0 „  Z d1 „  Z d2 „  Z d3 „  Z d4 „  Z d5 „  Z d6 „  Z d7 „  Z d8 „  Z d9 „  Z d: „  Z d; „  Z d< „  Z d= „  Z d> „  Z d? „  Z d@ „  Z dA e f dB e f dC e f dD e f dE dF „  f g Z RS(X   s'   install everything from build directorys   prefix=s   installation prefixs   exec-prefix=s.   (Unix only) prefix for platform-specific filess   home=s+   (Unix only) home directory to install undert   users!   install in user site-package '%s's   install-base=s;   base installation directory (instead of --prefix or --home)s   install-platbase=s8   base installation directory for platform-specific files s$   (instead of --exec-prefix or --home)s   root=s<   install everything relative to this alternate root directorys   install-purelib=s;   installation directory for pure Python module distributionss   install-platlib=s8   installation directory for non-pure module distributionss   install-lib=s4   installation directory for all module distributions s3   (overrides --install-purelib and --install-platlib)s   install-headers=s(   installation directory for C/C++ headerss   install-scripts=s)   installation directory for Python scriptss   install-data=s%   installation directory for data filest   compilet   cs   compile .py to .pyc [default]s
   no-compiles   don't compile .py filess	   optimize=t   Osl   also compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0]t   forcet   fs1   force installation (overwrite any existing files)s
   skip-builds2   skip rebuilding everything (for testing/debugging)s   record=s3   filename in which to record list of installed filesc         C   så   d  |  _ d  |  _ d  |  _ d |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _	 d  |  _
 d  |  _ d  |  _ d  |  _ t |  _ t |  _ d  |  _ d  |  _ d  |  _ d |  _ d |  _ d |  _ d |  _ d  |  _ d  |  _ d  |  _ d  S(   Ni    i   (   t   Nonet   prefixt   exec_prefixt   homeR   t   install_baset   install_platbaset   roott   install_purelibt   install_platlibt   install_headerst   install_libt   install_scriptst   install_dataR   t   install_userbaseR   t   install_usersiteR   t   optimizet
   extra_patht   install_path_fileR!   t
   skip_buildt   warn_dirt
   build_baset	   build_libt   record(   t   self(    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyt   initialize_options±   s2    																	
							c         C   sm  |  i  p |  i p
 |  i o% |  i p
 |  i o t d d ‚ n |  i o! |  i  p
 |  i o t d ‚ n |  i oB |  i  p( |  i p |  i p |  i p
 |  i o t d ƒ ‚ n t i d j o( |  i o |  i	 d ƒ d  |  _ qò n |  i d ƒ t i d j o |  i ƒ  n |  i ƒ  |  i d ƒ t i t i ƒ d	 } t d
 d ƒ \ } } h |  i i ƒ  d 6|  i i ƒ  d 6|  i i ƒ  d 6| d 6| d	 d !d 6| d	 | d d 6| d 6| d
 6| d 6| d 6|  i d 6|  i d 6|  _ |  i ƒ  |  i d ƒ |  i |  i d <|  i |  i d <t o& d d k l } d GH| |  i ƒ n |  i ƒ  |  i d ƒ |  i o |  i ƒ  n |  i d  j o- |  i i  o |  i! |  _ qÀ|  i" |  _ n |  i# d d  d! d" d# d$ d d ƒ |  i$ ƒ  |  i |  _% t i& i' |  i |  i( ƒ |  _ |  i) d  j	 o# |  i* d% d d  d! d" d# d$ ƒ n |  i d& ƒ |  i+ d' d* d+ ƒ d  S(,   Ns.   must supply either prefix/exec-prefix/home or s)   install-base/install-platbase -- not boths9   must supply either home or prefix/exec-prefix -- not bothsJ   can't combine user with with prefix/exec_prefix/home or install_(plat)baset   posixs+   exec-prefix option ignored on this platforms   pre-finalize_{unix,other}s   post-finalize_{unix,other}()i    R$   R%   t	   dist_namet   dist_versiont   dist_fullnamet
   py_versioni   t   py_version_shorti   t   py_version_nodott
   sys_prefixt   sys_exec_prefixt   userbaset   usersites   post-expand_basedirs()t   baset   platbaseiÿÿÿÿ(   t   pprints   config vars:s   post-expand_dirs()t   libR   R   R   R   R   t   libbases   after prepending roott   buildR7   R8   (   s
   build_bases
   build_base(   s	   build_libs	   build_lib(,   R$   R%   R&   R'   R(   R   R   t   ost   namet   warnR#   t	   dump_dirst   finalize_unixt   finalize_othert   stringt   splitt   syst   versionR   t   distributiont   get_namet   get_versiont   get_fullnameR0   R1   t   config_varst   expand_basedirsR   RI   t   expand_dirst   create_home_pathR-   t   ext_modulesR+   R*   t   convert_pathst   handle_extra_patht   install_libbaset   patht   joint
   extra_dirsR)   t   change_rootst   set_undefined_options(   R:   R@   R$   R%   RI   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyt   finalize_optionsþ   s~    
(






	

	c         C   sÕ   t  oÊ d d k l } | d GHx® |  i D]Ÿ } | d } | d d j o | d d !} n | |  i j o- t i |  i | | ƒ } t |  | ƒ } n" t i | | ƒ } t |  | ƒ } d | | f GHq* Wn d  S(   Niÿÿÿÿ(   t   longopt_xlatet   :i    t   =s     %s: %s(   R   t   distutils.fancy_getoptRi   t   user_optionst   negative_optRS   t	   translatet   getattr(   R:   t   msgRi   t   optt   opt_namet   val(    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyRP   Œ  s    	
 
	c         C   s¾  |  i  d  j	 p |  i d  j	 or |  i d  j o  |  i d  j o |  i d  j p0 |  i d  j p  |  i d  j p |  i d  j o t	 d ‚ n d  S|  i
 oD |  i d  j o t d ƒ ‚ n |  i |  _  |  _ |  i d ƒ nÛ |  i d  j	 o$ |  i |  _  |  _ |  i d ƒ n§ |  i d  j oQ |  i d  j	 o t	 d ‚ n t i i t i ƒ |  _ t i i t i ƒ |  _ n! |  i d  j o |  i |  _ n |  i |  _  |  i |  _ |  i d ƒ d  S(   NsP   install-base or install-platbase supplied, but installation scheme is incompletes$   User base directory is not specifiedR   R   s*   must not supply exec-prefix without prefixR   (   R'   R#   R(   R-   R*   R+   R,   R.   R/   R   R   R0   R   t   select_schemeR&   R$   R%   RM   Rc   t   normpathRU   (   R:   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyRQ   ž  s<     


c         C   s  |  i  oK |  i d  j o t d ƒ ‚ n |  i |  _ |  _ |  i t i d ƒ n® |  i	 d  j	 o$ |  i	 |  _ |  _ |  i d ƒ nz |  i
 d  j o t i i t i
 ƒ |  _
 n |  i
 |  _ |  _ y |  i t i ƒ Wn# t j
 o t d t i ‚ n Xd  S(   Ns$   User base directory is not specifiedt   _userR   s)   I don't know how to install stuff on '%s'(   R   R0   R#   R   R'   R(   Ru   RM   RN   R&   R$   Rc   Rv   RU   t   KeyError(   R:   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyRR   É  s"    
c         C   sW   t  | } xF t D]> } d | } t |  | ƒ d  j o t |  | | | ƒ q q Wd  S(   Nt   install_(   t   INSTALL_SCHEMESt   SCHEME_KEYSRp   R#   t   setattr(   R:   RN   t   schemet   keyt   attrname(    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyRu   â  s    
 
c         C   s�   x† | D]~ } t  |  | ƒ } | d  j	 o\ t i d j p t i d j o t i i | ƒ } n t | |  i ƒ } t |  | | ƒ q q Wd  S(   NR<   R   (	   Rp   R#   RM   RN   Rc   t
   expanduserR   R[   R|   (   R:   t   attrst   attrRt   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyt   _expand_attrsë  s      c         C   s   |  i  d d d g ƒ d  S(   NR'   R(   R)   (   Rƒ   (   R:   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyR\   õ  s    	c         C   s#   |  i  d d d d d d g ƒ d  S(   NR*   R+   R-   R,   R.   R/   (   Rƒ   (   R:   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyR]   ú  s    	c         G   s>   x7 | D]/ } d | } t  |  | t t |  | ƒ ƒ ƒ q Wd  S(   NRy   (   R|   R   Rp   (   R:   t   namesRN   R‚   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyR`     s     
c         C   sô   |  i  d  j o |  i i  |  _  n |  i  d  j	 oŸ t |  i  ƒ t j o t i |  i  d ƒ |  _  n t |  i  ƒ d j o |  i  d } } n3 t |  i  ƒ d j o |  i  \ } } n
 t d ‚ t	 | ƒ } n d  } d } | |  _
 | |  _ d  S(   Nt   ,i   i    i   sY   'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementst    (   R3   R#   RW   t   typet
   StringTypeRS   RT   t   lenR   R   t	   path_fileRe   (   R:   RŠ   Re   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyRa   	  s     	c      	   G   sD   x= | D]5 } d | } t  |  | t |  i t |  | ƒ ƒ ƒ q Wd  S(   NRy   (   R|   R	   R)   Rp   (   R:   R„   RN   R‚   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyRf   +  s     
c         C   s”   |  i  p d St t i i d ƒ ƒ } xf |  i i ƒ  D]U \ } } | i | ƒ o9 t i i | ƒ o% |  i	 d | ƒ t i
 | d ƒ q7 q7 Wd S(   s#   Create directories under ~
        Nt   ~s   os.makedirs('%s', 0700)iÀ  (   R   R   RM   Rc   R€   R[   t	   iteritemst
   startswitht   isdirt   debug_printt   makedirs(   R:   R&   RN   Rc   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyR^   0  s    
 $c      	   C   s´  |  i  pP |  i d ƒ |  i i d ƒ i } |  i o  | t ƒ  j o t d ƒ ‚ qZ n x! |  i ƒ  D] } |  i | ƒ qg W|  i	 o |  i
 ƒ  n |  i o |  i ƒ  } |  i oB t |  i ƒ } x0 t t | ƒ ƒ D] } | | | | | <qØ Wn |  i t |  i | f d |  i ƒ n t t i i t i ƒ } t t i i | ƒ } t i i t i i |  i ƒ ƒ } |  i o9 |  i	 o |  i o$ | | j o t i d |  i ƒ n d  S(   NRL   s"   Can't install when cross-compilings'   writing list of installed files to '%s'sƒ   modules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself(   R5   t   run_commandRW   t   get_command_objt	   plat_nameR6   R
   R   t   get_sub_commandsRŠ   t   create_path_fileR9   t   get_outputsR)   R‰   t   xranget   executeR   t   mapRM   Rc   Rv   RU   t   normcaseR-   R4   R    t   debug(   R:   t
   build_platt   cmd_namet   outputst   root_lent   countert   sys_pathR-   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyt   run=  s:    
 


 	!
	c         C   se   t  i i |  i |  i d ƒ } |  i o' |  i t | |  i g f d | ƒ n |  i	 d | ƒ d  S(   Ns   .pths   creating %ss   path file '%s' not created(
   RM   Rc   Rd   Rb   RŠ   R4   R˜   R   Re   RO   (   R:   t   filename(    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyR•   k  s    
	c         C   s£   g  } xX |  i  ƒ  D]J } |  i | ƒ } x2 | i ƒ  D]$ } | | j o | i | ƒ q5 q5 Wq W|  i o4 |  i o* | i t i i |  i	 |  i d ƒ ƒ n | S(   Ns   .pth(
   R”   t   get_finalized_commandR–   t   appendRŠ   R4   RM   Rc   Rd   Rb   (   R:   Rž   R�   t   cmdR£   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyR–   x  s      c         C   sC   g  } x6 |  i  ƒ  D]( } |  i | ƒ } | i | i ƒ  ƒ q W| S(   N(   R”   R¤   t   extendt
   get_inputs(   R:   t   inputsR�   R¦   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyR¨   ‰  s     c         C   s   |  i  i ƒ  p |  i  i ƒ  S(   sR   Return true if the current distribution has any Python
        modules to install.(   RW   t   has_pure_modulest   has_ext_modules(   R:   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyt   has_lib•  s    c         C   s   |  i  i ƒ  S(   N(   RW   t   has_headers(   R:   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyR­   ›  s    c         C   s   |  i  i ƒ  S(   N(   RW   t   has_scripts(   R:   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyR®   ž  s    c         C   s   |  i  i ƒ  S(   N(   RW   t   has_data_files(   R:   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyt   has_data¡  s    R-   R,   R.   R/   t   install_egg_infoc         C   s   t  S(    (   t   True(   R:   (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyt   <lambda>«  s    N(   s   prefix=Ns   installation prefix(   s   exec-prefix=Ns.   (Unix only) prefix for platform-specific files(   s   home=Ns+   (Unix only) home directory to install under(   s   install-base=Ns;   base installation directory (instead of --prefix or --home)(   s   root=Ns<   install everything relative to this alternate root directory(   s   install-purelib=Ns;   installation directory for pure Python module distributions(   s   install-platlib=Ns8   installation directory for non-pure module distributions(   s   install-headers=Ns(   installation directory for C/C++ headers(   s   install-scripts=Ns)   installation directory for Python scripts(   s   install-data=Ns%   installation directory for data files(   s   compileR   s   compile .py to .pyc [default](   s
   no-compileNs   don't compile .py files(   s	   optimize=R    sl   also compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0](   s   forceR"   s1   force installation (overwrite any existing files)(   s
   skip-buildNs2   skip rebuilding everything (for testing/debugging)(   s   record=Ns3   filename in which to record list of installed files(   t   __name__t
   __module__t   descriptionR#   R   Rm   t   boolean_optionsRn   R;   Rh   RP   RQ   RR   Ru   Rƒ   R\   R]   R`   Ra   Rf   R^   R¢   R•   R–   R¨   R¬   R­   R®   R°   t   sub_commands(    (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyR   l   s†      
           		M	Ž		+				
					"			.											(   s   purelibs   platlibs   headerss   scriptss   data(    t   __doc__t	   distutilsR    t   __revision__RU   RM   RS   t   typest   distutils.coreR   t   distutils.debugR   t   distutils.sysconfigR   t   distutils.errorsR   t   distutils.file_utilR   t   distutils.utilR   R   R	   R
   R   t   siteR   R   RV   t   WINDOWS_SCHEMERz   R{   R   (    (    (    s6   /mit/python/lib/python2.6/distutils/command/install.pyt   <module>   sž   $

