| OLD | NEW |
| 1 # coding: utf-8 | 1 # coding: utf-8 |
| 2 | 2 |
| 3 # This Source Code Form is subject to the terms of the Mozilla Public | 3 # This Source Code Form is subject to the terms of the Mozilla Public |
| 4 # License, v. 2.0. If a copy of the MPL was not distributed with this | 4 # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 | 6 |
| 7 import os | 7 import os |
| 8 import sys | 8 import sys |
| 9 import re | 9 import re |
| 10 import hashlib | 10 import hashlib |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 def createBuild(baseDir, type="gecko", outFile=None, locales=None, buildNum=None
, releaseBuild=False, keyFile=None, multicompartment=False): | 317 def createBuild(baseDir, type="gecko", outFile=None, locales=None, buildNum=None
, releaseBuild=False, keyFile=None, multicompartment=False): |
| 318 if locales == None: | 318 if locales == None: |
| 319 locales = getLocales(baseDir) | 319 locales = getLocales(baseDir) |
| 320 elif locales == 'all': | 320 elif locales == 'all': |
| 321 locales = getLocales(baseDir, True) | 321 locales = getLocales(baseDir, True) |
| 322 | 322 |
| 323 metadata = readMetadata(baseDir, type) | 323 metadata = readMetadata(baseDir, type) |
| 324 version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum) | 324 version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum) |
| 325 | 325 |
| 326 if outFile == None: | 326 if outFile == None: |
| 327 outFile = getDefaultFileName(baseDir, metadata, version, 'xpi') | 327 outFile = getDefaultFileName(metadata, version, 'xpi') |
| 328 | 328 |
| 329 contributors = getContributors(metadata) | 329 contributors = getContributors(metadata) |
| 330 | 330 |
| 331 params = { | 331 params = { |
| 332 'baseDir': baseDir, | 332 'baseDir': baseDir, |
| 333 'locales': locales, | 333 'locales': locales, |
| 334 'releaseBuild': releaseBuild, | 334 'releaseBuild': releaseBuild, |
| 335 'version': version.encode('utf-8'), | 335 'version': version.encode('utf-8'), |
| 336 'metadata': metadata, | 336 'metadata': metadata, |
| 337 'contributors': contributors, | 337 'contributors': contributors, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 354 if metadata.has_section('preprocess'): | 354 if metadata.has_section('preprocess'): |
| 355 files.preprocess([f for f, _ in metadata.items('preprocess')]) | 355 files.preprocess([f for f, _ in metadata.items('preprocess')]) |
| 356 if keyFile: | 356 if keyFile: |
| 357 signFiles(files, keyFile) | 357 signFiles(files, keyFile) |
| 358 files.zip(outFile, sortKey=lambda x: '!' if x == 'META-INF/zigbert.rsa' else x
) | 358 files.zip(outFile, sortKey=lambda x: '!' if x == 'META-INF/zigbert.rsa' else x
) |
| 359 | 359 |
| 360 def autoInstall(baseDir, type, host, port, multicompartment=False): | 360 def autoInstall(baseDir, type, host, port, multicompartment=False): |
| 361 fileBuffer = StringIO() | 361 fileBuffer = StringIO() |
| 362 createBuild(baseDir, type=type, outFile=fileBuffer, multicompartment=multicomp
artment) | 362 createBuild(baseDir, type=type, outFile=fileBuffer, multicompartment=multicomp
artment) |
| 363 urllib.urlopen('http://%s:%s/' % (host, port), data=fileBuffer.getvalue()) | 363 urllib.urlopen('http://%s:%s/' % (host, port), data=fileBuffer.getvalue()) |
| OLD | NEW |