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

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

Issue 23513019: [android] Explicitly specify whether to ignore file paths when pushing files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comment nits Created 7 years, 3 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/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 1838ceb0831743d0e1a5354cf0af7981f7615918..4228b035f134187443d9fff1d89363d635677b33 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -425,7 +425,8 @@ class AndroidCommands(object):
if package_name:
installed_apk_path = self.GetApplicationPath(package_name)
if (installed_apk_path and
- not self.GetFilesChanged(apk_path, installed_apk_path)):
+ not self.GetFilesChanged(apk_path, installed_apk_path,
+ ignore_filenames=True)):
logging.info('Skipped install: identical %s APK already installed' %
package_name)
return
@@ -805,7 +806,7 @@ class AndroidCommands(object):
host_hash_tuples = _ParseMd5SumOutput(md5sum_output.splitlines())
return (host_hash_tuples, device_hash_tuples)
- def GetFilesChanged(self, host_path, device_path):
+ def GetFilesChanged(self, host_path, device_path, ignore_filenames=False):
frankf 2013/09/04 21:52:21 This needs to be cleaned up and move to its own ut
"""Compares the md5sum of a host path against a device path.
Note: Ignores extra files on the device.
@@ -813,6 +814,9 @@ class AndroidCommands(object):
Args:
host_path: Path (file or directory) on the host.
device_path: Path on the device.
+ ignore_filenames: If True only the file contents are considered when
+ checking whether a file has changed, otherwise the relative path
+ must also match.
Returns:
A list of tuples of the form (host_path, device_path) for files whose
@@ -822,7 +826,7 @@ class AndroidCommands(object):
host_path, device_path)
# Ignore extra files on the device.
- if len(device_hash_tuples) > len(host_hash_tuples):
+ 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]
« 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