2 import zeroinstall
, sys
, os
, shutil
4 os
.system('svn status')
6 name
= 'injector-' + zeroinstall
.version
7 a
= raw_input("Release " + name
+ "? [y/N]")
8 if not a
or a
not in 'Yy':
11 if os
.system('cd tests && ./testall.py'):
12 print "ERROR: Unit test failure. Stop"
15 if os
.system('svn ls file:///home/svn/releases/' + name
+ ' >/dev/null') == 0:
16 print "WARNING: releases/" + name
+ " already exists"
17 a
= raw_input("Overwrite " + name
+ "? [y/N]")
18 if not a
or a
not in 'Yy':
20 os
.system('svn rm file:///home/svn/releases/' + name
+ ' -m overwrite')
22 if os
.system('svn cp -m "Released ' + name
+ '" ' +
23 'file:///home/svn/injector/injector '
24 'file:///home/svn/releases/' + name
):
25 print "Failed to make release"
28 if os
.path
.isdir(name
):
30 os
.system('svn export file:///home/svn/releases/' + name
+ ' ' + name
)
33 os
.system('python setup.py sdist')
34 os
.system('dpkg-buildpackage -rfakeroot')