mò Ó”’Ac@sždZdZdkZdkZdkZdklZdklZdk l Z dk l Z dk lZdklZeid ƒZd e 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 $N(sST_MODE(s sysconfig(sCommand(snewer(s convert_path(slogs^#!.*python[0-9.]*([ ].*)?$t build_scriptscBsStZdZdddgZdgZd „Zd „Zd „Zd„Zd„Z RS(Ns("build" scripts (copy and fixup #! line)s build-dir=tdsdirectory to "build" (copy) totforcetfs1forcibly build everything (ignore file timestampss executable=tes*specify final destination interpreter pathcCs1d|_d|_d|_d|_d|_dS(N(tNonetselft build_dirtscriptsRt executabletoutfiles(R((tE/mirror/zmath/src/Python-2.4.4/Lib/distutils/command/build_scripts.pytinitialize_options!s     cCs)|iddddƒ|ii|_dS( NtbuildRRRR (s build_scriptss build_dir(sforcesforce(s executables executable(Rtset_undefined_optionst distributionR(R((R tfinalize_options(s  cCs|iS(N(RR(R((R tget_source_files/scCs |ipdSn|iƒdS(N(RRt copy_scripts(R((R trun2s c CsÒ|i|iƒg} x|iD] }d} t|ƒ}ti i |iti i |ƒƒ}| i |ƒ|i o(t||ƒ otid|ƒ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ƒ}t i!p|i"d |i#|fƒn=|i"d ti i t i$d ƒd t i$d ƒƒ|fƒ|i%| i&ƒƒ|i'ƒn| o| i'ƒq+q | i'ƒ|i(||ƒq Wti)d joxŒ| 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(0RtmkpathRR Rtscripttadjustt convert_pathtostpathtjointbasenametoutfiletappendRtnewertlogtdebugtopenRtIOErrortdry_runRtreadlinet first_linetwarnt first_line_retmatchtgroupt post_interptinfotoutft sysconfigt python_buildtwriteR tget_config_vart writelinest readlinestcloset copy_filetnametfiletstattST_MODEtoldmodetnewmodetchmod( RR=R,RR3R/R1R#RARR@RR ((R R8sh  $             (s build-dir=Rsdirectory to "build" (copy) to(sforceRs1forcibly build everything (ignore file timestamps(s executable=Rs*specify final destination interpreter path( t__name__t __module__t descriptiont user_optionstboolean_optionsR RRRR(((R Rs     (t__doc__t __revision__tsysRtreR>R?t distutilsR4tdistutils.coretCommandtdistutils.dep_utilR%tdistutils.utilRR&tcompileR.R( R4RIR&RR.RR?RJRKRNR%R((R t?s