make_tarball.py
28 lines
| 648 B
| text/x-python
|
PythonLexer
/ tools / make_tarball.py
vivainio
|
r479 | import os,sys,shutil | ||
vivainio
|
r478 | |||
vivainio
|
r503 | repo = "http://ipython.scipy.org/svn/ipython/ipython/branches/0.7.3" | ||
vivainio
|
r478 | basename = 'ipython' | ||
workdir = './mkdist' | ||||
workdir = os.path.abspath(workdir) | ||||
vivainio
|
r479 | |||
print "working at",workdir | ||||
vivainio
|
r478 | def oscmd(c): | ||
print ">",c | ||||
vivainio
|
r479 | s = os.system(c) | ||
if s: | ||||
print "Error",s | ||||
sys.exit(s) | ||||
vivainio
|
r478 | |||
assert not os.path.isdir(workdir) | ||||
os.mkdir(workdir) | ||||
os.chdir(workdir) | ||||
vivainio
|
r482 | oscmd('svn export %s %s' % (repo,basename)) | ||
ver = os.popen('svnversion ../..').read().strip() | ||||
vivainio
|
r478 | tarname = '%s.r%s.tgz' % (basename, ver) | ||
vivainio
|
r479 | oscmd('tar czvf ../%s %s' % (tarname, basename)) | ||
print "Produced: ",os.path.abspath('../' + tarname) | ||||
vivainio
|
r482 | os.chdir('/') | ||
vivainio
|
r478 | shutil.rmtree(workdir) | ||