| Index: build.py |
| =================================================================== |
| --- a/build.py |
| +++ b/build.py |
| @@ -382,44 +382,47 @@ def generateDocs(baseDir, scriptName, op |
| '-x=js,jsm', |
| os.path.join(baseDir, 'lib')] |
| if quiet: |
| subprocess.check_output(command) |
| else: |
| subprocess.check_call(command) |
| def runReleaseAutomation(baseDir, scriptName, opts, args, type): |
| - keyFile = None |
| + keyFiles = [] |
| downloadsRepo = os.path.join(baseDir, '..', 'downloads') |
| for option, value in opts: |
| if option in ('-k', '--key'): |
| - keyFile = value |
| + keyFiles.append(value) |
| elif option in ('-d', '--downloads'): |
| downloadsRepo = value |
| if len(args) == 0: |
| print 'No version number specified for the release' |
| usage(scriptName, type, 'release') |
| return |
| version = args[0] |
| if re.search(r'[^\d\.]', version): |
| print 'Wrong version number format' |
| usage(scriptName, type, 'release') |
| return |
| - if keyFile == None: |
| - if type == "gecko": |
| - print >>sys.stderr, "Warning: no key file specified, creating an unsigned release build\n" |
| - else: |
| - print >>sys.stderr, "Error: key file is required for the release" |
| - usage(scriptName, type, 'release') |
| - return |
| + if type == "gecko" and len(keyFiles) == 0: |
| + print >>sys.stderr, "Warning: no key file specified, creating an unsigned release build\n" |
| + elif type == "gecko" and len(keyFiles) > 1: |
| + print >>sys.stderr, "Error: too many key files, only one required" |
| + usage(scriptName, type, 'release') |
| + return |
| + elif type == "chrome" and len(keyFiles) != 2: |
| + print >>sys.stderr, "Error: wrong number of key files specified, two keys (Chrome and Safari) required for the release" |
| + usage(scriptName, type, 'release') |
| + return |
| import buildtools.releaseAutomation as releaseAutomation |
| - releaseAutomation.run(baseDir, type, version, keyFile, downloadsRepo) |
| + releaseAutomation.run(baseDir, type, version, keyFiles, downloadsRepo) |
| def updatePSL(baseDir, scriptName, opts, args, type): |
| import buildtools.publicSuffixListUpdater as publicSuffixListUpdater |
| publicSuffixListUpdater.updatePSL(baseDir) |
| with addCommand(lambda baseDir, scriptName, opts, args, type: usage(scriptName, type), ('help', '-h', '--help')) as command: |
| command.shortDescription = 'Show this message' |
| @@ -487,17 +490,17 @@ with addCommand(generateDocs, 'docs') as |
| command.supportedTypes = ('gecko') |
| with addCommand(runReleaseAutomation, 'release') as command: |
| command.shortDescription = 'Run release automation' |
| command.description = 'Note: If you are not the project owner then you '\ |
| 'probably don\'t want to run this!\n\n'\ |
| 'Runs release automation: creates downloads for the new version, tags '\ |
| 'source code repository as well as downloads and buildtools repository.' |
| - command.addOption('File containing private key and certificates required to sign the release', short='k', long='key', value='file', types=('gecko', 'chrome')) |
| + command.addOption('File containing private key and certificates required to sign the release. Note that for Chrome releases this option needs to be specified twice: first a key to sign Chrome/Opera builds, then another to sign the Safari build.', short='k', long='key', value='file', types=('gecko', 'chrome')) |
| command.addOption('Directory containing downloads repository (if omitted ../downloads is assumed)', short='d', long='downloads', value='dir') |
| command.params = '[options] <version>' |
| command.supportedTypes = ('gecko', 'chrome') |
| with addCommand(updatePSL, 'updatepsl') as command: |
| command.shortDescription = 'Updates Public Suffix List' |
| command.description = 'Downloads Public Suffix List (see http://publicsuffix.org/) and generates lib/publicSuffixList.js from it.' |
| command.supportedTypes = ('chrome', 'opera') |