make_tarball.py
36 lines
| 797 B
| text/x-python
|
PythonLexer
/ tools / make_tarball.py
Fernando Perez
|
r1206 | #!/usr/bin/env python | ||
"""Simple script to create a tarball with proper bzr version info. | ||||
""" | ||||
ville
|
r988 | |||
Fernando Perez
|
r1206 | import os,sys,shutil | ||
Ville M. Vainio
|
r1197 | |||
Fernando Perez
|
r1527 | basever = '0.9.0' | ||
ville
|
r988 | |||
def oscmd(c): | ||||
print ">",c | ||||
s = os.system(c) | ||||
if s: | ||||
print "Error",s | ||||
sys.exit(s) | ||||
Ville M. Vainio
|
r1068 | def verinfo(): | ||
out = os.popen('bzr version-info') | ||||
pairs = (l.split(':',1) for l in out) | ||||
d = dict(((k,v.strip()) for (k,v) in pairs)) | ||||
return d | ||||
basename = 'ipython' | ||||
#tarname = '%s.r%s.tgz' % (basename, ver) | ||||
Ville M. Vainio
|
r1197 | oscmd('python update_revnum.py') | ||
Ville M. Vainio
|
r1068 | |||
ver = verinfo() | ||||
ville
|
r988 | |||
Ville M. Vainio
|
r1068 | if ver['branch-nick'] == 'ipython': | ||
tarname = 'ipython-%s.bzr.r%s.tgz' % (basever, ver['revno']) | ||||
else: | ||||
Fernando Perez
|
r1527 | tarname = 'ipython-%s.bzr.r%s.%s.tgz' % (basever, ver['revno'], | ||
ver['branch-nick']) | ||||
Ville M. Vainio
|
r1068 | |||
oscmd('bzr export ' + tarname) | ||||