Chromium Code Reviews| 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 4e8f13378500567c0769cc143fb9f88792d1ac61..96136707ff262c40c6fb913165d7d2b5b5e6d13a 100644 |
| --- a/build/android/gyp/util/build_utils.py |
| +++ b/build/android/gyp/util/build_utils.py |
| @@ -196,7 +196,8 @@ def CheckZipPath(name): |
| raise Exception('Absolute zip path: %s' % name) |
| -def ExtractAll(zip_path, path=None, no_clobber=True, pattern=None): |
| +def ExtractAll(zip_path, path=None, no_clobber=True, pattern=None, |
| + predicate=None): |
| if path is None: |
| path = os.getcwd() |
| elif not os.path.exists(path): |
| @@ -209,6 +210,8 @@ def ExtractAll(zip_path, path=None, no_clobber=True, pattern=None): |
| if pattern is not None: |
| if not fnmatch.fnmatch(name, pattern): |
| continue |
| + if predicate is not None and not predicate(name): |
|
jbudorick
2015/09/23 00:26:20
I don't think functions can be interpreted as fals
agrieve
2015/09/23 02:07:56
Done.
|
| + continue |
| CheckZipPath(name) |
| if no_clobber: |
| output_path = os.path.join(path, name) |
| @@ -403,7 +406,8 @@ def ExpandFileArgs(args): |
| def CallAndRecordIfStale(function, options, record_path=None, input_paths=None, |
| - input_strings=None, output_paths=None, force=False): |
| + input_strings=None, output_paths=None, force=False, |
| + pass_changes=False): |
| """Wraps md5_check.CallAndRecordIfStale() and also writes dep & stamp files. |
| Depfiles and stamp files are automatically added to output_paths when present |
| @@ -427,8 +431,9 @@ def CallAndRecordIfStale(function, options, record_path=None, input_paths=None, |
| if stamp_file: |
| output_paths += [stamp_file] |
| - def on_stale_md5(): |
| - function() |
| + def on_stale_md5(changes): |
| + args = (changes,) if pass_changes else () |
| + function(*args) |
| if python_deps is not None: |
| WriteDepfile(options.depfile, python_deps + input_paths) |
| if stamp_file: |
| @@ -440,5 +445,6 @@ def CallAndRecordIfStale(function, options, record_path=None, input_paths=None, |
| input_paths=input_paths, |
| input_strings=input_strings, |
| output_paths=output_paths, |
| - force=force) |
| + force=force, |
| + pass_changes=True) |