build/compare-mozconfig/compare-mozconfigs-wrapper.py

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 #!/usr/bin/python
     2 # This Source Code Form is subject to the terms of the Mozilla Public
     3 # License, v. 2.0. If a copy of the MPL was not distributed with this
     4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     6 from __future__ import unicode_literals
     8 import subprocess
     9 import sys
    10 from os import path
    11 from buildconfig import substs
    13 import logging
    14 log = logging.getLogger(__name__)
    16 def determine_platform():
    17     platform_mapping = {'WINNT': {'x86_64': 'win64',
    18                                   'i686': 'win32'},
    19                         'Darwin': {'x86_64': 'macosx-universal',
    20                                    'i386':'macosx-universal'},
    21                         'Linux': {'x86_64': 'linux64',
    22                                   'i686': 'linux32'}}
    24     os_type = substs['OS_TARGET']
    25     cpu_type = substs['TARGET_CPU']
    26     return platform_mapping.get(os_type, {}).get(cpu_type, None)
    28 def main():
    29     """ A wrapper script that calls compare-mozconfig.py
    30     based on the platform that the machine is building for"""
    31     platform = determine_platform()
    33     if platform is not None:
    34         python_exe = substs['PYTHON']
    35         topsrcdir = substs['top_srcdir']
    37         # construct paths and args for compare-mozconfig
    38         browser_dir = path.join(topsrcdir, 'browser')
    39         script_path = path.join(topsrcdir, 'build/compare-mozconfig/compare-mozconfigs.py')
    40         whitelist_path = path.join(browser_dir, 'config/mozconfigs/whitelist')
    41         beta_mozconfig_path = path.join(browser_dir, 'config/mozconfigs', platform, 'beta')
    42         release_mozconfig_path = path.join(browser_dir, 'config/mozconfigs', platform, 'release')
    43         nightly_mozconfig_path = path.join(browser_dir, 'config/mozconfigs', platform, 'nightly')
    45         log.info("Comparing beta against nightly mozconfigs")
    46         ret_code = subprocess.call([python_exe, script_path, '--whitelist',
    47                                     whitelist_path, '--no-download',
    48                                     platform + ',' + beta_mozconfig_path +
    49                                     ',' + nightly_mozconfig_path])
    51         if ret_code > 0:
    52             return ret_code
    54         log.info("Comparing release against nightly mozconfigs")
    55         ret_code = subprocess.call([python_exe, script_path, '--whitelist',
    56                                     whitelist_path, '--no-download',
    57                                     platform + ',' + release_mozconfig_path +
    58                                     ',' + nightly_mozconfig_path])
    60         return ret_code
    62 if __name__ == '__main__':
    63     sys.exit(main())

mercurial