h fg@sdZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZdd lmZmZmZdd lmZdd l mZdd lmZdd lmZdZidd6dd6dd6dd6dd6Ziidd6dd6dd6dd6dd6d6idd6dd6dd6dd6dd6d 6ed!6Zerid"d6d"d6d#d6d$d6d%d6ed&d?Zd@dAZdBdCZdDdEZdFdGZdHdIZdJdKZdLdMZdNdOZdPdQZdRdSZdTdUZdVdWZdXefdYefdZefd[efd\d]d^fgZdS)oinstallz'install everything from build directoryprefix=Ninstallation prefix exec-prefix=.(Unix only) prefix for platform-specific fileshome=+(Unix only) home directory to install under install-base=;base installation directory (instead of --prefix or --home)zinstall-platbase=z8base installation directory for platform-specific files z$(instead of --exec-prefix or --home)root=/opt/alt/python34/lib64/python3.4/distutils/command/install.pyinitialize_optionss2                       zinstall.initialize_optionscCs|js|js|jr@|js-|jr@tddn|jrj|js[|jrjtdn|jr|js|js|js|js|jrtdntjdkr|jr|j dd|_qn|j dtjdkr |j n |j |j d t jjd }td d \}}y t j}Wntk rrd }YnXi |jjd6|jjd6|jjd6|d6|d dd6|d |dd6|d6|d 6|d6|d 6|d6|_tr#|j|jd<|j|jd=z %s: %sr) rZdistutils.fancy_getoptrrdebug user_options negative_opt translategetattr)rUmsgrZoptZopt_namevalrVrVrWrlss  zinstall.dump_dirscCs|jdk s|jdk r|jdkrK|jdkrK|jdksx|jdksx|jdksx|jdkrtdndS|j r|j dkrt dn|j |_|_|j dn|j dk r|j |_|_|j dn|jdkrg|jdk r4tdntjjtj|_tjjtj|_n|jdkr|j|_n|j|_|j|_|j ddS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incompletez$User base directory is not specifiedrrz*must not supply exec-prefix without prefixr)rBrCrHrErFrGrIrJr r=rKr select_schemerAr?r@rir}normpathro)rUrVrVrWrms<      zinstall.finalize_unixc Cs|jrQ|jdkr'tdn|j|_|_|jtjdn|jdk r|j|_|_|jdny|j dkrtj j t j |_ n|j |_|_y|jtjWn%t k rtdtjYnXdS)z)Finalizes options for non-posix platformsNz$User base directory is not specifiedZ_userrz)I don't know how to install stuff on '%s')r=rKrrBrCrrirjrAr?r}rroKeyError)rUrVrVrWrns"   zinstall.finalize_othercCsUt|}xDtD]<}d|}t||dkrt||||qqWdS)z=Sets the install directories by applying the install schemes.install_N)INSTALL_SCHEMES SCHEME_KEYSrsetattr)rUrjschemekeyZattrnamerVrVrWrs    zinstall.select_schemecCsx|D]y}t||}|dk rtjdksFtjdkr[tjj|}nt||j}t|||qqWdS)NrYr)rrirjr} expanduserr rtr)rUZattrsattrrrVrVrW _expand_attrss  zinstall._expand_attrscCs|jdddgdS)zNCalls `os.path.expanduser` on install_base, install_platbase and root.rBrCrDN)r)rUrVrVrWrvszinstall.expand_basedirscCs#|jddddddgdS)z+Calls `os.path.expanduser` on install dirs.rErFrHrGrIrJN)r)rUrVrVrWrxs zinstall.expand_dirscGs>x7|D]/}d|}t||tt||qWdS)z!Call `convert_path` over `names`.rN)rrr)rUnamesrjrrVrVrWrzs  zinstall.convert_pathscCs|jdkr!|jj|_n|jdk rt|jtrZ|jjd|_nt|jdkr|jd}}n3t|jdkr|j\}}n tdt|}n d}d}||_||_ dS)z4Set `path_file` and `extra_dirs` using `extra_path`.N,r>rr^zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsrZ) rNrs isinstancestrrqlenr r path_filer)rUrrrVrVrWr{s   zinstall.handle_extra_pathc GsDx=|D]5}d|}t||t|jt||qWdS)z:Change the install directories pointed by name using root.rN)rr rDr)rUrrjrrVrVrWrs  zinstall.change_rootscCs|js dSttjjd}xc|jjD]R\}}|j|r5tjj| r5|j d|tj |dq5q5WdS)zCreate directories under ~.N~zos.makedirs('%s', 0o700)i) r=rrir}rrtitems startswithisdirZ debug_printmakedirs)rUrArjr}rVrVrWry s "zinstall.create_home_pathcCs|jsU|jd|jjdj}|jrU|tkrUtdqUnx!|jD]}|j|qbW|j r|j n|j r|j }|j rt|j }x5tt|D]}|||d||szinstall.)rNr)rNr)rNr)r Nr!)r"Nr#)r$Nr%)r&Nr')r(Nr))r*Nr+)r,Nr-)zcompiler/r0)r1Nr2)r3r4r5)zforcer7r8)r9Nr:)r;Nr<) __name__ __module__ __qualname__Z descriptionrZboolean_optionsrurrrrXrrlrmrnrrrvrxrzr{rryrrrrrrrrZ sub_commandsrVrVrVrWrIs     M  (       ,          r)zpurelibzplatlibzheaderszscriptszdata)__doc__roriZ distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr r r r Zsiter rruZWINDOWS_SCHEMErrrrVrVrVrWsb