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

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

Issue 1307393004: Reland of Don't bother running realpath in DeviceUtils._GetChangedAndStaleFiles() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@device5
Patch Set: with md5sum.cc changes 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 | tools/android/md5sum/md5sum.cc » ('j') | 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 0ba057035c1cefe2955fb32ed670983a30bfdf96..243b558acb32ff0fc8a413b7e4594afb30d4f413 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -1039,21 +1039,12 @@ 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:
- 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):
+ host_checksums = md5sum.CalculateHostMd5Sums([host_path])
+ interesting_device_paths = [device_path]
+ if not track_stale and os.path.isdir(host_path):
interesting_device_paths = [
- posixpath.join(real_device_path, os.path.relpath(p, real_host_path))
+ posixpath.join(device_path, os.path.relpath(p, host_path))
for p in host_checksums.keys()]
device_checksums = md5sum.CalculateDeviceMd5Sums(
interesting_device_paths, self)
@@ -1065,8 +1056,8 @@ class DeviceUtils(object):
up_to_date = []
to_delete = []
if os.path.isfile(host_path):
- host_checksum = host_checksums.get(real_host_path)
- device_checksum = device_checksums.get(real_device_path)
+ host_checksum = host_checksums.get(host_path)
+ device_checksum = device_checksums.get(device_path)
if host_checksum == device_checksum:
up_to_date.append(host_path)
else:
@@ -1074,7 +1065,7 @@ class DeviceUtils(object):
else:
for host_abs_path, host_checksum in host_checksums.iteritems():
device_abs_path = posixpath.join(
- real_device_path, os.path.relpath(host_abs_path, real_host_path))
+ device_path, os.path.relpath(host_abs_path, 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 | tools/android/md5sum/md5sum.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698