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 sys | 7 import sys |
8 import os | 8 import os |
9 import re | 9 import re |
10 import json | 10 import json |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 file.write(struct.pack('<4sIII', 'Cr24', 2, len(pubkey), len(signature))) | 314 file.write(struct.pack('<4sIII', 'Cr24', 2, len(pubkey), len(signature))) |
315 file.write(pubkey) | 315 file.write(pubkey) |
316 file.write(signature) | 316 file.write(signature) |
317 file.write(zipdata) | 317 file.write(zipdata) |
318 | 318 |
319 def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
d=False, keyFile=None, experimentalAPI=False, devenv=False): | 319 def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
d=False, keyFile=None, experimentalAPI=False, devenv=False): |
320 metadata = readMetadata(baseDir, type) | 320 metadata = readMetadata(baseDir, type) |
321 version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum) | 321 version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum) |
322 | 322 |
323 if outFile == None: | 323 if outFile == None: |
324 outFile = getDefaultFileName(baseDir, metadata, version, 'crx' if keyFile el
se 'zip') | 324 outFile = getDefaultFileName(metadata, version, 'crx' if keyFile else 'zip') |
325 | 325 |
326 params = { | 326 params = { |
327 'type': type, | 327 'type': type, |
328 'baseDir': baseDir, | 328 'baseDir': baseDir, |
329 'releaseBuild': releaseBuild, | 329 'releaseBuild': releaseBuild, |
330 'version': version, | 330 'version': version, |
331 'experimentalAPI': experimentalAPI, | 331 'experimentalAPI': experimentalAPI, |
332 'devenv': devenv, | 332 'devenv': devenv, |
333 'metadata': metadata, | 333 'metadata': metadata, |
334 } | 334 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 'lib/info.js' not in files): | 371 'lib/info.js' not in files): |
372 files['lib/info.js'] = createInfoModule(params) | 372 files['lib/info.js'] = createInfoModule(params) |
373 | 373 |
374 zipdata = files.zipToString() | 374 zipdata = files.zipToString() |
375 signature = None | 375 signature = None |
376 pubkey = None | 376 pubkey = None |
377 if keyFile != None: | 377 if keyFile != None: |
378 signature = signBinary(zipdata, keyFile) | 378 signature = signBinary(zipdata, keyFile) |
379 pubkey = getPublicKey(keyFile) | 379 pubkey = getPublicKey(keyFile) |
380 writePackage(outFile, pubkey, signature, zipdata) | 380 writePackage(outFile, pubkey, signature, zipdata) |
OLD | NEW |