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