Game packs are now fetched to 'packs' and exported into 'install/installs'. This way we don't have .svn turds kicking around in 'install'.

This commit is contained in:
jdolan 2013-06-29 15:36:51 -04:00
parent a4240aaa36
commit 562a941d16
3 changed files with 36 additions and 13 deletions

5
.gitignore vendored
View File

@ -1,13 +1,14 @@
/apple/target/*
/build
/install/games
/install/installs
/install/q3data
/install/q3map2
/install/q3map2_urt
/install/radiant.bin
/.sconsign.dblite
/packs
/site.sconf
/build
/.sconsign.dblite
*.pyc
*.so
.settings

View File

@ -48,7 +48,6 @@ all: install bundle
install: -pre-install -gtk-runtime
cp -r $(INSTALL) $(RESOURCES)
rm -rf `find $(INSTDIR)/installs -type d -name .svn`
bundle:

View File

@ -22,6 +22,7 @@ class Config:
self.platform = platform.system()
self.cc = 'gcc'
self.cxx = 'g++'
self.packs_directory = 'packs'
self.install_directory = 'install'
# platforms for which to assemble a setup
@ -44,6 +45,9 @@ class Config:
def _processCXX( self, ops ):
self.cxx = ops
def _processPacksDir(self, ops ):
self.packs_directory = os.path.normpath( os.path.expanduser( ops[0] ) )
def _processInstallDir( self, ops ):
self.install_directory = os.path.normpath( os.path.expanduser( ops[0] ) )
@ -58,6 +62,7 @@ class Config:
operators['config'] = self._processConfig
operators['cc'] = self._processCC
operators['cxx'] = self._processCXX
operators['packs_directory'] = self._processPacksDir
operators['install_directory'] = self._processInstallDir
operators['setup_platforms'] = self._processSetupPlatforms
operators['setup_packs'] = self._processSetupPacks
@ -251,18 +256,36 @@ class Config:
if ( self.platform == 'Darwin' ) :
env.Append( LINKFLAGS = [ '-headerpad_max_install_names' ] )
def CheckoutOrUpdate( self, svnurl, path ):
if ( os.path.exists( path ) ):
cmd = [ 'svn', 'update', path ]
def SvnCheckoutOrUpdate( self, svn_url, working_copy ):
if ( os.path.exists( working_copy ) ):
cmd = [ 'svn', 'update', working_copy ]
else:
cmd = [ 'svn', 'checkout', svnurl, path ]
cmd = [ 'svn', 'checkout', svn_url, working_copy ]
print( repr( cmd ) )
subprocess.check_call( cmd )
def FetchGamePaks( self, path ):
for pak in self.setup_packs:
svnurl = 'svn://svn.icculus.org/gtkradiant-gamepacks/%s/trunk' % pak
self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) )
def SvnExport( self, working_copy, dest ):
cmd = [ 'svn', 'export', '--force', working_copy, dest ]
print( repr( cmd ) )
subprocess.check_call( cmd )
def FetchGamePacks( self, packs_dir, install_dir ):
if ( not os.path.exists( packs_dir ) ):
os.mkdir( packs_dir )
if ( not os.path.exists( install_dir ) ):
os.mkdir( install_dir )
for pack in self.setup_packs:
svn_url = 'svn://svn.icculus.org/gtkradiant-gamepacks/%s/trunk' % pack
working_copy = os.path.join( packs_dir, pack)
self.SvnCheckoutOrUpdate( svn_url, working_copy )
dest_dir = os.path.join( install_dir, pack)
self.SvnExport( working_copy, dest_dir )
def CopyTree( self, src, dst):
for root, dirs, files in os.walk( src ):
@ -280,8 +303,8 @@ class Config:
except:
pass
else:
# special case, fetch external paks under the local install directory
self.FetchGamePaks( self.install_directory )
# Fetch remote game packs and install them
self.FetchGamePacks( self.packs_directory, os.path.join( self.install_directory, 'installs' ) )
# NOTE: unrelated to self.setup_platforms - grab support files and binaries and install them
if ( self.platform == 'Windows' ):
backup_cwd = os.getcwd()