diff options
author | Mark D. Roth <roth@google.com> | 2016-08-31 10:46:58 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-08-31 10:46:58 -0700 |
commit | ceb39ae60c0469d9e7933ac94f10c6e63db55536 (patch) | |
tree | 9414f2dce9989de7530d11c9c827afeda7788754 /tools/buildgen/plugins/expand_version.py | |
parent | 0c137e2e1f737d84e95805bf406a7f7e8938c065 (diff) | |
parent | 79d7d996002ff1a4d0523af1895c2e007fdba159 (diff) |
Merge remote-tracking branch 'upstream/master' into http_connect
Diffstat (limited to 'tools/buildgen/plugins/expand_version.py')
-rwxr-xr-x | tools/buildgen/plugins/expand_version.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/buildgen/plugins/expand_version.py b/tools/buildgen/plugins/expand_version.py index c6cc5621c9..6098cca59c 100755 --- a/tools/buildgen/plugins/expand_version.py +++ b/tools/buildgen/plugins/expand_version.py @@ -85,10 +85,21 @@ class Version: return '%d.%d.%d' % (self.major, self.minor, self.patch) def php(self): - """Version string in PHP style""" - """PECL does not allow tag in version string""" - return '%d.%d.%d' % (self.major, self.minor, self.patch) + """Version string for PHP PECL package""" + s = '%d.%d.%d' % (self.major, self.minor, self.patch) + if self.tag: + if self.tag == 'dev': + s += 'dev' + elif len(self.tag) >= 3 and self.tag[0:3] == 'pre': + s += 'RC%d' % int(self.tag[3:]) + else: + raise Exception('Don\'t know how to translate version tag "%s" to PECL version' % self.tag) + return s + def php_composer(self): + """Version string for PHP Composer package""" + return '%d.%d.%d' % (self.major, self.minor, self.patch) + def mako_plugin(dictionary): """Expand version numbers: - for each language, ensure there's a language_version tag in |