summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-30 10:11:43 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-30 16:34:38 (GMT)
commitd81d2608c35bef14ba1fd024b0ec4d48de03dfcc (patch)
treea733ba5174e1fca46c6396c6f3ed0d182841e4c9 /BuildTools/GetBuildVersion.py
parenta10cc927d11bf5a2ef30c07e168922b192a52561 (diff)
downloadswift-contrib-d81d2608c35bef14ba1fd024b0ec4d48de03dfcc.zip
swift-contrib-d81d2608c35bef14ba1fd024b0ec4d48de03dfcc.tar.bz2
Split off libswiften package.
Diffstat (limited to 'BuildTools/GetBuildVersion.py')
-rwxr-xr-xBuildTools/GetBuildVersion.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/BuildTools/GetBuildVersion.py b/BuildTools/GetBuildVersion.py
index a362574..007fec8 100755
--- a/BuildTools/GetBuildVersion.py
+++ b/BuildTools/GetBuildVersion.py
@@ -1,9 +1,21 @@
#!/usr/bin/env python
-import sys
+import sys, re
sys.path.append("SCons")
import Version, os.path
-assert(len(sys.argv) == 2)
+assert(len(sys.argv) >= 2)
-print Version.getBuildVersion(os.path.dirname(sys.argv[0] + "/.."), sys.argv[1])
+only_major = False
+if "--major" in sys.argv :
+ only_major = True
+
+if only_major :
+ v = Version.getBuildVersion(os.path.dirname(sys.argv[0] + "/.."), sys.argv[1])
+ version_match = re.match("(\d+)\.(\d+).*", v)
+ if version_match :
+ print version_match.group(1)
+ else :
+ print "0"
+else :
+ print Version.getBuildVersion(os.path.dirname(sys.argv[0] + "/.."), sys.argv[1])