Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Unified Diff: build/android/gyp/util/build_utils.py

Issue 13504003: Add modified time checking to strip_library_for_apk.py (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/strip_library_for_apk.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « build/android/gyp/strip_library_for_apk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698