| Index: build/android/gyp/util/build_utils.py
|
| diff --git a/build/android/gyp/util/build_utils.py b/build/android/gyp/util/build_utils.py
|
| index 607f9be2771039fdd20bf09bc3ee0e690a85d059..87fee6f7d22d3c96c4c33c707567d15a5ae1de0b 100644
|
| --- a/build/android/gyp/util/build_utils.py
|
| +++ b/build/android/gyp/util/build_utils.py
|
| @@ -11,6 +11,11 @@ import shutil
|
| import subprocess
|
| import sys
|
|
|
| +CHROMIUM_SRC = os.path.join(os.path.dirname(__file__),
|
| + os.pardir, os.pardir, os.pardir, os.pardir)
|
| +COLORAMA_ROOT = os.path.join(CHROMIUM_SRC,
|
| + 'third_party', 'colorama', 'src')
|
| +
|
|
|
| def MakeDirectory(dir_path):
|
| try:
|
| @@ -100,7 +105,10 @@ class CalledProcessError(Exception):
|
| # This can be used in most cases like subprocess.check_output(). The output,
|
| # particularly when the command fails, better highlights the command's failure.
|
| # If the command fails, raises a build_utils.CalledProcessError.
|
| -def CheckOutput(args, cwd=None, print_stdout=False, print_stderr=True,
|
| +def CheckOutput(args, cwd=None,
|
| + print_stdout=False, print_stderr=True,
|
| + stdout_filter=None,
|
| + stderr_filter=None,
|
| fail_func=lambda returncode, stderr: returncode != 0):
|
| if not cwd:
|
| cwd = os.getcwd()
|
| @@ -109,6 +117,12 @@ def CheckOutput(args, cwd=None, print_stdout=False, print_stderr=True,
|
| stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=cwd)
|
| stdout, stderr = child.communicate()
|
|
|
| + if stdout_filter is not None:
|
| + stdout = stdout_filter(stdout)
|
| +
|
| + if stderr_filter is not None:
|
| + stderr = stderr_filter(stderr)
|
| +
|
| if fail_func(child.returncode, stderr):
|
| raise CalledProcessError(cwd, args, stdout + stderr)
|
|
|
|
|