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

Side by Side Diff: packagerGecko.py

Issue 29333368: Issue 3498 - Improve file mapping / skipping logic (Closed)
Patch Set: Addressed Sebastian's feedback Created Jan. 12, 2016, 5:29 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « packagerChrome.py ('k') | packagerSafari.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 mapped = metadata.items('mapping') if metadata.has_section('mapping') else []
342 skip = [opt for opt, _ in mapped].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 files.readMappedFiles(mapped)
345 files.readMappedFiles(metadata.items('mapping')) 347 files.read(baseDir, skip=skip)
346 files.read(baseDir, skip=('chrome'))
347 for name, path in getChromeSubdirs(baseDir, params['locales']).iteritems(): 348 for name, path in getChromeSubdirs(baseDir, params['locales']).iteritems():
348 if os.path.isdir(path): 349 if os.path.isdir(path):
349 files.read(path, 'chrome/%s' % name) 350 files.read(path, 'chrome/%s' % name, skip=skip)
350 importLocales(params, files) 351 importLocales(params, files)
351 fixupLocales(params, files) 352 fixupLocales(params, files)
352 if not 'bootstrap.js' in files: 353 if not 'bootstrap.js' in files:
353 addMissingFiles(params, files) 354 addMissingFiles(params, files)
354 if metadata.has_section('preprocess'): 355 if metadata.has_section('preprocess'):
355 files.preprocess([f for f, _ in metadata.items('preprocess')]) 356 files.preprocess([f for f, _ in metadata.items('preprocess')])
356 if keyFile: 357 if keyFile:
357 signFiles(files, keyFile) 358 signFiles(files, keyFile)
358 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 )
359 360
360 def autoInstall(baseDir, type, host, port, multicompartment=False): 361 def autoInstall(baseDir, type, host, port, multicompartment=False):
361 fileBuffer = StringIO() 362 fileBuffer = StringIO()
362 createBuild(baseDir, type=type, outFile=fileBuffer, multicompartment=multicomp artment) 363 createBuild(baseDir, type=type, outFile=fileBuffer, multicompartment=multicomp artment)
363 urllib.urlopen('http://%s:%s/' % (host, port), data=fileBuffer.getvalue()) 364 urllib.urlopen('http://%s:%s/' % (host, port), data=fileBuffer.getvalue())
OLDNEW
« no previous file with comments | « packagerChrome.py ('k') | packagerSafari.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld