Merge m-c to inbound.

This commit is contained in:
Ryan VanderMeulen 2013-03-07 17:26:36 -05:00
commit 1e587f8e63

View File

@ -1,4 +1,3 @@
#!/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 http://mozilla.org/MPL/2.0/.
@ -41,7 +40,10 @@ MACH_MODULES = [
'tools/mach_commands.py',
]
def bootstrap(topsrcdir):
def bootstrap(topsrcdir, mozilla_dir=None):
if mozilla_dir is None:
mozilla_dir = topsrcdir
# Ensure we are running Python 2.7+. We put this check here so we generate a
# user-friendly error message rather than a cryptic stack trace on module
# import.
@ -53,10 +55,10 @@ def bootstrap(topsrcdir):
try:
import mach.main
except ImportError:
sys.path[0:0] = [os.path.join(topsrcdir, path) for path in SEARCH_PATHS]
sys.path[0:0] = [os.path.join(mozilla_dir, path) for path in SEARCH_PATHS]
import mach.main
mach = mach.main.Mach(topsrcdir)
for path in MACH_MODULES:
mach.load_commands_from_file(os.path.join(topsrcdir, path))
mach.load_commands_from_file(os.path.join(mozilla_dir, path))
return mach