LEFT | RIGHT |
(no file at all) | |
1 # This Source Code Form is subject to the terms of the Mozilla Public | 1 # This Source Code Form is subject to the terms of the Mozilla Public |
2 # License, v. 2.0. If a copy of the MPL was not distributed with this | 2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
4 | 4 |
5 # Note: These are the base functions common to all packagers, the actual | 5 # Note: These are the base functions common to all packagers, the actual |
6 # packagers are implemented in packagerGecko and packagerChrome. | 6 # packagers are implemented in packagerGecko and packagerChrome. |
7 | 7 |
8 import sys | 8 import sys |
9 import os | 9 import os |
10 import re | 10 import re |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 pass | 50 pass |
51 | 51 |
52 return '0' | 52 return '0' |
53 | 53 |
54 | 54 |
55 def getBuildVersion(baseDir, metadata, releaseBuild, buildNum=None): | 55 def getBuildVersion(baseDir, metadata, releaseBuild, buildNum=None): |
56 version = metadata.get('general', 'version') | 56 version = metadata.get('general', 'version') |
57 if not releaseBuild: | 57 if not releaseBuild: |
58 if buildNum == None: | 58 if buildNum == None: |
59 buildNum = getBuildNum(baseDir) | 59 buildNum = getBuildNum(baseDir) |
60 buildNum = str(buildNum) | |
61 if len(buildNum) > 0: | 60 if len(buildNum) > 0: |
62 if re.search(r'(^|\.)\d+$', version): | 61 if re.search(r'(^|\.)\d+$', version): |
63 # Numerical version number - need to fill up with zeros to have
three | 62 # Numerical version number - need to fill up with zeros to have
three |
64 # version components. | 63 # version components. |
65 while version.count('.') < 2: | 64 while version.count('.') < 2: |
66 version += '.0' | 65 version += '.0' |
67 version += '.' + buildNum | 66 version += '.' + buildNum |
68 return version | 67 return version |
69 | 68 |
70 | 69 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 names = self.keys() | 139 names = self.keys() |
141 names.sort(key=sortKey) | 140 names.sort(key=sortKey) |
142 for name in names: | 141 for name in names: |
143 zip.writestr(name, self[name]) | 142 zip.writestr(name, self[name]) |
144 zip.close() | 143 zip.close() |
145 | 144 |
146 def zipToString(self, sortKey=None): | 145 def zipToString(self, sortKey=None): |
147 buffer = StringIO() | 146 buffer = StringIO() |
148 self.zip(buffer, sortKey=sortKey) | 147 self.zip(buffer, sortKey=sortKey) |
149 return buffer.getvalue() | 148 return buffer.getvalue() |
LEFT | RIGHT |