Ńņ
$8Zc           @   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' 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 d0 6h d+ d 6d+ d 6d1 d 6d2 d 6d. d 6d3 6h d d 6d d 6d d 6d d 6d d 6d4 6h d+ d 6d+ d 6d5 d 6d- d 6d. d 6d6 6h d d 6d d 6d d 6d d 6d d 6d7 6h d+ d 6d+ d 6d, d 6d- d 6d. d 6d8 6Z d; Z d9 e	 f d:     YZ d S(<   sF   distutils.command.install

Implements the Distutils 'install' command.i’’’’(   t   logs   $Id$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_prefixs5   $base/local/lib/python$py_version_short/dist-packagess9   $platbase/local/lib/python$py_version_short/dist-packagess6   $base/local/include/python$py_version_short/$dist_names   $base/local/bins   $base/localt
   unix_locals/   $base/lib/python$py_version_short/dist-packagess3   $platbase/lib/python$py_version_short/dist-packagest
   deb_systems   $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 dJ dK dL d dI d e f dM d dI d d f dN dO dP d dI d d f dQ dR dS dT dU dV dW dX dY dZ g Z d d% d( d g Z h d d  6Z 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   Z dB   Z dC e f dD e f dE e f dF e f dG dH   f g Z RS([   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 filess   install-layout=s7   installation layout to choose (known values: deb, unix)c         C   s÷   d  |  _ 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  |  _ d  S(   Ni    i   (   t   Nonet   prefixt   exec_prefixt   homeR   t   prefix_optiont   install_baset   install_platbaset   roott   install_purelibt   install_platlibt   install_headerst   install_libt   install_scriptst   install_dataR   t   install_userbaseR   t   install_usersitet   install_layoutR    t   optimizet
   extra_patht   install_path_fileR#   t
   skip_buildt   warn_dirt
   build_baset	   build_libt   record(   t   self(    (    s/   /usr/lib/python2.6/distutils/command/install.pyt   initialize_optionsĀ   s6    																			
							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   buildR;   R<   (   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_fullnameR3   R4   t   config_varst   expand_basedirsR   RM   t   expand_dirst   create_home_pathR0   t   ext_modulesR.   R-   t   convert_pathst   handle_extra_patht   install_libbaset   patht   joint
   extra_dirsR,   t   change_rootst   set_undefined_options(   R>   RD   R&   R'   RM   (    (    s/   /usr/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_getoptRm   t   user_optionst   negative_optRW   t	   translatet   getattr(   R>   t   msgRm   t   optt   opt_namet   val(    (    s/   /usr/lib/python2.6/distutils/command/install.pyRT   ”  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 |  _ |  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 o^ |  i i   d j o |  i d  qĀ|  i i   d j o |  i d	  qĀt	 d
   n¢ |  i o t i i |  i  d j p0 |  i
 d j o d t i j p d t i j o |  i d	  n; t i i |  i  d j o |  i d  n |  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 prefixt   debR   t   unixR   s"   unknown value for --install-layouts
   /usr/locali    t   PYTHONUSERBASEt   real_prefixR   (   Ry   (   Rz   (   R*   R%   R+   R0   R-   R.   R/   R1   R2   R   R   R3   R   t   select_schemeR(   R&   R)   R'   RQ   Rg   t   normpathRY   R5   t   lowert   environt   __dict__(   R>   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyRU   ³  sX     



& 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   R3   R%   R   R*   R+   R}   RQ   RR   R(   R&   Rg   R~   RY   t   KeyError(   R>   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyRV   ļ  s"    
c         C   sW   t  | } xF t D]> } d | } t |  |  d  j o t |  | | |  q q Wd  S(   Nt   install_(   t   INSTALL_SCHEMESt   SCHEME_KEYSRt   R%   t   setattr(   R>   RR   t   schemet   keyt   attrname(    (    s/   /usr/lib/python2.6/distutils/command/install.pyR}     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   (	   Rt   R%   RQ   RR   Rg   t
   expanduserR   R_   R   (   R>   t   attrst   attrRx   (    (    s/   /usr/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>   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyR`     s    	c         C   s#   |  i  d d d d d d g  d  S(   NR-   R.   R0   R/   R1   R2   (   R   (   R>   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyRa      s    	c         G   s>   x7 | D]/ } d | } t  |  | t t |  |    q Wd  S(   NR   (   R   R   Rt   (   R>   t   namesRR   R   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyRd   )  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    (   R7   R%   R[   t   typet
   StringTypeRW   RX   t   lenR   R   t	   path_fileRi   (   R>   R   Ri   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyRe   /  s     	c      	   G   sD   x= | D]5 } d | } t  |  | t |  i t |  |    q Wd  S(   NR   (   R   R	   R,   Rt   (   R>   R   RR   R   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyRj   Q  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   RQ   Rg   R   R_   t	   iteritemst
   startswitht   isdirt   debug_printt   makedirs(   R>   R(   RR   Rg   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyRb   V  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(   NRP   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(   R9   t   run_commandR[   t   get_command_objt	   plat_nameR:   R
   R   t   get_sub_commandsR   t   create_path_fileR=   t   get_outputsR,   R   t   xranget   executeR   t   mapRQ   Rg   R~   RY   t   normcaseR0   R8   R    t   debug(   R>   t
   build_platt   cmd_namet   outputst   root_lent   countert   sys_pathR0   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyt   runc  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(
   RQ   Rg   Rh   Rf   R   R8   R£   R   Ri   RS   (   R>   t   filename(    (    s/   /usr/lib/python2.6/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   R8   RQ   Rg   Rh   Rf   (   R>   R©   RØ   t   cmdR®   (    (    s/   /usr/lib/python2.6/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(   R>   t   inputsRØ   R±   (    (    s/   /usr/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.(   R[   t   has_pure_modulest   has_ext_modules(   R>   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyt   has_lib»  s    c         C   s   |  i  i   S(   N(   R[   t   has_headers(   R>   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyRø   Į  s    c         C   s   |  i  i   S(   N(   R[   t   has_scripts(   R>   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyR¹   Ä  s    c         C   s   |  i  i   S(   N(   R[   t   has_data_files(   R>   (    (    s/   /usr/lib/python2.6/distutils/command/install.pyt   has_dataĒ  s    R0   R/   R1   R2   t   install_egg_infoc         C   s   t  S(    (   t   True(   R>   (    (    s/   /usr/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(   s   install-layout=Ns7   installation layout to choose (known values: deb, unix)(   t   __name__t
   __module__t   descriptionR%   R   Rq   t   boolean_optionsRr   R?   Rl   RT   RU   RV   R}   R   R`   Ra   Rd   Re   Rj   Rb   R­   R    R”   R³   R·   Rø   R¹   R»   t   sub_commands(    (    (    s/   /usr/lib/python2.6/distutils/command/install.pyR   z   s      
            		Q			<				
					"			.											(   s   purelibs   platlibs   headerss   scriptss   data(    t   __doc__t	   distutilsR    t   __revision__RY   RQ   RW   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   RZ   t   WINDOWS_SCHEMER   R   R   (    (    (    s/   /usr/lib/python2.6/distutils/command/install.pyt   <module>   s¶   $

