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

Side by Side Diff: build/android/pylib/device/device_utils.py

Issue 1085713002: [Android] DeviceUtils change to make Install work without md5 binary. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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 unified diff | Download patch
« no previous file with comments | « build/android/pylib/constants/__init__.py ('k') | build/android/pylib/utils/md5sum.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Provides a variety of device interactions based on adb. 5 """Provides a variety of device interactions based on adb.
6 6
7 Eventually, this will be based on adb_wrapper. 7 Eventually, this will be based on adb_wrapper.
8 """ 8 """
9 # pylint: disable=unused-argument 9 # pylint: disable=unused-argument
10 10
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 def _GetChangedFilesImpl(self, host_path, device_path): 869 def _GetChangedFilesImpl(self, host_path, device_path):
870 real_host_path = os.path.realpath(host_path) 870 real_host_path = os.path.realpath(host_path)
871 try: 871 try:
872 real_device_path = self.RunShellCommand( 872 real_device_path = self.RunShellCommand(
873 ['realpath', device_path], single_line=True, check_return=True) 873 ['realpath', device_path], single_line=True, check_return=True)
874 except device_errors.CommandFailedError: 874 except device_errors.CommandFailedError:
875 real_device_path = None 875 real_device_path = None
876 if not real_device_path: 876 if not real_device_path:
877 return [(host_path, device_path)] 877 return [(host_path, device_path)]
878 878
879 host_checksums = md5sum.CalculateHostMd5Sums([real_host_path]) 879 try:
880 device_paths_to_md5 = ( 880 host_checksums = md5sum.CalculateHostMd5Sums([real_host_path])
881 real_device_path if os.path.isfile(real_host_path) 881 device_paths_to_md5 = (
882 else ('%s/%s' % (real_device_path, os.path.relpath(p, real_host_path)) 882 real_device_path if os.path.isfile(real_host_path)
883 for p in host_checksums.iterkeys())) 883 else ('%s/%s' % (real_device_path, os.path.relpath(p, real_host_path))
884 device_checksums = md5sum.CalculateDeviceMd5Sums( 884 for p in host_checksums.iterkeys()))
885 device_paths_to_md5, self) 885 device_checksums = md5sum.CalculateDeviceMd5Sums(
886 device_paths_to_md5, self)
887 except EnvironmentError as e:
888 logging.warning('Error calculating md5: %s', e)
889 return [(host_path, device_path)]
886 890
887 if os.path.isfile(host_path): 891 if os.path.isfile(host_path):
888 host_checksum = host_checksums.get(real_host_path) 892 host_checksum = host_checksums.get(real_host_path)
889 device_checksum = device_checksums.get(real_device_path) 893 device_checksum = device_checksums.get(real_device_path)
890 if host_checksum != device_checksum: 894 if host_checksum != device_checksum:
891 return [(host_path, device_path)] 895 return [(host_path, device_path)]
892 else: 896 else:
893 return [] 897 return []
894 else: 898 else:
895 to_push = [] 899 to_push = []
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
1607 blacklist = device_blacklist.ReadBlacklist() 1611 blacklist = device_blacklist.ReadBlacklist()
1608 def blacklisted(adb): 1612 def blacklisted(adb):
1609 if adb.GetDeviceSerial() in blacklist: 1613 if adb.GetDeviceSerial() in blacklist:
1610 logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial()) 1614 logging.warning('Device %s is blacklisted.', adb.GetDeviceSerial())
1611 return True 1615 return True
1612 return False 1616 return False
1613 1617
1614 return [cls(adb) for adb in adb_wrapper.AdbWrapper.Devices() 1618 return [cls(adb) for adb in adb_wrapper.AdbWrapper.Devices()
1615 if not blacklisted(adb)] 1619 if not blacklisted(adb)]
1616 1620
OLDNEW
« no previous file with comments | « build/android/pylib/constants/__init__.py ('k') | build/android/pylib/utils/md5sum.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698