File: make_src.py

package info (click to toggle)
teeworlds 0.7.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 16,068 kB
  • sloc: cpp: 58,010; ansic: 14,468; python: 3,763; asm: 946; objc: 107; makefile: 36; xml: 21; sh: 7
file content (41 lines) | stat: -rwxr-xr-x 963 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os, shutil, zipfile, sys

if len(sys.argv) <= 1:
	print "%s VERSION [SVN TREE]" % sys.argv[0]
	sys.exit(-1)

version = sys.argv[1]
svn_tree = "tags/release-%s" % version

if len(sys.argv) > 2:
	svn_tree = sys.argv[2]

# 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
#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()

if 1:
	os.system("svn export svn://svn.teeworlds.com/teeworlds/%s teeworlds" % svn_tree)
	os.chdir("teeworlds")
	os.system("python3 scripts/make_release.py %s src" % version)
	os.chdir(root_dir)
	for f in os.listdir("teeworlds"):
		if "teeworlds" in f and "src" in f and (".zip" in f or ".tar.gz" in f):
			shutil.copy("teeworlds/"+f, "../" + f)