³ò
 ›\Kc           @   sW  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 e i d j  o7 h  d d <d d <d d <d d <d d <Z n4 h  d d <d d <d d <d d <d d <Z h  h  d d <d d <d d <d d <d d <d <h  d d <d d <d d <d d <d d <d <e d  <h  d d <d d <d d <d d <d d <d! <h  d d <d d <d d <d d <d d <d" <Z d% Z d# e	 f d$ „  ƒ  YZ d S(&   sF   distutils.command.install

Implements the Distutils 'install' command.iÿÿÿÿ(   t   logs8   $Id: install.py 43363 2006-03-27 21:55:21Z phillip.eby $N(   t   *(   t   Command(   t   DEBUG(   t   get_config_vars(   t   DistutilsPlatformError(   t
   write_file(   t   convert_patht
   subst_varst   change_root(   t   DistutilsOptionError(   t   globs   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_homet   ntt   mact   os2t   installc           B   sl  e  Z d  Z dE dF dG dH d	 dD d
 d f dI dJ dK d dD d d f dL dM dN dO dP dQ dR dS dT g Z d d# d& g Z h  d d <Z d* „  Z d+ „  Z 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> e f d? e f d@ e f dA e f dB dC „  f g Z RS(U   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 unders   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  |  _ d  |  _ d  |  _ d |  _ d |  _ d |  _ d |  _ d  |  _ d  |  _ d  |  _ d  S(   Ni   i    (   t   Nonet   prefixt   exec_prefixt   homet   install_baset   install_platbaset   roott   install_purelibt   install_platlibt   install_headerst   install_libt   install_scriptst   install_dataR   t   optimizet
   extra_patht   install_path_fileR   t
   skip_buildt   warn_dirt
   build_baset	   build_libt   record(   t   self(    (    s/   /usr/lib/python2.5/distutils/command/install.pyt   initialize_options   s,    														
							c      
   C   sî  |  i  p |  i p
 |  i o% |  i p
 |  i o t d d ‚ n |  i o! |  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 <|  i i ƒ  d <|  i i ƒ  d <| d <| d d !d <| d <| d	 <| d <| d
 <|  _ |  i ƒ  |  i
 d ƒ |  i |  i d <|  i |  i d <t o& d d k l } d GH| |  i ƒ n |  i ƒ  |  i
 d ƒ |  i d  j o- |  i i o |  i |  _ qG|  i |  _ n |  i 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 botht   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_shortt
   sys_prefixt   sys_exec_prefixs   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   buildR.   R/   (   s
   build_bases
   build_base(   s	   build_libs	   build_lib((   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_fullnamet   config_varst   expand_basedirsR   R=   t   expand_dirsR&   t   ext_modulesR$   R#   t   convert_pathst   handle_extra_patht   install_libbaset   patht   joint
   extra_dirsR"   t   change_rootst   set_undefined_options(   R1   R7   R   R   R=   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyt   finalize_optionsÚ   sl    



				


	c         C   sØ   t  oÍ d d k l } | d GHx± |  i D]¢ } | d } | d d j o | d d !} n |  i i | ƒ 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_getoptR\   t   user_optionst   negative_optt   has_keyRG   t	   translatet   getattr(   R1   t   msgR\   t   optt   opt_namet   val(    (    s/   /usr/lib/python2.5/distutils/command/install.pyRD   [  s    	
 
	c         C   ss  |  i  d  j	 p |  i d  j	 ou |  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  Sn |  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 incompleteR   s*   must not supply exec-prefix without prefixR   (   R    R   R!   R&   R#   R$   R%   R'   R(   R
   R   t   select_schemeR   R   RA   RV   t   normpathRI   (   R1   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyRE   m  s0     

c         C   s±   |  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(   NR   s)   I don't know how to install stuff on '%s'(   R   R   R    R!   Ri   R   RA   RV   Rj   RI   RB   t   KeyErrorR   (   R1   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyRF   ’  s    c         C   sW   t  | } xF t D]> } d | } t |  | ƒ d  j o t |  | | | ƒ q q Wd  S(   Nt   install_(   t   INSTALL_SCHEMESt   SCHEME_KEYSRd   R   t   setattr(   R1   RB   t   schemet   keyt   attrname(    (    s/   /usr/lib/python2.5/distutils/command/install.pyRi   ¥  s    
 
c         C   s}   xv | D]n } t  |  | ƒ } | d  j	 oL t i d j o t i i | ƒ } n t | |  i ƒ } t |  | | ƒ q q Wd  S(   NR3   (	   Rd   R   RA   RB   RV   t
   expanduserR   RO   Ro   (   R1   t   attrst   attrRh   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyt   _expand_attrs®  s     c         C   s   |  i  d d d g ƒ d  S(   NR    R!   R"   (   Rv   (   R1   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyRP   ¸  s    	c         C   s#   |  i  d d d d d d g ƒ d  S(   NR#   R$   R&   R%   R'   R(   (   Rv   (   R1   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyRQ   ½  s    	c         G   s>   x7 | D]/ } d | } t  |  | t t |  | ƒ ƒ ƒ q Wd  S(   NRl   (   Ro   R   Rd   (   R1   t   namesRB   Ru   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyRS   Æ  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    (   R*   R   RK   t   typet
   StringTypeRG   RH   t   lenR
   R   t	   path_fileRX   (   R1   R}   RX   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyRT   Ì  s     	c      	   G   sD   x= | D]5 } d | } t  |  | t |  i t |  | ƒ ƒ ƒ q Wd  S(   NRl   (   Ro   R	   R"   Rd   (   R1   Rw   RB   Ru   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyRY   î  s     
c      	   C   su  |  i  p |  i d ƒ n x! |  i ƒ  D] } |  i | ƒ q( 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(   NR@   s'   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(   R,   t   run_commandt   get_sub_commandsR}   t   create_path_fileR0   t   get_outputsR"   R|   t   xranget   executeR   t   mapRA   RV   Rj   RI   t   normcaseR&   R-   R+   R    t   debug(   R1   t   cmd_namet   outputst   root_lent   countert   sys_pathR&   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyt   runö  s4    
 


 	!
	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(
   RA   RV   RW   RU   R}   R+   Rƒ   R   RX   RC   (   R1   t   filename(    (    s/   /usr/lib/python2.5/distutils/command/install.pyR€     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}   R+   RA   RV   RW   RU   (   R1   Rˆ   R‡   t   cmdR   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyR   )  s      c         C   sC   g  } x6 |  i  ƒ  D]( } |  i | ƒ } | i | i ƒ  ƒ q W| S(   N(   R   RŽ   t   extendt
   get_inputs(   R1   t   inputsR‡   R   (    (    s/   /usr/lib/python2.5/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.(   RK   t   has_pure_modulest   has_ext_modules(   R1   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyt   has_libF  s    c         C   s   |  i  i ƒ  S(   N(   RK   t   has_headers(   R1   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyR—   L  s    c         C   s   |  i  i ƒ  S(   N(   RK   t   has_scripts(   R1   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyR˜   O  s    c         C   s   |  i  i ƒ  S(   N(   RK   t   has_data_files(   R1   (    (    s/   /usr/lib/python2.5/distutils/command/install.pyt   has_dataR  s    R&   R%   R'   R(   t   install_egg_infoc         C   s   t  S(    (   t   True(   R1   (    (    s/   /usr/lib/python2.5/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`   t   boolean_optionsRa   R2   R[   RD   RE   RF   Ri   Rv   RP   RQ   RS   RT   RY   RŒ   R€   R   R’   R–   R—   R˜   Rš   t   sub_commands(    (    (    s/   /usr/lib/python2.5/distutils/command/install.pyR   M   s€                 		J			%				
					"		&											(   s   purelibs   platlibs   headerss   scriptss   data(   t   __doc__t	   distutilsR    t   __revision__RI   RA   RG   t   typest   distutils.coreR   t   distutils.debugR   t   distutils.sysconfigR   t   distutils.errorsR   t   distutils.file_utilR   t   distutils.utilR   R   R	   R
   R   RJ   t   WINDOWS_SCHEMERm   Rn   R   (    (    (    s/   /usr/lib/python2.5/distutils/command/install.pys   <module>   sj   $
																									