diff options
author | 2016-02-12 15:36:17 -0800 | |
---|---|---|
committer | 2016-02-12 15:36:17 -0800 | |
commit | 10a4cc74a1b8eb96f88a14c98535991c322934d6 (patch) | |
tree | 0a2500e36a08c405bdbe909a7de5c32ca36c7851 /tools | |
parent | 02459edaaa26760810a3e31bb2419a3ff0b5026f (diff) | |
parent | 0cd9cbcf60350854d5510d4cfa5229d622882d63 (diff) |
Merge pull request #5183 from nicolasnoble/fixing-no-tag
Fixing the absence of 'tag' in the version.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/buildgen/plugins/expand_version.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/buildgen/plugins/expand_version.py b/tools/buildgen/plugins/expand_version.py index a103618c01..b55e1b15ff 100755 --- a/tools/buildgen/plugins/expand_version.py +++ b/tools/buildgen/plugins/expand_version.py @@ -51,6 +51,7 @@ LANGUAGES = [ class Version: def __init__(self, s): + self.tag = None if '-' in s: s, self.tag = s.split('-') self.major, self.minor, self.patch = [int(x) for x in s.split('.')] @@ -78,7 +79,10 @@ class Version: def ruby(self): """Version string in Ruby style""" - return '%d.%d.%d.%s' % (self.major, self.minor, self.patch, self.tag) + if self.tag: + return '%d.%d.%d.%s' % (self.major, self.minor, self.patch, self.tag) + else: + return '%d.%d.%d' % (self.major, self.minor, self.patch) def mako_plugin(dictionary): """Expand version numbers: |