Release script tweaks.
authorCarl Hetherington <cth@carlh.net>
Wed, 5 Dec 2012 20:20:48 +0000 (20:20 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 5 Dec 2012 20:20:48 +0000 (20:20 +0000)
release
version-test.py
version.py

diff --git a/release b/release
index 4dae50d14bbcfea618326c87d3aea5292f57adee..ff85cf5cfef103ae5f4a4cc5570bf5e6f83c2fdd 100755 (executable)
--- a/release
+++ b/release
@@ -30,7 +30,7 @@ def check_diff_with_user():
         print 'Aborted'
         sys.exit(1)
 
-if os.popen('git status -s').read() != '':
+if not args.debug and os.popen('git status -s').read() != '':
     print '%s: uncommitted changes exist.' % sys.argv[0]
     sys.exit(1)
 
@@ -55,13 +55,9 @@ check_diff_with_user()
 command("git commit -a -m \"Bump version\"")
 command("git tag -m \"v%s\" v%s" % (new_version, new_version))
 
-m = version.Version.bump_and_to_pre
-if args.beta:
-    m = version.Version.to_pre
-version.rewrite_wscript(m)
-
-check_diff_with_user()
-
-command("git commit -a -m \"Bump version\"")
+if args.release:
+    version.rewrite_wscript(version.Version.bump_and_to_pre)
+    check_diff_with_user()
+    command("git commit -a -m \"Bump version\"")
 
 command("cp DVD-o-matic*.exe dvdomatic-*.tar.bz2 /home/carl/public_html/carlh.net/software/dvdomatic")
index d5352b55b9a4a34e93c4239315428453c33ef40b..47b4159fc46a6957685950358c15fe4416f9966f 100644 (file)
@@ -44,3 +44,9 @@ assert(a.minor == 53)
 assert(a.pre == False)
 assert(a.beta == None)
 assert(str(a) == "0.53")
+
+b = version.Version("1.42beta1")
+assert(b.major == 1)
+assert(b.minor == 42)
+assert(b.pre == False)
+assert(b.beta == 1)
index 89be9239856551af86022164d588952515542980..5b16352e1209fca4753bcab752285094133e9887 100644 (file)
@@ -23,6 +23,7 @@ class Version:
         b = s.find("beta")
         if b != -1:
             self.beta = int(s[b+4:])
+            s = s[0:b]
 
         p = s.split('.')
         self.major = int(p[0])