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

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

Issue 1300263002: Don't bother running realpath in DeviceUtils._GetChangedAndStaleFiles() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@device5
Patch Set: rebase 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 1e2ff8728742a68720e7e069b2ce0c5323c46249..becd514106bf7b9fe5049fa939f4409fbb202a92 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -1034,21 +1034,12 @@ class DeviceUtils(object):
2nd 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)
@@ -1057,8 +1048,8 @@ class DeviceUtils(object):
return ([(host_path, device_path)], [])
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:
return ([(host_path, device_path)], [])
else:
@@ -1066,8 +1057,8 @@ class DeviceUtils(object):
else:
to_push = []
for host_abs_path, host_checksum in host_checksums.iteritems():
- device_abs_path = '%s/%s' % (
- real_device_path, os.path.relpath(host_abs_path, real_host_path))
+ device_abs_path = posixpath.join(
+ device_path, os.path.relpath(host_abs_path, host_path))
device_checksum = device_checksums.pop(device_abs_path, None)
if device_checksum != host_checksum:
to_push.append((host_abs_path, device_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