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

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

Issue 14601004: [Android] Only reinstall test apk if needed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 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 | build/android/pylib/gtest/test_package_apk.py » ('j') | 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 bda1b69615e7773f8f379546357752d1fde03402..e677ba401914d2697facb597e0aa7c851bcd1e92 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -672,7 +672,18 @@ class AndroidCommands(object):
"""
self.RunShellCommand('input keyevent %d' % keycode)
- def CheckMd5Sum(self, local_path, device_path):
+ def CheckMd5Sum(self, local_path, device_path, ignore_paths=False):
+ """Compares the md5sum of a local path against a device path.
+
+ Args:
+ local_path: Path (file or directory) on the host.
+ device_path: Path on the device.
+ ignore_paths: If False, both the md5sum and the relative paths/names of
+ files must match. If True, only the md5sum must match.
+
+ Returns:
+ True if the md5sums match.
+ """
assert os.path.exists(local_path), 'Local path not found %s' % local_path
if not self._md5sum_build_dir:
@@ -697,6 +708,10 @@ class AndroidCommands(object):
['%s/md5sum_bin_host' % self._md5sum_build_dir, local_path])
hashes_on_host = _ComputeFileListHash(md5sum_output.splitlines())
+ if ignore_paths:
+ hashes_on_device = [h.split()[0] for h in hashes_on_device]
+ hashes_on_host = [h.split()[0] for h in hashes_on_host]
+
return hashes_on_device == hashes_on_host
def PushIfNeeded(self, local_path, device_path):
« no previous file with comments | « no previous file | build/android/pylib/gtest/test_package_apk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698