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

Delta Between Two Patch Sets: packagerSafari.py

Issue 29333368: Issue 3498 - Improve file mapping / skipping logic (Closed)
Left Patch Set: Pass the skip parameter for both Gecko Files.read calls Created Jan. 12, 2016, 1:24 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 | « packagerGecko.py ('k') | no next file » | 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 re 8 import re
9 import json 9 import json
10 import ConfigParser 10 import ConfigParser
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 221
222 params = { 222 params = {
223 'type': type, 223 'type': type,
224 'baseDir': baseDir, 224 'baseDir': baseDir,
225 'releaseBuild': releaseBuild, 225 'releaseBuild': releaseBuild,
226 'version': version, 226 'version': version,
227 'devenv': devenv, 227 'devenv': devenv,
228 'metadata': metadata, 228 'metadata': metadata,
229 } 229 }
230 230
231 skip = metadata.options('mapping') if metadata.has_section('mapping') else [] 231 mapped = metadata.items('mapping') if metadata.has_section('mapping') else []
232 files = Files(getPackageFiles(params), getIgnoredFiles(params), 232 files = Files(getPackageFiles(params), getIgnoredFiles(params),
233 process=lambda path, data: processFile(path, data, params)) 233 process=lambda path, data: processFile(path, data, params))
234 if metadata.has_section('mapping'): 234 files.readMappedFiles(mapped)
235 files.readMappedFiles(metadata.items('mapping')) 235 files.read(baseDir, skip=[opt for opt, _ in mapped])
236 files.read(baseDir, skip=skip)
237 236
238 if metadata.has_section('convert_js'): 237 if metadata.has_section('convert_js'):
239 convertJS(params, files) 238 convertJS(params, files)
240 239
241 if metadata.has_section('convert_img'): 240 if metadata.has_section('convert_img'):
242 from imageConversion import convertImages 241 from imageConversion import convertImages
243 convertImages(params, files) 242 convertImages(params, files)
244 243
245 if metadata.has_section('preprocess'): 244 if metadata.has_section('preprocess'):
246 files.preprocess( 245 files.preprocess(
(...skipping 20 matching lines...) Expand all
267 fixAbsoluteUrls(files) 266 fixAbsoluteUrls(files)
268 267
269 dirname = metadata.get('general', 'basename') + '.safariextension' 268 dirname = metadata.get('general', 'basename') + '.safariextension'
270 for filename in files.keys(): 269 for filename in files.keys():
271 files[os.path.join(dirname, filename)] = files.pop(filename) 270 files[os.path.join(dirname, filename)] = files.pop(filename)
272 271
273 if not devenv and keyFile: 272 if not devenv and keyFile:
274 createSignedXarArchive(outFile, files, certs, key) 273 createSignedXarArchive(outFile, files, certs, key)
275 else: 274 else:
276 files.zip(outFile) 275 files.zip(outFile)
LEFTRIGHT

Powered by Google App Engine
This is Rietveld