4 import shutil, os, stat
6 media =
'../../../../../media-sdk'
7 media = os.path.abspath( media )
10 shutil.rmtree(
'Doom3_SDK' )
12 print 'Could not remove Doom3_SDK'
16 f = open(
'source.list' )
17 l = [ s[:-1]
for s
in f.readlines() ]
20 sp = os.path.join(
'../../..', p )
21 dp = os.path.join(
'Doom3_SDK/src', p )
23 os.makedirs( os.path.dirname( dp ) )
26 print 'cp ' + sp +
' -> ' + dp
30 for root, dirs, files
in os.walk( media ):
34 sp = os.path.join( root, f )
35 dp = os.path.join(
'Doom3_SDK', sp[ len( media ) + 1: ] )
37 os.makedirs( os.path.dirname( dp ) )
40 print 'cp ' + sp +
' -> ' + dp
44 for root, dirs, files
in os.walk( path ):
46 os.chmod( os.path.join( root, f ), stat.S_IWRITE )
49 for root, dirs, files
in os.walk(
'Doom3_SDK' ):
51 print 'remove ' + os.path.join( root,
'.svn' )
54 shutil.rmtree( os.path.join( root,
'.svn' ) )