spawn-fcgi2/waf

132 lines
105 KiB
Plaintext
Raw Normal View History

2008-07-20 19:33:42 +00:00
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2008
"""
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"""
import os, sys
if sys.hexversion<0x203000f: raise "Waf requires Python >= 2.3"
if 'PSYCOWAF' in os.environ:
try:import psyco;psyco.full()
except:pass
VERSION="1.4.9"
REVISION="da0f5dc44e8acc057f1759a564f01324"
INSTALL=sys.platform=='win32' and 'c:/temp' or '/usr/local'
C1='#/'
C2='#$'
cwd = os.getcwd()
join = os.path.join
def err(m):
print '\033[91mError: %s\033[0m' % m
sys.exit(1)
def unpack_wafdir(dir):
f = open(sys.argv[0],'rb')
c = "corrupted waf (%d)"
while 1:
line = f.readline()
if not line: err("run waf-light from a folder containing wafadmin")
if line == '#==>\n':
txt = f.readline()
if not txt: err(c % 1)
if f.readline()!='#<==\n': err(c % 2)
break
if not txt: err(c % 3)
txt = txt[1:-1].replace(C1, '\n').replace(C2, '\r')
import shutil, tarfile
try: shutil.rmtree(dir)
except OSError: pass
try: os.makedirs(join(dir, 'wafadmin', 'Tools'))
except OSError: err("Cannot unpack waf lib into %s\nMove waf into a writeable directory" % dir)
os.chdir(dir)
tmp = 't.tbz2'
t = open(tmp,'wb')
t.write(txt)
t.close()
t = tarfile.open(tmp)
for x in t: t.extract(x)
t.close()
os.chmod(join('wafadmin','Tools'), 0755)
os.unlink(tmp)
os.chdir(cwd)
def test(dir):
try: os.stat(join(dir, 'wafadmin')); return os.path.abspath(dir)
except OSError: pass
def find_lib():
name = sys.argv[0]
base = os.path.dirname(os.path.abspath(name))
#devs use $WAFDIR
w=test(os.environ.get('WAFDIR', ''))
if w: return w
#waf-light
if name.endswith('waf-light'):
w = test(base)
if w: return w
err("waf-light requires wafadmin -> export WAFDIR=/folder")
dir = "/lib/waf-%s-%s/" % (VERSION, REVISION)
for i in [INSTALL,'/usr','/usr/local','/opt']:
w = test(i+dir)
if w: return w
#waf-local
s = '.waf-%s-%s'
if sys.platform == 'win32': s = s[1:]
dir = join(base, s % (VERSION, REVISION))
w = test(dir)
if w: return w
#unpack
unpack_wafdir(dir)
return dir
wafdir = find_lib()
w = join(wafdir, 'wafadmin')
t = join(w, 'Tools')
sys.path = [w, t] + sys.path
import Scripting
Scripting.prepare(t, cwd, VERSION, wafdir)
#==>
#BZh91AY&SYض<59><D8B6>@<40><EFBFBD><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>P<><50> <0C><00>(PHb-><3E><><EFBFBD>t<EFBFBD> <02><02><><EFBFBD>1<EFBFBD><31><EFBFBD><EFBB95>]<5D><><EFBFBD><7A><CFBE>\<5C><>v<EFBFBD><76>gw9<><39>2U"<22>=<3D><><EFBFBD>վ<EFBFBD><D5BE><EFBFBD><1E>ۭw#$v<>׶<EFBFBD>'<27> Lݬ<><DDAC>+T<><54><EFBFBD><EFBFBD><EFBFBD>\<5C><>7<EFBFBD>><3E>{5<>3olG<}<7D><>H<EFBFBD>5<EFBFBD>KV-/x<>w)<29><><EFBFBD>׼<EFBFBD><18>Ul<55><6C>*)<14>4,<2C><>v<EFBFBD>{<7B>^<5E>|w<><77><EFBFBD>Z<EFBFBD>%(<16>Oc\ڠ<><DAA0><EFBFBD>ֆ(<16>I<15>d;d<><64>(<28>4<02><><EFBFBD>bJ<62><4A>p#/;<3B>{<7B>,<2C><>ڨ9냤<39><EB83A4><EFBFBD><0E><0E>t<EFBFBD>ڰ<EFBFBD><DAB0><EFBFBD>#$.<2E>vkk (J!̤<><CCA4><EFBFBD>x#/<07>a<EFBFBD><61><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]<5D>[<5B><>|bj<62>y<><79>l|<1E><><17><>\z@<1D><><EFBFBD><EFBFBD>qUڎ#$<24><>W<EFBFBD><57>R}<7D>m<EFBFBD><6D><EFBFBD><17>A<EFBFBD><41>m<><6D>m<EFBFBD><6D><EFBFBD><EFBFBD>#$@hГF<D093>#/<2F>PU*<2A> EP<02>Ѡ)ٛ<04>у<EFBFBD><D183>><3E>>^<5E><><EFBFBD><EFBFBD><EFBFBD>_.<2E>.<2E>^<5E>J<EFBFBD>#$R<>><3E><EFBFBD>}<7D>8<EFBFBD><38>P<EFBFBD><50>o<EFBFBD>6z<36><7A>3'i<><69><EFBFBD><EFBFBD><EFBFBD>n<EFBFBD><6E><EFBFBD>ھ_v<5F>g<EFBFBD><67>}y<><79><EFBFBD>A<EFBFBD><41><EFBFBD><EFBFBD>{<7B><><EFBFBD>o<><6F>/<2F>#E{j<>H"<22>[4u|<7C><><EFBFBD>((2;㷶<>̻:<3A>}<7D><><EFBFBD>><3E>]u<><75>.<2E><><EFBFBD><EFBFBD><0E>Z<EFBFBD><5A><EFBFBD><EFBFBD><EFBFBD><1E><><EFBFBD><EFBFBD>vnw<6E>s;<3B><>D<EFBFBD>}<7D>雾o<E99BBE>g޵ws<77><73><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Us<55><73><EFBFBD><75><CFA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۥ<EFBFBD>b<EFBFBD>n;<3B><><EFBFBD><EFBFBD><EF9DAF>7<EFBFBD>@<40>˃<EFBFBD><CB83><EFBFBD>Y<EFBFBD><59>-<2D><>w7<77><37>]<5D>wk<77>ܶܳ<DCB6><DCB3><EFBFBD><78>\<5C><>\s<>w<EFBFBD><77>[<5B><>{<7B><><EFBFBD>l<EFBFBD>Cl<43>x<EFBFBD><78>h<EFBFBD>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/}<7D>2<EFBFBD>i<><69>S<EFBFBD><53><EFBFBD><EFBFBD><EFBFBD>6V۷<56><DBB7>h<EFBFBD><68><EFBFBD><EFBFBD><EFBFBD>M;wT<77><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>n<EFBFBD><6E>#$<24><<3C><>0<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD>]<5D>p<EFBFBD>u<EFBFBD>@<40><32><D586>=<3D>C<EFBFBD><43><15>҃{o<><6F><EFBFBD><EFBFBD><><DDA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>|<7C>v<EFBFBD>><3E><>b#$1<>D<EFBFBD><02><07><>#/<2F><08>Q:ݸ<><DDB8>lF<6C><46>|<7C><><EFBFBD><1C>3<EFBFBD>ל<1D><>z}<7D><><EFBFBD>U<EFBFBD><55><EFBFBD>#/<1B><><EFBFBD><EFBFBD>Ev<45><17>z<13>ͻZ<CDBB><5A><EFBFBD><EFBFBD><EFBFBD><EFBFBD>><3E><6E><D28E><EFBFBD><11>^<5E><>]<5D><><EFBFBD>[:{<7B><>s<EFBFBD><06><><EFBFBD>Twn<77>[<5B><>j><3E>q<EFBFBD><71>U<><55>z<EFBFBD>j<EFBFBD><6A><EFBFBD><EFBFBD><02><><EFBFBD>=jy<6A>+<2B><03>8<EFBFBD>i<EFBFBD><02>-7f<37>+n\<5C><>ݙ<EFBFBD><DD99>m}<7D>><3E><><EFBFBD>o<EFBFBD>mݺw5<77><35>6i<36>AStu<74><75><EFBFBD>t<"m;<3B>9ʩ;<3B>sɻw[ٗ<>{<7B><>{<7B><><EFBFBD>j<EFBFBD><0E><>n<EFBFBD><6E>!<03><08><>w<EFBFBD><77>o<EFBFBD><30>s<EFBFBD><73>!<21>(t <20><><EFBFBD><EFBFBD>]<5D><>{<7B><06>r<EFBFBD><72>=<3D><7A><D7A8>K<><4B>Z*t<><74><01>ۛlflŧn_}<7D>G<EFBFBD><47><EFBFBD><EFBFBD>6E<36><45><EFBFBD>Nn<4E>W\<5C>s;p<>-<2D>|<7C>+<2B>8<14>-<2D><>J<EFBFBD>9<EFBFBD><39><EFBFBD>۸<EFBFBD><DBB8>nwn<77>s<EFBFBD><73>`<60>n1l<31><>#/C[g<>o<><6F><EFBFBD><EFBFBD><EFBFBD><EFBFBD>h<><68>׶<EFBFBD>o<EFBFBD><6F>/N<>=<3D>{<7B><><EFBFBD><EFBFBD><EFBFBD><1C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2<EFBFBD><32>0<EFBFBD><30><EFBFBD>p<EFBFBD><70><EFBFBD> <0B><><EFBFBD>{fg<66><67><EFBFBD><EFBFBD>xSU<53>vEUE<55>]#$ilȧ<6C>H<EFBFBD>٭<1B><><EFBFBD>e<EFBFBD><65><EFBFBD>9<EFBFBD><39>8y<><79>ם<EFBFBD><00><><EFBFBD>oE<<3C><><EFBFBD><EFBFBD>^<5E>{ޫ8<DEAB>g<EFBFBD><67><9<><39><EFBFBD>y<><79>p<EFBFBD>höt@<40><><EFBFBD><EFBFBD>f<EFBFBD><66><EFBFBD>]v<><76><EFBFBD>-/=<3D>N<EFBFBD><4E><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>E<EFBFBD><17>u<EFBFBD>^<5E><>h@ <04>4<>"zL<7A><4C>&<26>4<EFBFBD>4d <0C><>S<><04><> <20>B2$aOL<4F>#$5=I<>(i<><<3C><>{Q<06>i<EFBFBD>=F@<04>HMѠ<><D1A0><EFBFBD><EFBFBD><EFBFBD>=O§<4F>y <09>O<EFBFBD><4F>)<29>H6<><06><>@<01>B<>@@<40>h4<68><34><<3C>=*<2A>ڙ<EFBFBD><DA99><EFBFBD><EFBFBD>S<EFBFBD>j<EFBFBD><6A><EFBFBD><EFBFBD><EFBFBD>SQ<53><06> <20>z<EFBFBD><7A><06>@)(<11>4Кi<D09A>a0&<26>T<EFBFBD>Jz#$5Fy)<29><>A=Lԏ<4C>M<18><>H0<08><>I<EFBFBD><49>@ MhhF&<26><>54<35>%?#OPS<50>Dy&<26>jb49_<39><5F>+<2B>+S?<3F><>H<EFBFBD>IC<49>_|<15><08><><EFBFBD><EFBFBD><EFBFBD>U@<14>@V+<18>@"<07><><EFBFBD>U<EFBFBD>7<EFBFBD>?<3F><>>ϳ3<CFB3><33>n(<28>J<>#/^#/<2F>wUo$<24>N0b<30><62>s@<40>s<EFBFBD><73>3<EFBFBD><33>PVOW<><57>+<2B><><EFBFBD><EFBFBD><EFBFBD>g<EFBFBD><67><EFBFBD>Z<EFBFBD>ǔ<EFBFBD><C794>c a$LA/ɎZ.<2E><><12><><EFBFBD>U8<>ŗ<EFBFBD>Jx<4A><78><EFBFBD><EFBFBD>N<EFBFBD>AZ<41>/<2F><><EFBFBD><EFBFBD>(<28>T<><08>"s<17>C$+!bh)<00>h<12>P!<21>RK<>dHR<48>+vX<76><1B>?f`B<>#X <20><>?<3F><06>S[ \#/D<0F>G@+<2B><>3<EFBFBD><10>L!hx<68>4<EFBFBD>T+E4<45>%#<23>Ū<EFBFBD>M<EFBFBD>T<>Ң*=T]<5D>#/<2F><12><><08>D<EFBFBD>#/<1D> % h<><68>?˥WP"DL<44><03>2&)(r<0F>f:<3A><>J)hH<68>)"B<>&"H<><48>f<EFBFBD><66><EFBFBD><EFBFBD>"b<> <20>V<EFBFBD>(Zh(<28>%<25><><EFBFBD>#/<02>)`<60><><EFBFBD><EFBFBD>j#/"<22><>#/j<>%<25>J(i<>& YBh<42><68>!<21><>!<21>` <20><>12A<12>ELQEQ<04>51$<14>1<14>E%L<>C1MUPL<>+ LE<10>I1QQDHED<12>#$Q454<35>KTUA# <10>Q<14>4@<40><>*B<>QUCI <0C>P51-@I$@DE$IRQ<10>L1$<24>P<EFBFBD>D<04>4<EFBFBD>E#$UDURKDHD<48><44>T<14>1Q@<40>4<EFBFBD>4RP<52>M4<4D><34>5ER<45><52>TPU,E<14>L3)1,$<24><>Q31TP<54>4DA1$<24>T<04>HSA<12><>UR<><52><EFBFBD>AAUU0D<30><44>MRK<04>Q <0C> <0C>T<>M2A#$%IU-<04>4<14>T$<24>L2<4C>H<EFBFBD>,QHQM4TUEQ4<51><34>QHR<48>#RPP!@D<14>1T<31>4<><34><EFBFBD><EFBFBD>D<14>U4<55>L<EFBFBD>!@DB@EL<>)D<10>Q1K2DRR1L<31>CD<10>TA<12>QT<>MCUL5L%IT<49>%$TEC$D<14>4AJ<41>,AMREDUD<55>15LLą<14>IC0<43>S41%4E<04><04>QEUDQI2<14> DQ<14>TQ5IAM0IE<04>3D<>TE@T<>$L<><10><14>U1#$4<>4ĩ@D<>4DHD,IDLCQ4D0<44><30>Ą<EFBFBD>L<EFBFBD>245PD<50>@D<>PTE$<24><>R<EFBFBD>4<EFBFBD> I<04><>R5Q@D<14><12>A5ЍAKJ%DED<45>RD<52>%PP<50>B4#$%3<><1C><><EFBFBD>j<EFBFBD><6A>"X<><58> <20><><12><>jJ#/<02><><EFBFBD> <20><><18>*<2A><>Z <09><>i#/<2F><><EFBFBD>H)`h"<22>b<EFBFBD><62>&" <20> <09>b<EFBFBD><62>*!<21>j<EFBFBD><6A> <09><>*("<08>(<28>%<11><><EFBFBD>&<26><><EFBFBD>J*(<28><><EFBFBD><EFBFBD>"<22><><EFBFBD><EFBFBD>&<26>T"<22>)<29><><EFBFBD>i<EFBFBD><69><EFBFBD><EFBFBD>!(<28>*<2A>B )(<28>h<EFBFBD>f<EFBFBD><66>`<60><><EFBFBD>n<14><> <0C> $<24><><EFBFBD>*d<>)<29>"c0ɂ <20><>f<19> <09><><08>#/Ji#/<12>"<22>**BI<42>Hfh^Lp<4C>*<2A><><EFBFBD><18>%<25><>*<2A><>"<22>J<12><>H"$"b<>$<24><>JJ<4A><4A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><18><02>&J<02>%<25><> <20>"Hj* <20>H"H#/<18> (<28><>#/)<08><><EFBFBD>h<EFBFBD><68>&<12><><EFBFBD> <20><>jj!<21>b"<22><><EFBFBD><EFBFBD>#/<2F><>/<2F>q<EFBFBD><71><EFBFBD><EFBFBD><EFBFBD><EFBFBD><02>d<EFBFBD> <12><><EFBFBD><EFBFBD>B$#/<2F><><13><><1F>MlfJ%%e<>?<3F>š<EFBFBD><C29A>j<EFBFBD>!<21>!<21> i<><69><EFBFBD><EFBFBD>V<18>#/!<21>"`<60><><08><>&`"B<><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>i<EFBFBD>#/ <09><><EFBFBD><EFBFBD>dd<64><64><EFBFBD>D<EFBFBD>(<28>RbX"<22><>bP<62><08>*<12><12><><EFBFBD>JV<4A>II1<49><12><><EFBFBD>#/<2F>H*<2A><><EFBFBD><EFBFBD><08><>#/<2F>aH<61><48>%Q<>Z(R<>i&V<><56><EFBFBD>)<10><06><>IJ<49>"A<>X<EFBFBD><58><EFBFBD>"<22>"<22><>#/#/j<><6A>((<28>!<21>%<25> <20>i<EFBFBD>"<22>%U<> f* <20><>B<EFBFBD>!<21><><EFBFBD>BbIabB<62><42>!\<5C><><EFBFBD><EFBFBD><EFBFBD>*H<>ihH<68><48><10>ZZ) <09>!<21>#/jb<6A>J <09><><EFBFBD><EFBFBD><EFBFBD>Hf<48><66>!*<2A><><EFBFBD>j<><6A><EFBFBD><EFBFBD><EFBFBD><EFBFBD>J(<28>)h)<29><>#/i<><69>H(<28><><EFBFBD><EFBFBD> <20><>j<EFBFBD><6A>hfbii<69><69>"<22><00>("R"<22><>((<28><><EFBFBD><EFBFBD>"!<21><>#/u8<75>D<EFBFBD>@MQQ <04>L<EFBFBD><4C><10><>DITP<54>MQP<51>RB<>D<EFBFBD>RD4P<34><50>44$IRJQL@<40> 1Q+R<>PА<50><D090> <0C> P<><50><EFBFBD>ID<49>EMC#$5SQERвT,<2C>B<EFBFBD> Q#/ KLL ĥKEPEESR+M<04>DL<44>2<>C"D3B<><42>@<40> D)AB<41>4PT<10>#$4<>T<EFBFBD>TSPRTD<54>%P<>DT<>T<14>E4-)ED<10>$<24>K<34>SDL<> EC AP<41>%4B<>PJQJ<51>L$<24>C3M,R%Rj<1C> #/<02>(<28><>j<EFBFBD>(<28>i"Y<><12> <20>#/)F<><46><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(h<><68>(<28>"B<><42> <20>)<29>b<EFBFBD><62><EFBFBD>h<EFBFBD><68>(<28>ih<69><68>abBi!"<22>" <20><>)&<26>d<EFBFBD><64>(uea`D<>PULCM!T<> CE#$4<>4-fbDD҄HR<48> f9K14#$C#$#/EATD<54>,<2C>RTL<54>QSSED<45> CD<43><44><EFBFBD>4<EFBFBD>D#/UA5J<35>R<EFBFBD>PCD<><1C>f<EFBFBD>Q<><51><01><>B<EFBFBD>!<21>i<><18><><EFBFBD>QiV I<><49>#/ <20><>) <20><>)<16><>JE"D`<60>#/jZ<6A><5A><EFBFBD><EFBFBD> "<02><><EFBFBD>d<EFBFBD><64><EFBFBD><EFBFBD><EFBFBD>&("<22>&(<28><>#/<2F><>a<EFBFBD>Y$<24> <20>(fjh)<29><04>&#/J`<60><>bY <20>bU-R0DE4Ҩ@$3ISBDP<44><50>%*EL2L<32><4C>ޖ<EFBFBD>B"e<08><>ZU<>(%R !<18><08><><01><><EFBFBD><EFBFBD>#/H"<22>""$"#/<2F>#/<2F>h<EFBFBD>Q<EFBFBD><51>%<25><0F><><EFBFBD>*<2A>#/&<26><><EFBFBD>R(<28><>ѿ<EFBFBD><D1BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)<29><><EFBFBD>a?<3F>}w<>?<3F>3rϚQ<CF9A>S<EFBFBD>u<17>N<EFBFBD><4E>%<25><><EFBFBD>f<EFBFBD>k#$<1F>x7<78><37>w<EFBFBD><77>B=F7sG<>f.<2E>g<EFBFBD><67><EFBFBD><EFBFBD><EFBFBD><}&4<>;yG<79><07><0F><>}^f<><07>ʗ<EFBFBD><CA97><EFBFBD><EFBFBD><EFBFBD><04>L2nU!<21>gc<67>%j.|̙<>(ǵAh<41><EFBFBD><7F>Pq<50><10><>,<2C>q<EFBFBD>&A#Ӽo<D3BC>D+N> <20>K<EFBFBD><4B>Nf+<2B><><EFBFBD>)C`<60><><1D><><03>N<1F>#/<2F>JJ<4A>@<40>%3?eB՜<13>mu<6D><75><EFBFBD><EFBFBD>E!ŗ<><C597>"<22>9ig <09><15>)<1E><><00>r&<26><>T<EFBFBD>I<EFBFBD>,vj*xQ<78><51>Ҡ<EFBFBD>՘[<5B>
#<==