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 bdfa28aa8a5cd9c9f18d46c03060ab46361913e6..0b1e069ef6a54520ac4a5fdba2340cbecd444bef 100644 |
| --- a/build/android/gyp/util/build_utils.py |
| +++ b/build/android/gyp/util/build_utils.py |
| @@ -101,3 +101,18 @@ def CheckCallDie(args, suppress_output=False, cwd=None): |
| print stdout, |
| return stdout |
| + |
| +def GetModifiedTime(path): |
| + # For a symlink, the modified time should be the greater of the link's |
|
newt (away)
2013/04/04 02:18:49
indent 2
cjhopman
2013/04/05 17:42:24
Done.
|
| + # modified time and the modified time of the target. |
|
newt (away)
2013/04/04 02:18:49
why?
newt (away)
2013/04/04 22:52:06
this can't hurt, but I can't think of a situation
cjhopman
2013/04/05 17:42:24
Why need symlink time:
The case that I think could
|
| + return max(os.lstat(path).st_mtime, os.stat(path).st_mtime) |
| + |
| + |
| +def IsTimeStale(output, inputs): |
| + if not os.path.exists(output): |
| + return True |
| + |
| + output_time = GetModifiedTime(output) |
| + input_time = max(map(GetModifiedTime, inputs)) |
|
newt (away)
2013/04/04 02:18:49
functional programming FTW :)
in practice, if inp
cjhopman
2013/04/05 17:42:24
This works for me.
|
| + |
| + return output_time < input_time |