Index: tools/telemetry/catapult_base/dependency_manager/dependency_manager.py |
diff --git a/tools/telemetry/catapult_base/dependency_manager/dependency_manager.py b/tools/telemetry/catapult_base/dependency_manager/dependency_manager.py |
index 9e1de84fcfe70e92f847e353ea4aa405e467fba5..3dfb3366595d18d98dd2add3ae5a59b9be2fdf28 100644 |
--- a/tools/telemetry/catapult_base/dependency_manager/dependency_manager.py |
+++ b/tools/telemetry/catapult_base/dependency_manager/dependency_manager.py |
@@ -214,10 +214,20 @@ class DependencyManager(object): |
Returns: A path to a local file, or None if not found. |
""" |
if dependency_info: |
- paths = dependency_info.local_paths |
- for local_path in paths: |
- if os.path.exists(local_path): |
- return local_path |
+ local_paths = dependency_info.local_paths |
+ found_path = None |
+ for priority_group in local_paths: |
+ # A list of paths in local_paths implies the same priority, so return |
+ # the most recently modified one. |
+ found_path_mtime = 0 |
+ for path in priority_group: |
+ if os.path.exists(path): |
+ mtime = os.stat(path).st_mtime |
eakuefner
2015/10/09 16:29:17
mtime = os.path.getmtime(path)
|
+ if mtime > found_path_mtime: |
+ found_path = path |
+ found_path_mtime = mtime |
+ if found_path: |
+ return found_path |
return None |
@staticmethod |