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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/android/gyp/strip_library_for_apk.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import fnmatch 5 import fnmatch
6 import json 6 import json
7 import os 7 import os
8 import pipes 8 import pipes
9 import shlex 9 import shlex
10 import shutil 10 import shutil
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 print stdout, 94 print stdout,
95 95
96 # Directly exit to avoid printing stacktrace. 96 # Directly exit to avoid printing stacktrace.
97 sys.exit(child.returncode) 97 sys.exit(child.returncode)
98 98
99 else: 99 else:
100 if stdout and not suppress_output: 100 if stdout and not suppress_output:
101 print stdout, 101 print stdout,
102 return stdout 102 return stdout
103 103
104
105 def GetModifiedTime(path):
106 # For a symlink, the modified time should be the greater of the link's
107 # modified time and the modified time of the target.
108 return max(os.lstat(path).st_mtime, os.stat(path).st_mtime)
109
110
111 def IsTimeStale(output, inputs):
112 if not os.path.exists(output):
113 return True
114
115 output_time = GetModifiedTime(output)
116 for input in inputs:
117 if GetModifiedTime(input) > output_time:
118 return True
119 return False
OLDNEW
« 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