Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: packagerGecko.py

Issue 29333368: Issue 3498 - Improve file mapping / skipping logic (Closed)
Left Patch Set: Addressed Wladimir's feedback Created Jan. 12, 2016, 1:03 p.m.
Right Patch Set: Fixed typo in Gecko packager Created Jan. 13, 2016, 11:10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « packagerChrome.py ('k') | packagerSafari.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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 [] 341 mapped = metadata.items('mapping') if metadata.has_section('mapping') else []
342 skip = [opt for opt, _ in mapped] + ['chrome']
342 files = Files(getPackageFiles(params), getIgnoredFiles(params), 343 files = Files(getPackageFiles(params), getIgnoredFiles(params),
343 process=lambda path, data: processFile(path, data, params)) 344 process=lambda path, data: processFile(path, data, params))
344 files['install.rdf'] = createManifest(params) 345 files['install.rdf'] = createManifest(params)
345 if metadata.has_section('mapping'): 346 files.readMappedFiles(mapped)
346 files.readMappedFiles(metadata.items('mapping')) 347 files.read(baseDir, skip=skip)
347 files.read(baseDir, skip=skip + ['chrome'])
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) 350 files.read(path, 'chrome/%s' % name, skip=skip)
Wladimir Palant 2016/01/12 13:17:06 Same skip parameter has to be specified here as we
kzar 2016/01/12 13:26:03 Done.
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())
LEFTRIGHT

Powered by Google App Engine
This is Rietveld