Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/distutils/command/build_scripts.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�
��c@s�dZdZddkZddkZddkZddklZddklZddk	l
Z
ddklZddk
lZdd	klZeid
�Zde
fd��YZdS(
sRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.s9$Id: build_scripts.py 37828 2004-11-10 22:23:15Z loewis $i�N(tST_MODE(t	sysconfig(tCommand(tnewer(tconvert_path(tlogs^#!.*python[0-9.]*([ 	].*)?$t
build_scriptscBsSeZdZdddgZdgZd
�Zd�Zd�Zd
�Zd�Z	RS(s("build" scripts (copy and fixup #! line)s
build-dir=tdsdirectory to "build" (copy) totforcetfs1forcibly build everything (ignore file timestampssexecutable=tes*specify final destination interpreter pathcCs1d|_d|_d|_d|_d|_dS(N(tNonet	build_dirtscriptsRt
executabletoutfiles(tself((s2/sys/lib/python/distutils/command/build_scripts.pytinitialize_options!s
				cCs)|idddd�|ii|_dS(	NtbuildRRRR(s
build_scriptss	build_dir(sforcesforce(s
executables
executable(tset_undefined_optionstdistributionR
(R((s2/sys/lib/python/distutils/command/build_scripts.pytfinalize_options(s
	cCs|iS(N(R
(R((s2/sys/lib/python/distutils/command/build_scripts.pytget_source_files/scCs |ipdSn|i�dS(N(R
tcopy_scripts(R((s2/sys/lib/python/distutils/command/build_scripts.pytrun2s
c
Cs�|i|i�g}x|iD]}d}t|�}tii|itii|��}|i|�|i	o(t
||�otid|�q nyt
|d�}Wn*tj
o|ip�nd}ncX|i�}|p|id|�q nti|�}|o d}|id�pd}n|o�tid||i�|ip�t
|d�}	tip|	id	|i|f�n=|	id	tiitid
�dtid��|f�|	i|i��|	i�n|o|i�q+q |i�|i||�q Wti d
jo�x�|D]�}
|iotid|
�qFti!|
�t"d@}|dBd@}||jo*tid|
||�ti#|
|�qFqFWndS(s"Copy each script listed in 'self.scripts'; if it's marked as a
        Python script in the Unix way (first line matches 'first_line_re',
        ie. starts with "\#!" and contains "python"), then adjust the first
        line to refer to the current Python interpreter as we copy.
        isnot copying %s (up-to-date)trs%s is an empty file (skipping)itscopying and adjusting %s -> %stws#!%s%s
tBINDIRtpythontEXEtposixschanging mode of %si�ims!changing mode of %s from %o to %oN($tmkpathRR
RtostpathtjointbasenametappendRRRtdebugtopentIOErrortdry_runRtreadlinetwarnt
first_line_retmatchtgrouptinfoRtpython_buildtwriteRtget_config_vart
writelinest	readlinestcloset	copy_filetnametstatRtchmod(
RRtscripttadjusttoutfileR	t
first_lineR-tpost_interptoutftfiletoldmodetnewmode((s2/sys/lib/python/distutils/command/build_scripts.pyR8sp
$




			


	
(s
build-dir=Rsdirectory to "build" (copy) to(sforceR	s1forcibly build everything (ignore file timestamps(sexecutable=R
s*specify final destination interpreter path(
t__name__t
__module__tdescriptiontuser_optionstboolean_optionsRRRRR(((s2/sys/lib/python/distutils/command/build_scripts.pyRs						(t__doc__t__revision__tsysR!treR8Rt	distutilsRtdistutils.coreRtdistutils.dep_utilRtdistutils.utilRRtcompileR,R(((s2/sys/lib/python/distutils/command/build_scripts.pys<module>s$

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.