2007-12-15 14:40:39 +00:00
|
|
|
import os, shutil, zipfile, sys
|
2007-12-12 21:53:06 +00:00
|
|
|
|
2008-03-22 19:19:56 +00:00
|
|
|
if len(sys.argv) <= 1:
|
|
|
|
print "%s VERSION [SVN TREE]" % sys.argv[0]
|
|
|
|
sys.exit(-1)
|
|
|
|
|
2007-12-15 14:40:39 +00:00
|
|
|
version = sys.argv[1]
|
|
|
|
svn_tree = "tags/release-%s" % version
|
2007-12-12 21:53:06 +00:00
|
|
|
|
2007-12-15 14:48:12 +00:00
|
|
|
if len(sys.argv) > 2:
|
|
|
|
svn_tree = sys.argv[2]
|
|
|
|
|
2007-12-12 21:53:06 +00:00
|
|
|
# make clean
|
|
|
|
if 1:
|
|
|
|
try: shutil.rmtree("srcwork")
|
|
|
|
except: pass
|
|
|
|
try: os.mkdir("srcwork")
|
|
|
|
except: pass
|
|
|
|
|
|
|
|
root_dir = os.getcwd() + "/srcwork"
|
|
|
|
|
|
|
|
# change dir
|
|
|
|
os.chdir(root_dir)
|
|
|
|
|
|
|
|
# fix bam
|
2009-01-11 12:35:37 +00:00
|
|
|
#if 1:
|
|
|
|
# os.system("svn export http://stalverk80.se/svn/bam bam")
|
|
|
|
# z = zipfile.ZipFile("../bam.zip", "w")
|
|
|
|
# for root, dirs, files in os.walk("bam"):
|
|
|
|
# for f in files:
|
|
|
|
# z.write(root+"/"+ f)
|
|
|
|
# z.close()
|
2007-12-12 21:53:06 +00:00
|
|
|
|
|
|
|
if 1:
|
2008-03-22 18:40:27 +00:00
|
|
|
os.system("svn export svn://svn.teeworlds.com/teeworlds/%s teeworlds" % svn_tree)
|
|
|
|
os.chdir("teeworlds")
|
2007-12-12 21:53:06 +00:00
|
|
|
os.system("python scripts/make_release.py %s src" % version)
|
|
|
|
os.chdir(root_dir)
|
2008-03-22 18:40:27 +00:00
|
|
|
for f in os.listdir("teeworlds"):
|
2016-04-26 23:35:17 +00:00
|
|
|
if "teeworlds" in f and "src" in f and (".zip" in f or ".tar.xz" in f):
|
2008-03-22 18:40:27 +00:00
|
|
|
shutil.copy("teeworlds/"+f, "../" + f)
|