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

Side by Side Diff: build/android/pylib/android_commands.py

Issue 308793009: Don't push md5sum every time it is used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 host_path: Path (file or directory) on the host. 975 host_path: Path (file or directory) on the host.
976 device_path: Path on the device. 976 device_path: Path on the device.
977 977
978 Returns: 978 Returns:
979 A tuple containing lists of the host and device md5sum results as 979 A tuple containing lists of the host and device md5sum results as
980 created by _ParseMd5SumOutput(). 980 created by _ParseMd5SumOutput().
981 """ 981 """
982 md5sum_dist_path = os.path.join(constants.GetOutDirectory(), 982 md5sum_dist_path = os.path.join(constants.GetOutDirectory(),
983 'md5sum_dist') 983 'md5sum_dist')
984 assert os.path.exists(md5sum_dist_path), 'Please build md5sum.' 984 assert os.path.exists(md5sum_dist_path), 'Please build md5sum.'
985 command = 'push %s %s' % (md5sum_dist_path, MD5SUM_DEVICE_FOLDER) 985 md5sum_dist_mtime = os.stat(md5sum_dist_path).st_mtime
986 assert _HasAdbPushSucceeded(self._adb.SendCommand(command)) 986 if (md5sum_dist_path not in self._push_if_needed_cache or
987 self._push_if_needed_cache[md5sum_dist_path] != md5sum_dist_mtime):
988 command = 'push %s %s' % (md5sum_dist_path, MD5SUM_DEVICE_FOLDER)
989 assert _HasAdbPushSucceeded(self._adb.SendCommand(command))
990 self._push_if_needed_cache[md5sum_dist_path] = md5sum_dist_mtime
987 991
988 (_, md5_device_output) = self.GetAndroidToolStatusAndOutput( 992 (_, md5_device_output) = self.GetAndroidToolStatusAndOutput(
989 self._util_wrapper + ' ' + MD5SUM_DEVICE_PATH + ' ' + device_path, 993 self._util_wrapper + ' ' + MD5SUM_DEVICE_PATH + ' ' + device_path,
990 lib_path=MD5SUM_DEVICE_FOLDER, 994 lib_path=MD5SUM_DEVICE_FOLDER,
991 timeout_time=2 * 60) 995 timeout_time=2 * 60)
992 device_hash_tuples = _ParseMd5SumOutput(md5_device_output) 996 device_hash_tuples = _ParseMd5SumOutput(md5_device_output)
993 assert os.path.exists(host_path), 'Local path not found %s' % host_path 997 assert os.path.exists(host_path), 'Local path not found %s' % host_path
994 md5sum_output = cmd_helper.GetCmdOutput( 998 md5sum_output = cmd_helper.GetCmdOutput(
995 [os.path.join(constants.GetOutDirectory(), 'md5sum_bin_host'), 999 [os.path.join(constants.GetOutDirectory(), 'md5sum_bin_host'),
996 host_path]) 1000 host_path])
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 """ 1981 """
1978 def __init__(self, output): 1982 def __init__(self, output):
1979 self._output = output 1983 self._output = output
1980 1984
1981 def write(self, data): 1985 def write(self, data):
1982 data = data.replace('\r\r\n', '\n') 1986 data = data.replace('\r\r\n', '\n')
1983 self._output.write(data) 1987 self._output.write(data)
1984 1988
1985 def flush(self): 1989 def flush(self):
1986 self._output.flush() 1990 self._output.flush()
OLDNEW
« 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