LEFT | RIGHT |
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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, |
338 'multicompartment': multicompartment, | 338 'multicompartment': multicompartment, |
339 } | 339 } |
340 | 340 |
341 mapped = metadata.items('mapping') if metadata.has_section('mapping') else [] | 341 mapped = metadata.items('mapping') if metadata.has_section('mapping') else [] |
342 skip = [opt for opt, _ in mapped].append('chrome') | 342 skip = [opt for opt, _ in mapped] + ['chrome'] |
343 files = Files(getPackageFiles(params), getIgnoredFiles(params), | 343 files = Files(getPackageFiles(params), getIgnoredFiles(params), |
344 process=lambda path, data: processFile(path, data, params)) | 344 process=lambda path, data: processFile(path, data, params)) |
345 files['install.rdf'] = createManifest(params) | 345 files['install.rdf'] = createManifest(params) |
346 files.readMappedFiles(mapped) | 346 files.readMappedFiles(mapped) |
347 files.read(baseDir, skip=skip) | 347 files.read(baseDir, skip=skip) |
348 for name, path in getChromeSubdirs(baseDir, params['locales']).iteritems(): | 348 for name, path in getChromeSubdirs(baseDir, params['locales']).iteritems(): |
349 if os.path.isdir(path): | 349 if os.path.isdir(path): |
350 files.read(path, 'chrome/%s' % name, skip=skip) | 350 files.read(path, 'chrome/%s' % name, skip=skip) |
351 importLocales(params, files) | 351 importLocales(params, files) |
352 fixupLocales(params, files) | 352 fixupLocales(params, files) |
353 if not 'bootstrap.js' in files: | 353 if not 'bootstrap.js' in files: |
354 addMissingFiles(params, files) | 354 addMissingFiles(params, files) |
355 if metadata.has_section('preprocess'): | 355 if metadata.has_section('preprocess'): |
356 files.preprocess([f for f, _ in metadata.items('preprocess')]) | 356 files.preprocess([f for f, _ in metadata.items('preprocess')]) |
357 if keyFile: | 357 if keyFile: |
358 signFiles(files, keyFile) | 358 signFiles(files, keyFile) |
359 files.zip(outFile, sortKey=lambda x: '!' if x == 'META-INF/zigbert.rsa' else x
) | 359 files.zip(outFile, sortKey=lambda x: '!' if x == 'META-INF/zigbert.rsa' else x
) |
360 | 360 |
361 def autoInstall(baseDir, type, host, port, multicompartment=False): | 361 def autoInstall(baseDir, type, host, port, multicompartment=False): |
362 fileBuffer = StringIO() | 362 fileBuffer = StringIO() |
363 createBuild(baseDir, type=type, outFile=fileBuffer, multicompartment=multicomp
artment) | 363 createBuild(baseDir, type=type, outFile=fileBuffer, multicompartment=multicomp
artment) |
364 urllib.urlopen('http://%s:%s/' % (host, port), data=fileBuffer.getvalue()) | 364 urllib.urlopen('http://%s:%s/' % (host, port), data=fileBuffer.getvalue()) |
LEFT | RIGHT |