12 def release_version(s):
17 return '0.%02d' % int(p[1])
19 def new_pre_version(s):
22 return '0.%02dpre' % (int(p[1]) + 1)
24 def rewrite_wscript(version_maker):
25 f = open('wscript', 'rw')
26 o = open('wscript.tmp', 'w')
33 if len(s) == 3 and s[0] == "VERSION":
34 v = version_maker(s[2])
35 print "REWRITE %s -> %s" % (s[2], v)
36 print >>o,"VERSION = '%s'" % v
42 os.rename('wscript.tmp', 'wscript')
45 def append_to_changelog(version):
46 f = open('ChangeLog', 'r')
50 f = open('ChangeLog', 'w')
51 now = datetime.datetime.now()
52 f.write('%d-%02d-%02d Carl Hetherington <cth@carlh.net>\n\n\t* Version %s released.\n\n' % (now.year, now.month, now.day, version))
55 release_version_string = rewrite_wscript(release_version)
56 append_to_changelog(release_version_string)
59 if (raw_input() != "y"):
60 command("git reset --hard")
64 command("git commit -a -m \"Bump version\"")
65 command("git tag -m \"v%s\" v%s" % (release_version_string, release_version_string))
66 command("./waf clean")
68 command("./waf configure")
70 command("./builds/windows")
71 shutil.copy(os.path.join('build', 'windows', 'DVD-o-matic %s Installer.exe' % release_version_string), '.')
73 rewrite_wscript(new_pre_version)
76 if (raw_input() != "y"):
77 command("git reset --hard")
81 command("git commit -a -m \"Bump version\"")