£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>
B
    ~ fuh                 @   s  d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ d dlmZmZmZ d d	lmZ d d
l
mZ d dlmZ d dlmZ dZddddddZddddddddddddedZerdddddded< ddd d!dded"< dZG d#d$ d$eZdS )%    N)log)Command)DEBUG)get_config_vars)DistutilsPlatformError)
write_file)convert_path
subst_varschange_root)get_platform)DistutilsOptionError)	USER_BASE)	USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez$base/Scriptsz$base)purelibplatlibheadersscriptsdataz/$base/lib/python$py_version_short/site-packagesz5$platbase/lib64/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz$base/lib/pythonz$base/lib64/pythonz$base/include/python/$dist_name)unix_prefix	unix_homentz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz	$userbaseZnt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez$userbase/bin	unix_userc               @   s:  e Zd ZdZdddddddd	d
dddddddddgZdddgZer`eddde f ed ddiZ	dd Z
dd Zdd  Zd!d" Zd#d$ Zd%d& Zd'd( Zd)d* Zd+d, Zd-d. Zd/d0 Zd1d2 Zd3d4 Zd5d6 Zd7d8 Zd9d: Zd;d< Zd=d> Zd?d@ ZdAdB ZdCdD ZdEefdFefdGefdHefdIdJdK fgZdS )Linstallz'install everything from build directory)zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)zinstall-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz<install everything relative to this alternate root directory)zinstall-purelib=Nz;installation directory for pure Python module distributions)zinstall-platlib=Nz8installation directory for non-pure module distributions)zinstall-lib=Nzginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))zinstall-headers=Nz(installation directory for C/C++ headers)zinstall-scripts=Nz)installation directory for Python scripts)zinstall-data=Nz%installation directory for data files)compileczcompile .py to .pyc [default])z
no-compileNzdon't compile .py files)z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])forcefz1force installation (overwrite any existing files))z
skip-buildNz2skip rebuilding everything (for testing/debugging))zrecord=Nz3filename in which to record list of installed filesr   r   z
skip-builduserNz!install in user site-package '%s'z
no-compilec             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 )Nr      )prefixexec_prefixhomer   install_baseinstall_platbaserootinstall_purelibinstall_platlibinstall_headersinstall_libinstall_scriptsinstall_datar   install_userbaser   install_usersiter   optimize
extra_pathinstall_path_filer   
skip_buildwarn_dir
build_base	build_librecord)self r7   >/opt/alt/python37/lib64/python3.7/distutils/command/install.pyinitialize_options   s2    zinstall.initialize_optionsc             C   sx  | j s| js| jr&| js| jr&td| jr@| j s8| jr@td| jrl| j sd| jsd| jsd| jsd| jrltdtjdkr| jr| 	d d | _| 
d tjdkr|   n|   | 
d tj d }td	d
\}}y
tj}W n tk
r   d}Y nX | j | j | j |dtjd d  dtjd d  |||||d| _trf| j| jd< | j| jd< |   | 
d | j| jd< | j| jd< trddlm} td || j |    | 
d | jr| !  | j"d kr| jj#r| j$| _"n| j%| _"| &dddddddd | '  | j"| _(tj)*| j"| j+| _"| j,d k	r\| -ddddddd | 
d | .d d!d" d S )#NzWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)baseposixz+exec-prefix option ignored on this platformzpre-finalize_{unix,other}zpost-finalize_{unix,other}()r   r    r!    z%d.%d   z%d%d)Z	dist_nameZdist_versionZdist_fullname
py_versionZpy_version_shortZpy_version_nodotZ
sys_prefixr    Zsys_exec_prefixr!   abiflagsuserbaseZusersitezpost-expand_basedirs()baseZplatbase)pprintzconfig vars:zpost-expand_dirs()libr   r   r   r   r   Zlibbasezafter prepending rootbuild)r3   r3   )r4   r4   )/r    r!   r"   r#   r$   r   r   osnamewarn	dump_dirsfinalize_unixfinalize_othersysversionsplitr   r>   AttributeErrordistributionZget_nameZget_versionZget_fullnameversion_infoconfig_varsHAS_USER_SITEr,   r-   expand_basedirsr   rA   printexpand_dirscreate_home_pathr)   Zext_modulesr'   r&   convert_pathshandle_extra_pathinstall_libbasepathjoin
extra_dirsr%   change_rootsZset_undefined_options)r6   r=   r    r!   r>   rA   r7   r7   r8   finalize_options   s    

















zinstall.finalize_optionsc             C   s   t sd S ddlm} t|d  x|| jD ]r}|d }|d dkrN|dd }|| jkrz| j| }||}t| | }n||}t| |}td|| q*W d S )Nr   )longopt_xlate:=z  %s: %s)	r   Zdistutils.fancy_getoptr^   r   debuguser_optionsnegative_opt	translategetattr)r6   msgr^   optZopt_namevalr7   r7   r8   rG   u  s    




zinstall.dump_dirsc             C   s"  | j d k	s| jd k	r\| jd kr2| jd kr2| jd ksP| jd ksP| jd ksP| jd krXtdd S | j	r| j
d krttd| j
 | _ | _| d n| jd k	r| j | _ | _| d nl| jd kr| jd k	rtdtjtj| _tjtj| _n| jd kr| j| _| j| _ | j| _| d d S )NzPinstall-base or install-platbase supplied, but installation scheme is incompletez$User base directory is not specifiedr   r   z*must not supply exec-prefix without prefixr   )r#   r$   r)   r&   r'   r(   r*   r+   r   r   r,   r   select_schemer"   r    r!   rD   rY   normpathrJ   )r6   r7   r7   r8   rH     s<    









zinstall.finalize_unixc             C   s   | j r8| jd krtd| j | _| _| tjd  n| jd k	r\| j | _| _| d n\| j	d krvtj
tj	| _	| j	 | _| _y| tj W n" tk
r   tdtj Y nX d S )Nz$User base directory is not specifiedZ_userr   z)I don't know how to install stuff on '%s')r   r,   r   r#   r$   rj   rD   rE   r"   r    rY   rk   rJ   KeyError)r6   r7   r7   r8   rI     s"    


zinstall.finalize_otherc             C   s@   t | }x2tD ]*}d| }t| |d krt| |||  qW d S )Ninstall_)INSTALL_SCHEMESSCHEME_KEYSrf   setattr)r6   rE   ZschemekeyZattrnamer7   r7   r8   rj     s
    
zinstall.select_schemec             C   s\   xV|D ]N}t | |}|d k	rtjdks0tjdkr<tj|}t|| j}t| || qW d S )Nr:   r   )rf   rD   rE   rY   
expanduserr	   rP   rp   )r6   Zattrsattrri   r7   r7   r8   _expand_attrs  s    

zinstall._expand_attrsc             C   s   |  dddg d S )Nr#   r$   r%   )rt   )r6   r7   r7   r8   rR     s    zinstall.expand_basedirsc             C   s   |  ddddddg d S )Nr&   r'   r)   r(   r*   r+   )rt   )r6   r7   r7   r8   rT     s    zinstall.expand_dirsc             G   s0   x*|D ]"}d| }t | |tt| | qW d S )Nrm   )rp   r   rf   )r6   namesrE   rs   r7   r7   r8   rV     s    
zinstall.convert_pathsc             C   s   | j d kr| jj | _ | j d k	rtd t| j trB| j d| _ t| j dkr`| j d  }}n"t| j dkrz| j \}}ntdt	|}nd }d}|| _
|| _d S )NzIDistribution option extra_path is deprecated. See issue27919 for details.,r   r   r<   zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr;   )r/   rN   r   rF   
isinstancestrrL   lenr   r   	path_filer[   )r6   rz   r[   r7   r7   r8   rW     s$    



zinstall.handle_extra_pathc          	   G   s4   x.|D ]&}d| }t | |t| jt| | qW d S )Nrm   )rp   r
   r%   rf   )r6   ru   rE   rs   r7   r7   r8   r\     s    
zinstall.change_rootsc             C   sf   | j s
d S ttjd}xF| j D ]8\}}||r&tj|s&| 	d|  t
|d q&W d S )N~zos.makedirs('%s', 0o700)i  )r   r   rD   rY   rr   rP   items
startswithisdirZdebug_printmakedirs)r6   r"   rE   rY   r7   r7   r8   rU     s    zinstall.create_home_pathc             C   s*  | j s6| d | jdj}| jr6|t kr6tdx|  D ]}| | q@W | j	r`| 
  | jr|  }| jrt| j}x(tt|D ]}|| |d  ||< qW | t| j|fd| j  ttjjtj}ttjj|}tjtj| j}| jr&| j	r| js&||kr&td| j d S )NrC   z"Can't install when cross-compilingz'writing list of installed files to '%s'zmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r1   Zrun_commandrN   Zget_command_objZ	plat_namer2   r   r   get_sub_commandsrz   create_path_filer5   get_outputsr%   ry   rangeexecuter   maprD   rY   rk   rJ   normcaser)   r0   r   rb   )r6   Z
build_platcmd_nameoutputsZroot_lenZcounterZsys_pathr)   r7   r7   r8   run  s6    



zinstall.runc             C   sJ   t j| j| jd }| jr8| t|| jgfd|  n| 	d|  d S )Nz.pthzcreating %szpath file '%s' not created)
rD   rY   rZ   rX   rz   r0   r   r   r[   rF   )r6   filenamer7   r7   r8   r   I  s    

zinstall.create_path_filec             C   sp   g }x>|   D ]2}| |}x"| D ]}||kr&|| q&W qW | jrl| jrl|tj| j	| jd  |S )Nz.pth)
r   get_finalized_commandr   appendrz   r0   rD   rY   rZ   rX   )r6   r   r   cmdr   r7   r7   r8   r   W  s    
zinstall.get_outputsc             C   s2   g }x(|   D ]}| |}||  qW |S )N)r   r   extend
get_inputs)r6   Zinputsr   r   r7   r7   r8   r   h  s
    
zinstall.get_inputsc             C   s   | j  p| j  S )N)rN   Zhas_pure_modulesZhas_ext_modules)r6   r7   r7   r8   has_libt  s    
zinstall.has_libc             C   s
   | j  S )N)rN   has_headers)r6   r7   r7   r8   r   z  s    zinstall.has_headersc             C   s
   | j  S )N)rN   has_scripts)r6   r7   r7   r8   r     s    zinstall.has_scriptsc             C   s
   | j  S )N)rN   Zhas_data_files)r6   r7   r7   r8   has_data  s    zinstall.has_datar)   r(   r*   r+   Zinstall_egg_infoc             C   s   dS )NTr7   )r6   r7   r7   r8   <lambda>      zinstall.<lambda>) __name__
__module____qualname__descriptionrc   Zboolean_optionsrQ   r   r   rd   r9   r]   rG   rH   rI   rj   rt   rR   rT   rV   rW   r\   rU   r   r   r   r   r   r   r   r   Zsub_commandsr7   r7   r7   r8   r   I   sh   	

N (		",r   )rJ   rD   Z	distutilsr   Zdistutils.corer   Zdistutils.debugr   Zdistutils.sysconfigr   Zdistutils.errorsr   Zdistutils.file_utilr   Zdistutils.utilr   r	   r
   r   r   Zsiter   r   rQ   ZWINDOWS_SCHEMErn   ro   r   r7   r7   r7   r8   <module>   sT   