| 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 argparse | 5 import argparse |
| 6 import logging | 6 import logging |
| 7 import io | 7 import io |
| 8 import json | 8 import json |
| 9 import os | 9 import os |
| 10 import re | 10 import re |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 | 364 |
| 365 if 'chrome' in platform and key_file is None: | 365 if 'chrome' in platform and key_file is None: |
| 366 logging.error('You must specify a key file for this release') | 366 logging.error('You must specify a key file for this release') |
| 367 return | 367 return |
| 368 | 368 |
| 369 import buildtools.releaseAutomation as releaseAutomation | 369 import buildtools.releaseAutomation as releaseAutomation |
| 370 releaseAutomation.run(base_dir, platform, version, key_file, | 370 releaseAutomation.run(base_dir, platform, version, key_file, |
| 371 downloads_repository) | 371 downloads_repository) |
| 372 | 372 |
| 373 | 373 |
| 374 @argparse_command(valid_platforms={'chrome'}) | |
| 375 def updatepsl(base_dir, **kwargs): | |
| 376 """Update Public Suffix List. | |
| 377 | |
| 378 Downloads Public Suffix List (see http://publicsuffix.org/) and generates | |
| 379 lib/publicSuffixList.js from it. | |
| 380 """ | |
| 381 import buildtools.publicSuffixListUpdater as publicSuffixListUpdater | |
| 382 publicSuffixListUpdater.updatePSL(base_dir) | |
| 383 | |
| 384 | |
| 385 @argparse_command(no_platform=True) | 374 @argparse_command(no_platform=True) |
| 386 def lint_gitlab_ci(base_dir, **kwargs): | 375 def lint_gitlab_ci(base_dir, **kwargs): |
| 387 """Lint the .gitlab-ci.yaml file. | 376 """Lint the .gitlab-ci.yaml file. |
| 388 | 377 |
| 389 Test the .gitlab-ci.yaml file for validity. (Note: You need to have PyYAML | 378 Test the .gitlab-ci.yaml file for validity. (Note: You need to have PyYAML |
| 390 installed.) | 379 installed.) |
| 391 """ | 380 """ |
| 392 import yaml | 381 import yaml |
| 393 filename = '.gitlab-ci.yml' | 382 filename = '.gitlab-ci.yml' |
| 394 try: | 383 try: |
| (...skipping 12 matching lines...) Expand all Loading... |
| 407 if build_available_subcommands(base_dir): | 396 if build_available_subcommands(base_dir): |
| 408 MAIN_PARSER.set_defaults(base_dir=base_dir) | 397 MAIN_PARSER.set_defaults(base_dir=base_dir) |
| 409 | 398 |
| 410 # If no args are provided, this module is run directly from the command | 399 # If no args are provided, this module is run directly from the command |
| 411 # line. argparse will take care of consuming sys.argv. | 400 # line. argparse will take care of consuming sys.argv. |
| 412 arguments = MAIN_PARSER.parse_args(args if len(args) > 0 else None) | 401 arguments = MAIN_PARSER.parse_args(args if len(args) > 0 else None) |
| 413 | 402 |
| 414 function = arguments.function | 403 function = arguments.function |
| 415 del arguments.function | 404 del arguments.function |
| 416 function(**vars(arguments)) | 405 function(**vars(arguments)) |
| OLD | NEW |