2 import zeroinstall
, sys
, os
, shutil
4 os
.system('svn status')
6 trunk_url
= 'https://svn.sourceforge.net/svnroot/zero-install/trunk/0launch'
7 releases_url
= 'https://svn.sourceforge.net/svnroot/zero-install/releases/0launch'
9 for line
in os
.popen('dpkg-parsechangelog'):
10 if line
.startswith('Version: '):
11 deb_version
= line
.split(' ', 1)[1].strip()
14 raise Exception('Failed to get deb version!')
16 print "\nDebian version: " + deb_version
+ " (hint: debchange -i)"
18 name
= 'injector-' + zeroinstall
.version
19 package_name
= 'zeroinstall-' + name
20 a
= raw_input("Release " + name
+ "? [y/N]")
21 if not a
or a
not in 'Yy':
24 if os
.system('cd tests && ./testall.py'):
25 print "ERROR: Unit test failure. Stop"
28 print "Checking for existing release..."
29 if os
.system('svn ls ' + releases_url
+ '/' + name
+ ' >/dev/null') == 0:
30 print "WARNING: releases/" + name
+ " already exists"
31 a
= raw_input("Overwrite " + name
+ "? [y/N]")
32 if not a
or a
not in 'Yy':
34 os
.system('svn rm ' + releases_url
+ '/' + name
+ ' -m overwrite')
36 if os
.system('svn cp -m "Released ' + name
+ '" ' +
37 trunk_url
+ ' ' + releases_url
+ '/' + name
):
38 print "Failed to make release"
41 if os
.path
.isdir(package_name
):
42 shutil
.rmtree(package_name
)
43 os
.system('svn export ' + releases_url
+ '/' + name
+ ' ' + package_name
)
45 os
.chdir(package_name
)
46 os
.system('python setup.py sdist')
47 os
.system('dpkg-buildpackage -rfakeroot')
49 print "Tarball is", package_name
+ '/dist/' + package_name
+ '.tar.gz'