From f0c620b09f79297e80d8c80fc80e6aae8dffc0e9 Mon Sep 17 00:00:00 2001 From: Timothee Besset Date: Sat, 15 Jun 2013 21:43:43 +0100 Subject: [PATCH] pull the Q2WPack in from github during setup --- config.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index 67b2584d..63e5276f 100644 --- a/config.py +++ b/config.py @@ -1,9 +1,10 @@ -import sys, traceback, platform, re, commands, platform, subprocess +import sys, os, traceback, platform, re, commands, platform, subprocess +import urllib2, zipfile, shutil, pprint if __name__ != '__main__': from SCons.Script import * -import utils, urllib2, zipfile, shutil, pprint, subprocess, re, os.path +import utils GTK_PREFIX='gtk-2.24.10' GTK64_PREFIX='gtk-2.22.1_win64' @@ -26,7 +27,7 @@ class Config: # platforms for which to assemble a setup self.setup_platforms = [ 'local', 'x86', 'x64', 'win32' ] # paks to assemble in the setup - self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack' ] + self.setup_packs = [ 'Q3Pack', 'UrTPack', 'ETPack', 'QLPack', 'Q2WPack' ] def __repr__( self ): return 'config: target=%s config=%s' % ( self.target_selected, self.config_selected ) @@ -254,12 +255,23 @@ class Config: print( repr( cmd ) ) subprocess.check_call( cmd ) - def FetchGamePaks( self, path ): for pak in self.setup_packs: + if ( pak == 'Q2WPack' ): + continue svnurl = 'svn://svn.icculus.org/gtkradiant-gamepacks/%s/trunk' % pak self.CheckoutOrUpdate( svnurl, os.path.join( path, 'installs', pak ) ) + if 'Q2WPack' in self.setup_packs: + if ( os.path.exists( 'quake2world' ) ): + subprocess.check_call( [ 'git', 'pull', ], cwd = 'quake2world' ) + else: + cmd = [ 'git', 'clone', 'git://github.com/jdolan/quake2world.git' ] + subprocess.check_call( cmd ) + # squash and sync.. + shutil.rmtree( 'install/installs/Q2WPack/' ) + shutil.copytree( 'quake2world/gtkradiant/Q2WPack/', 'install/installs/Q2WPack/' ) + def CopyTree( self, src, dst): for root, dirs, files in os.walk( src ): target_dir = os.path.join( dst, root[root.find( '/' )+1:] )