| OLD | NEW |
| 1 # This Source Code Form is subject to the terms of the Mozilla Public | 1 # This Source Code Form is subject to the terms of the Mozilla Public |
| 2 # License, v. 2.0. If a copy of the MPL was not distributed with this | 2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 4 | 4 |
| 5 import os | 5 import os |
| 6 import sys | 6 import sys |
| 7 import re | 7 import re |
| 8 import subprocess | 8 import subprocess |
| 9 import shutil | 9 import shutil |
| 10 import buildtools | 10 import buildtools |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 if len(args) == 0: | 435 if len(args) == 0: |
| 436 print 'No version number specified for the release' | 436 print 'No version number specified for the release' |
| 437 usage(scriptName, type, 'release') | 437 usage(scriptName, type, 'release') |
| 438 return | 438 return |
| 439 version = args[0] | 439 version = args[0] |
| 440 if re.search(r'[^\d\.]', version): | 440 if re.search(r'[^\d\.]', version): |
| 441 print 'Wrong version number format' | 441 print 'Wrong version number format' |
| 442 usage(scriptName, type, 'release') | 442 usage(scriptName, type, 'release') |
| 443 return | 443 return |
| 444 | 444 |
| 445 if type == 'chrome' and len(keyFiles) != 2: | 445 if (type == 'chrome' or type == 'safari') and len(keyFiles) != 1: |
| 446 print >>sys.stderr, 'Error: wrong number of key files specified, two key
s (Chrome and Safari) required for the release' | 446 print >>sys.stderr, 'Error: you must specify a key file for this release
' |
| 447 usage(scriptName, type, 'release') | 447 usage(scriptName, type, 'release') |
| 448 return | 448 return |
| 449 | 449 |
| 450 import buildtools.releaseAutomation as releaseAutomation | 450 import buildtools.releaseAutomation as releaseAutomation |
| 451 releaseAutomation.run(baseDir, type, version, keyFiles, downloadsRepo) | 451 releaseAutomation.run(baseDir, type, version, keyFiles, downloadsRepo) |
| 452 | 452 |
| 453 | 453 |
| 454 def updatePSL(baseDir, scriptName, opts, args, type): | 454 def updatePSL(baseDir, scriptName, opts, args, type): |
| 455 import buildtools.publicSuffixListUpdater as publicSuffixListUpdater | 455 import buildtools.publicSuffixListUpdater as publicSuffixListUpdater |
| 456 publicSuffixListUpdater.updatePSL(baseDir) | 456 publicSuffixListUpdater.updatePSL(baseDir) |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 command.addOption('Suppress JsDoc output', short='q', long='quiet') | 518 command.addOption('Suppress JsDoc output', short='q', long='quiet') |
| 519 command.params = '[options] <directory>' | 519 command.params = '[options] <directory>' |
| 520 command.supportedTypes = ('gecko', 'chrome') | 520 command.supportedTypes = ('gecko', 'chrome') |
| 521 | 521 |
| 522 with addCommand(runReleaseAutomation, 'release') as command: | 522 with addCommand(runReleaseAutomation, 'release') as command: |
| 523 command.shortDescription = 'Run release automation' | 523 command.shortDescription = 'Run release automation' |
| 524 command.description = 'Note: If you are not the project owner then you '
"probably don't want to run this!\n\n" 'Runs release automation: crea
tes downloads for the new version, tags ' 'source code repository as well
as downloads and buildtools repository.' | 524 command.description = 'Note: If you are not the project owner then you '
"probably don't want to run this!\n\n" 'Runs release automation: crea
tes downloads for the new version, tags ' 'source code repository as well
as downloads and buildtools repository.' |
| 525 command.addOption('File containing private key and certificates required to
sign the release. Note that for Chrome releases this option needs to be specifie
d twice: first a key to sign Chrome builds, then another to sign the Safari buil
d.', short='k', long='key', value='file', types=('chrome',)) | 525 command.addOption('File containing private key and certificates required to
sign the release. Note that for Chrome releases this option needs to be specifie
d twice: first a key to sign Chrome builds, then another to sign the Safari buil
d.', short='k', long='key', value='file', types=('chrome',)) |
| 526 command.addOption('Directory containing downloads repository (if omitted ../
downloads is assumed)', short='d', long='downloads', value='dir') | 526 command.addOption('Directory containing downloads repository (if omitted ../
downloads is assumed)', short='d', long='downloads', value='dir') |
| 527 command.params = '[options] <version>' | 527 command.params = '[options] <version>' |
| 528 command.supportedTypes = ('gecko', 'chrome') | 528 command.supportedTypes = ('gecko', 'chrome', 'safari', 'edge') |
| 529 | 529 |
| 530 with addCommand(updatePSL, 'updatepsl') as command: | 530 with addCommand(updatePSL, 'updatepsl') as command: |
| 531 command.shortDescription = 'Updates Public Suffix List' | 531 command.shortDescription = 'Updates Public Suffix List' |
| 532 command.description = 'Downloads Public Suffix List (see http://publicsuffix
.org/) and generates lib/publicSuffixList.js from it.' | 532 command.description = 'Downloads Public Suffix List (see http://publicsuffix
.org/) and generates lib/publicSuffixList.js from it.' |
| 533 command.supportedTypes = ('chrome',) | 533 command.supportedTypes = ('chrome',) |
| 534 | 534 |
| 535 | 535 |
| 536 def getType(baseDir, scriptName, args): | 536 def getType(baseDir, scriptName, args): |
| 537 # Look for an explicit type parameter (has to be the first parameter) | 537 # Look for an explicit type parameter (has to be the first parameter) |
| 538 if len(args) >= 2 and args[0] == '-t': | 538 if len(args) >= 2 and args[0] == '-t': |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 if option in ('-h', '--help'): | 598 if option in ('-h', '--help'): |
| 599 usage(scriptName, type, command) | 599 usage(scriptName, type, command) |
| 600 sys.exit() | 600 sys.exit() |
| 601 commands[command](baseDir, scriptName, opts, args, type) | 601 commands[command](baseDir, scriptName, opts, args, type) |
| 602 else: | 602 else: |
| 603 print 'Command %s is not supported for this application type' % comm
and | 603 print 'Command %s is not supported for this application type' % comm
and |
| 604 usage(scriptName, type) | 604 usage(scriptName, type) |
| 605 else: | 605 else: |
| 606 print 'Command %s is unrecognized' % command | 606 print 'Command %s is unrecognized' % command |
| 607 usage(scriptName, type) | 607 usage(scriptName, type) |
| OLD | NEW |