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

Unified Diff: build/android/pylib/device/device_utils.py

Issue 1306883004: Revert of Don't bother running realpath in DeviceUtils._GetChangedAndStaleFiles() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@device5
Patch Set: manual revert Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/device_utils.py
diff --git a/build/android/pylib/device/device_utils.py b/build/android/pylib/device/device_utils.py
index 976399cfa35fa1222f4243b0076870b5ffc4585a..292c60533617888108ed379496824fb8c0eadfbb 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -1039,12 +1039,21 @@ class DeviceUtils(object):
3rd element: a list of stale files under device_path, or [] when
track_stale == False
"""
+ real_host_path = os.path.realpath(host_path)
try:
- host_checksums = md5sum.CalculateHostMd5Sums([host_path])
- interesting_device_paths = [device_path]
- if not track_stale and os.path.isdir(host_path):
+ real_device_path = self.RunShellCommand(
+ ['realpath', device_path], single_line=True, check_return=True)
+ except device_errors.CommandFailedError:
+ real_device_path = None
+ if not real_device_path:
+ return ([(host_path, device_path)], [], [])
+
+ try:
+ host_checksums = md5sum.CalculateHostMd5Sums([real_host_path])
+ interesting_device_paths = [real_device_path]
+ if not track_stale and os.path.isdir(real_host_path):
interesting_device_paths = [
- posixpath.join(device_path, os.path.relpath(p, host_path))
+ posixpath.join(real_device_path, os.path.relpath(p, real_host_path))
for p in host_checksums.keys()]
device_checksums = md5sum.CalculateDeviceMd5Sums(
interesting_device_paths, self)
@@ -1056,8 +1065,8 @@ class DeviceUtils(object):
up_to_date = []
to_delete = []
if os.path.isfile(host_path):
- host_checksum = host_checksums.get(host_path)
- device_checksum = device_checksums.get(device_path)
+ host_checksum = host_checksums.get(real_host_path)
+ device_checksum = device_checksums.get(real_device_path)
if host_checksum == device_checksum:
up_to_date.append(host_path)
else:
@@ -1065,7 +1074,7 @@ class DeviceUtils(object):
else:
for host_abs_path, host_checksum in host_checksums.iteritems():
device_abs_path = posixpath.join(
- device_path, os.path.relpath(host_abs_path, host_path))
+ real_device_path, os.path.relpath(host_abs_path, real_host_path))
device_checksum = device_checksums.pop(device_abs_path, None)
if device_checksum == host_checksum:
up_to_date.append(host_abs_path)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698