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

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, 8 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..1fac120658f9ee621fecbad02bce8733d5a109f6 100644
--- a/build/android/gyp/util/build_utils.py
+++ b/build/android/gyp/util/build_utils.py
@@ -101,3 +101,19 @@ 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
+ # modified time and the modified time of the target.
+ 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)
+ for input in inputs:
+ if GetModifiedTime(input) > output_time:
+ return True
+ return False
« 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