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