mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-10 07:11:54 +00:00
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:
parent
a4240aaa36
commit
562a941d16
3 changed files with 36 additions and 13 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,13 +1,14 @@
|
||||||
/apple/target/*
|
/apple/target/*
|
||||||
|
/build
|
||||||
/install/games
|
/install/games
|
||||||
/install/installs
|
/install/installs
|
||||||
/install/q3data
|
/install/q3data
|
||||||
/install/q3map2
|
/install/q3map2
|
||||||
/install/q3map2_urt
|
/install/q3map2_urt
|
||||||
/install/radiant.bin
|
/install/radiant.bin
|
||||||
/.sconsign.dblite
|
/packs
|
||||||
/site.sconf
|
/site.sconf
|
||||||
/build
|
/.sconsign.dblite
|
||||||
*.pyc
|
*.pyc
|
||||||
*.so
|
*.so
|
||||||
.settings
|
.settings
|
||||||
|
|
|
@ -48,7 +48,6 @@ all: install bundle
|
||||||
|
|
||||||
install: -pre-install -gtk-runtime
|
install: -pre-install -gtk-runtime
|
||||||
cp -r $(INSTALL) $(RESOURCES)
|
cp -r $(INSTALL) $(RESOURCES)
|
||||||
rm -rf `find $(INSTDIR)/installs -type d -name .svn`
|
|
||||||
|
|
||||||
bundle:
|
bundle:
|
||||||
|
|
||||||
|
|
43
config.py
43
config.py
|
@ -22,6 +22,7 @@ class Config:
|
||||||
self.platform = platform.system()
|
self.platform = platform.system()
|
||||||
self.cc = 'gcc'
|
self.cc = 'gcc'
|
||||||
self.cxx = 'g++'
|
self.cxx = 'g++'
|
||||||
|
self.packs_directory = 'packs'
|
||||||
self.install_directory = 'install'
|
self.install_directory = 'install'
|
||||||
|
|
||||||
# platforms for which to assemble a setup
|
# platforms for which to assemble a setup
|
||||||
|
@ -43,6 +44,9 @@ class Config:
|
||||||
|
|
||||||
def _processCXX( self, ops ):
|
def _processCXX( self, ops ):
|
||||||
self.cxx = ops
|
self.cxx = ops
|
||||||
|
|
||||||
|
def _processPacksDir(self, ops ):
|
||||||
|
self.packs_directory = os.path.normpath( os.path.expanduser( ops[0] ) )
|
||||||
|
|
||||||
def _processInstallDir( self, ops ):
|
def _processInstallDir( self, ops ):
|
||||||
self.install_directory = os.path.normpath( os.path.expanduser( ops[0] ) )
|
self.install_directory = os.path.normpath( os.path.expanduser( ops[0] ) )
|
||||||
|
@ -58,6 +62,7 @@ class Config:
|
||||||
operators['config'] = self._processConfig
|
operators['config'] = self._processConfig
|
||||||
operators['cc'] = self._processCC
|
operators['cc'] = self._processCC
|
||||||
operators['cxx'] = self._processCXX
|
operators['cxx'] = self._processCXX
|
||||||
|
operators['packs_directory'] = self._processPacksDir
|
||||||
operators['install_directory'] = self._processInstallDir
|
operators['install_directory'] = self._processInstallDir
|
||||||
operators['setup_platforms'] = self._processSetupPlatforms
|
operators['setup_platforms'] = self._processSetupPlatforms
|
||||||
operators['setup_packs'] = self._processSetupPacks
|
operators['setup_packs'] = self._processSetupPacks
|
||||||
|
@ -251,18 +256,36 @@ class Config:
|
||||||
if ( self.platform == 'Darwin' ) :
|
if ( self.platform == 'Darwin' ) :
|
||||||
env.Append( LINKFLAGS = [ '-headerpad_max_install_names' ] )
|
env.Append( LINKFLAGS = [ '-headerpad_max_install_names' ] )
|
||||||
|
|
||||||
def CheckoutOrUpdate( self, svnurl, path ):
|
def SvnCheckoutOrUpdate( self, svn_url, working_copy ):
|
||||||
if ( os.path.exists( path ) ):
|
if ( os.path.exists( working_copy ) ):
|
||||||
cmd = [ 'svn', 'update', path ]
|
cmd = [ 'svn', 'update', working_copy ]
|
||||||
else:
|
else:
|
||||||
cmd = [ 'svn', 'checkout', svnurl, path ]
|
cmd = [ 'svn', 'checkout', svn_url, working_copy ]
|
||||||
print( repr( cmd ) )
|
print( repr( cmd ) )
|
||||||
subprocess.check_call( cmd )
|
subprocess.check_call( cmd )
|
||||||
|
|
||||||
|
def SvnExport( self, working_copy, dest ):
|
||||||
|
cmd = [ 'svn', 'export', '--force', working_copy, dest ]
|
||||||
|
print( repr( cmd ) )
|
||||||
|
|
||||||
|
subprocess.check_call( cmd )
|
||||||
|
|
||||||
def FetchGamePaks( self, path ):
|
def FetchGamePacks( self, packs_dir, install_dir ):
|
||||||
for pak in self.setup_packs:
|
if ( not os.path.exists( packs_dir ) ):
|
||||||
svnurl = 'svn://svn.icculus.org/gtkradiant-gamepacks/%s/trunk' % pak
|
os.mkdir( packs_dir )
|
||||||
self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) )
|
|
||||||
|
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):
|
def CopyTree( self, src, dst):
|
||||||
for root, dirs, files in os.walk( src ):
|
for root, dirs, files in os.walk( src ):
|
||||||
|
@ -280,8 +303,8 @@ class Config:
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
# special case, fetch external paks under the local install directory
|
# Fetch remote game packs and install them
|
||||||
self.FetchGamePaks( self.install_directory )
|
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
|
# NOTE: unrelated to self.setup_platforms - grab support files and binaries and install them
|
||||||
if ( self.platform == 'Windows' ):
|
if ( self.platform == 'Windows' ):
|
||||||
backup_cwd = os.getcwd()
|
backup_cwd = os.getcwd()
|
||||||
|
|
Loading…
Reference in a new issue