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

Unified Diff: build/android/pylib/android_commands.py

Issue 57633003: Make PushIfNeeded do what is says. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unnecessary change to call of HostHas Created 7 years, 1 month 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/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 1741619276ce56042a9a3df6f3b004fed1ebe3ad..1826315b8d94b7bb2dd652bdad8c39f02e868c4b 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -841,13 +841,17 @@ class AndroidCommands(object):
A list of tuples of the form (host_path, device_path) for files whose
md5sums do not match.
"""
+
+ real_host_path = os.path.realpath(host_path)
craigdh 2013/11/05 19:10:08 add a comment here explaining why this is needed
aberent 2013/11/05 19:58:34 Done.
+ real_device_path = self.RunShellCommand('realpath "%s"' % device_path)[0]
+
host_hash_tuples, device_hash_tuples = self._RunMd5Sum(
- host_path, device_path)
+ real_host_path, real_device_path)
# Ignore extra files on the device.
if not ignore_filenames:
host_files = [os.path.relpath(os.path.normpath(p.path),
- os.path.normpath(host_path)) for p in host_hash_tuples]
+ real_host_path) for p in host_hash_tuples]
def HostHas(fname):
return any(path in fname for path in host_files)
@@ -862,12 +866,12 @@ class AndroidCommands(object):
# only a single file is given as the base name given in device_path may
# differ from that in host_path.
def HostToDevicePath(host_file_path):
- return os.path.join(device_path, os.path.relpath(
- host_file_path, os.path.normpath(host_path)))
+ return os.path.join(device_path, os.path.relpath(host_file_path,
+ real_host_path))
device_hashes = [h.hash for h in device_hash_tuples]
- return [(t.path, HostToDevicePath(t.path) if os.path.isdir(host_path) else
- device_path)
+ return [(t.path, HostToDevicePath(t.path) if
+ os.path.isdir(real_host_path) else real_device_path)
for t in host_hash_tuples if t.hash not in device_hashes]
def PushIfNeeded(self, host_path, device_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