forked from BrowserWorks/Waterfox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backed out changeset 061b9318815b (bug 846906) for accidentally remov…
…ing mach.
- Loading branch information
1 parent
c66ca5e
commit 82d09e2
Showing
6 changed files
with
52 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/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/. | ||
|
||
from __future__ import print_function, unicode_literals | ||
|
||
import os | ||
import sys | ||
|
||
def ancestors(path): | ||
while path: | ||
yield path | ||
(path, child) = os.path.split(path) | ||
if child == "": | ||
break | ||
|
||
def load_mach(topsrcdir): | ||
sys.path[0:0] = [os.path.join(topsrcdir, "build")] | ||
import mach_bootstrap | ||
return mach_bootstrap.bootstrap(topsrcdir) | ||
|
||
# Check whether the current directory is within a mach src or obj dir. | ||
for dir_path in ancestors(os.getcwd()): | ||
# If we find a "mozinfo.json" file, we are in the objdir. | ||
mozinfo_path = os.path.join(dir_path, "mozinfo.json") | ||
if os.path.isfile(mozinfo_path): | ||
import json | ||
info = json.load(open(mozinfo_path)) | ||
if "mozconfig" in info and "MOZCONFIG" not in os.environ: | ||
# If the MOZCONFIG environment variable is not already set, set it | ||
# to the value from mozinfo.json. This will tell the build system | ||
# to look for a config file at the path in $MOZCONFIG rather than | ||
# its default locations. | ||
# | ||
# Note: subprocess requires native strings in os.environ Python | ||
# 2.7.2 and earlier on Windows. | ||
os.environ[b"MOZCONFIG"] = str(info["mozconfig"]) | ||
|
||
if "topsrcdir" in info: | ||
# Continue searching for mach_bootstrap in the source directory. | ||
dir_path = info["topsrcdir"] | ||
|
||
# If we find the mach bootstrap module, we are in the srcdir. | ||
mach_path = os.path.join(dir_path, "build/mach_bootstrap.py") | ||
if os.path.isfile(mach_path): | ||
mach = load_mach(dir_path) | ||
sys.exit(mach.run(sys.argv[1:])) | ||
|
||
print("Could not run mach: No mach source directory found") | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters