OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 an interface to communicate with the device via the adb command. | 5 """Provides an interface to communicate with the device via the adb command. |
6 | 6 |
7 Assumes adb binary is currently on system path. | 7 Assumes adb binary is currently on system path. |
8 """ | 8 """ |
9 # pylint: disable-all | 9 # pylint: disable-all |
10 | 10 |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1015 Returns: | 1015 Returns: |
1016 A list of tuples of the form (host_path, device_path) for files whose | 1016 A list of tuples of the form (host_path, device_path) for files whose |
1017 md5sums do not match. | 1017 md5sums do not match. |
1018 """ | 1018 """ |
1019 | 1019 |
1020 # Md5Sum resolves symbolic links in path names so the calculation of | 1020 # Md5Sum resolves symbolic links in path names so the calculation of |
1021 # relative path names from its output will need the real path names of the | 1021 # relative path names from its output will need the real path names of the |
1022 # base directories. Having calculated these they are used throughout the | 1022 # base directories. Having calculated these they are used throughout the |
1023 # function since this makes us less subject to any future changes to Md5Sum. | 1023 # function since this makes us less subject to any future changes to Md5Sum. |
1024 real_host_path = os.path.realpath(host_path) | 1024 real_host_path = os.path.realpath(host_path) |
1025 self.RunShellCommand('mkdir -p "%s"' % device_path) | |
jbudorick
2014/05/20 01:33:13
I don't think that GetFilesChanged should be creat
navabi
2014/05/20 01:49:15
I agree that this should not create directories on
Kibeom Kim (inactive)
2014/05/20 01:58:29
Done.
| |
1025 real_device_path = self.RunShellCommand('realpath "%s"' % device_path)[0] | 1026 real_device_path = self.RunShellCommand('realpath "%s"' % device_path)[0] |
1026 | 1027 |
1027 host_hash_tuples, device_hash_tuples = self._RunMd5Sum( | 1028 host_hash_tuples, device_hash_tuples = self._RunMd5Sum( |
1028 real_host_path, real_device_path) | 1029 real_host_path, real_device_path) |
1029 | 1030 |
1030 if len(host_hash_tuples) > len(device_hash_tuples): | 1031 if len(host_hash_tuples) > len(device_hash_tuples): |
1031 logging.info('%s files do not exist on the device' % | 1032 logging.info('%s files do not exist on the device' % |
1032 (len(host_hash_tuples) - len(device_hash_tuples))) | 1033 (len(host_hash_tuples) - len(device_hash_tuples))) |
1033 | 1034 |
1034 host_rel = [(os.path.relpath(os.path.normpath(t.path), real_host_path), | 1035 host_rel = [(os.path.relpath(os.path.normpath(t.path), real_host_path), |
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1969 """ | 1970 """ |
1970 def __init__(self, output): | 1971 def __init__(self, output): |
1971 self._output = output | 1972 self._output = output |
1972 | 1973 |
1973 def write(self, data): | 1974 def write(self, data): |
1974 data = data.replace('\r\r\n', '\n') | 1975 data = data.replace('\r\r\n', '\n') |
1975 self._output.write(data) | 1976 self._output.write(data) |
1976 | 1977 |
1977 def flush(self): | 1978 def flush(self): |
1978 self._output.flush() | 1979 self._output.flush() |
OLD | NEW |