summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-06-13 10:23:57 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-06-13 10:25:51 (GMT)
commit7359f1a67ef1eeb8511a44019fd723102380c2cf (patch)
tree2d321de5e4f41f782d350c26cc6f61c7c59de5bb /BuildTools
parentff8c40a4e5a5c50572449d52754639b870dc5981 (diff)
downloadswift-contrib-7359f1a67ef1eeb8511a44019fd723102380c2cf.zip
swift-contrib-7359f1a67ef1eeb8511a44019fd723102380c2cf.tar.bz2
Fix Debian versioning to be strictly increasing.
Diffstat (limited to 'BuildTools')
-rwxr-xr-xBuildTools/DebianizeVersion.py12
-rwxr-xr-xBuildTools/TestVersioningScheme.sh45
-rwxr-xr-xBuildTools/UpdateDebianChangelog.py4
3 files changed, 59 insertions, 2 deletions
diff --git a/BuildTools/DebianizeVersion.py b/BuildTools/DebianizeVersion.py
new file mode 100755
index 0000000..dc5474f
--- /dev/null
+++ b/BuildTools/DebianizeVersion.py
@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+
+import sys
+
+assert(len(sys.argv) == 2)
+
+version = sys.argv[1]
+version = version.replace("beta", "~beta")
+version = version.replace("rc", "~rc")
+version = version.replace("-dev", "+dev")
+
+print version
diff --git a/BuildTools/TestVersioningScheme.sh b/BuildTools/TestVersioningScheme.sh
new file mode 100755
index 0000000..8fcc96a
--- /dev/null
+++ b/BuildTools/TestVersioningScheme.sh
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+function test_versions() {
+ versions=$@
+ previous_version=
+ for version in $versions; do
+ if [ "$previous_version" ]; then
+ debian_version=`./DebianizeVersion.py $version`
+ debian_previous_version=`./DebianizeVersion.py $previous_version`
+ dpkg --compare-versions $debian_version gt $debian_previous_version
+ result=$?
+ if [ "$result" != "0" ]; then
+ echo "TEST FAILED: $debian_version > $debian_previous_version"
+ fi
+ fi
+ previous_version=$version
+ done
+}
+
+DEVELOPMENT_VERSIONS="
+ swift-1.0beta1
+ swift-1.0beta1-dev3
+ swift-1.0beta2
+ swift-1.0rc1
+ swift-1.0
+ swift-1.0-dev2
+ swift-1.0-dev4
+ swift-2.0"
+test_versions $DEVELOPMENT_VERSIONS
+
+BETA_VERSIONS="
+ swift-1.0beta1
+ swift-1.0beta2
+ swift-1.0rc1
+ swift-1.0
+ swift-1.1rc1
+ swift-1.1
+ swift-2.0"
+test_versions $BETA_VERSIONS
+
+RELEASE_VERSIONS="
+ swift-1.0
+ swift-1.1
+ swift-2.0"
+test_versions $RELEASE_VERSIONS
diff --git a/BuildTools/UpdateDebianChangelog.py b/BuildTools/UpdateDebianChangelog.py
index 6615ab1..c4e32b7 100755
--- a/BuildTools/UpdateDebianChangelog.py
+++ b/BuildTools/UpdateDebianChangelog.py
@@ -12,7 +12,7 @@ changelog.close()
project = ""
last_version = ""
-m = re.match("(\w+) \((.*)\)", last_version_line)
+m = re.match("(\w+) \((.*)-\d+\)", last_version_line)
if m :
project = m.group(1)
last_version = m.group(2)
@@ -22,7 +22,7 @@ if last_version != version :
changelog_data = changelog.read()
changelog.close()
changelog = open(sys.argv[1], "w")
- changelog.write(project + " (" + version + ")" + " unstable; urgency=low\n\n")
+ changelog.write(project + " (" + version + "-1)" + " unstable; urgency=low\n\n")
changelog.write(" * Upstream development snapshot\n\n")
changelog.write(" -- Remko Tron\xc3\xa7on <dev@el-tramo.be> " + email.utils.formatdate() + "\n")
changelog.write("\n")