author Philipp Kewisch <>
Mon, 26 Feb 2018 13:30:06 +0100
changeset 59352 c7fe8ceb6756fbf210ebb9a62c142660bfc11173
parent 24490 9e17f6ef66201825449ab40323012e1e27399a4b
child 27244 91298d293561678091a2339027f4b1668769104d
permissions -rw-r--r--
Bug 1439275 - Enable cak locale for Thunderbird. r=me MozReview-Commit-ID: AQgCsfQ8PLK

#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at

# This is a wrapper around mozilla-central's pymake. If that isn't found then
# this uses to pull it in.

import os
import sys
import subprocess
import shlex

def getpath(relpath):
    thisdir = os.path.dirname(__file__)
    return os.path.abspath(os.path.join(thisdir, *relpath))

PYMAKE = getpath(["..", "..", "mozilla", "build", "pymake", ""])
CLIENT_PY = getpath(["..", "..", ""])
CLIENT_PY_ARGS = getpath(["..", ""])

def main(args):
    if 'TINDERBOX_OUTPUT' in os.environ:
        # When building on mozilla build slaves, execute mozmake instead. Until bug
        # 978211, this is the easiest, albeit hackish, way to do this.
        mozmake = os.path.join(os.path.dirname(__file__), '..', '..',
        if os.path.exists(mozmake):
            cmd = [mozmake]
            shell = os.environ.get('SHELL')
            if shell and not shell.lower().endswith('.exe'):
                cmd += ['SHELL=%s.exe' % shell]

    if not os.path.exists(PYMAKE):
        clientpyargs = open(CLIENT_PY_ARGS, "r").read().strip()
        clientpyargs = shlex.split(clientpyargs)
        subprocess.check_call([sys.executable, CLIENT_PY, "checkout"] +

        if not os.path.exists(PYMAKE):
            raise Exception("Pymake not found even after was run")

    subprocess.check_call([sys.executable, PYMAKE] + args)

if __name__ == "__main__":