summaryrefslogtreecommitdiff
path: root/scripts/build-version.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build-version.py')
-rw-r--r--scripts/build-version.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/build-version.py b/scripts/build-version.py
index 8db647c888..8261aea536 100644
--- a/scripts/build-version.py
+++ b/scripts/build-version.py
@@ -5,13 +5,16 @@ import sys, os, errno
output_dir = sys.argv[1]
-# When they're identical, the git describe can't find a tag and reports the rev instead.
-if sys.argv[2] == sys.argv[3]:
+if len(sys.argv) <= 3:
tag = [0, 0, 0]
+ rev = sys.argv[2][0:8]
else:
- tag = map(int, sys.argv[2].split('.'))
-
-rev = sys.argv[3][0:8]
+ # When they're identical, the git describe can't find a tag and reports the rev instead.
+ if sys.argv[2] == sys.argv[3]:
+ tag = [0, 0, 0]
+ else:
+ tag = map(int, sys.argv[2].split('.'))
+ rev = sys.argv[3][0:8]
def mkdir_p(path):